preview-latex: Customization
B.4 Customization
=================
B.4.1 How to include additional environments like 'enumerate'
-------------------------------------------------------------
By default, preview-latex is intended mainly for displaying mathematical
formulas, so environments like 'enumerate' or 'tabular' (except where
contained in a float) are not included. You can include them however
manually by adding the lines:
\usepackage[displaymath,textmath,sections,graphics,floats]{preview}
\PreviewEnvironment{enumerate}
in your document header, that is before
\begin{document}
In general, 'preview' should be loaded as the last thing before the
start of document.
Be aware that
\PreviewEnvironment{...}
does not accept a comma separated list! Also note that by putting
more and more
\PreviewEnvironment{...}
in your document, it will look more and more like a DVI file preview
when running preview-latex. Since each preview is treated as one large
monolithic block by Emacs, one should really restrict previews to those
elements where the improvement in visual representation more than makes
up for the decreased editability.
B.4.2 What if I don't want to change the document?
--------------------------------------------------
The easiest way is to generate a configuration file in the current
directory. You can basically either create 'prdefault.cfg' which is
used for any use of the 'preview' package, or you can use 'prauctex.cfg'
which only applies to the use from with Emacs. Let us assume you use
the latter. In that case you should write something like
\InputIfFileExists{preview/prauctex.cfg}{}{}
\PreviewEnvironment{enumerate}
in it. The first line inputs the system-wide default configuration
(the file name should match that, but not your own 'prauctex.cfg'), then
you add your own stuff.
B.4.3 Suddenly I get gazillions of ridiculous pages?!?
------------------------------------------------------
When preview-latex works on extracting its stuff, it typesets each
single preview on a page of its own. This only happens when actual
previews get generated. Now if you want to configure preview-latex in
your document, you need to add your own '\usepackage' call to 'preview'
so that it will be able to interpret its various definition commands.
It is an error to add the 'active' option to this invocation: you don't
want the package to be active unless preview-latex itself enables the
previewing operation (which it will).
B.4.4 Does preview-latex work with presentation classes?
--------------------------------------------------------
preview-latex should work with most presentation classes. However,
since those classes often have macros or pseudo environments
encompassing a complete slide, you will need to use the customization
facilities of 'preview.sty' to tell it how to resolve this, whether you
want no previews, previews of whole slides or previews of inner
material.