Previous: Installation Trouble, Up: Frequently Asked Questions


B.4 Customization

B.4.1 Why don't I get balloon help like in the screen shots?

Some users have reported problems with their XEmacs version, so balloon help is now off by default. Use the Preview/Customize menu or <M-x> customize-variable in order to customize preview-use-balloon-help to `On'. This only concerns XEmacs: tooltips under GNU Emacs are enabled by default and unproblematic.

B.4.2 How to include additionally environments like enumerate

Per default, preview-latex 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.3 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.4 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.5 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.

B.5 Troubleshooting

B.5.1 Preview causes all sort of strange error messages

When running preview-latex and taking a look at either log file or terminal output, lots of messages like

     ! Preview: Snippet 3 started.
     <-><->
     
     l.52 \item Sie lassen sich als Funktion $
                                              y = f(x)$ darstellen.
     ! Preview: Snippet 3 ended.(491520+163840x2494310).
     <-><->
     
     l.52 \item Sie lassen sich als Funktion $y = f(x)$
                                                        darstellen.

appear (previous versions generated messages looking even more like errors). Those are not real errors (as will be noted in the log file). Or rather, while they are really TeX error messages, they are intentional. This currently is the only reliable way to pass the information from the LaTeX run of preview-latex to its Emacs part about where the previews originated in the source text. Since they are actual errors, you will also get AUCTeX to state

     Preview-LaTeX exited as expected with code 1 at Wed Sep  4 17:03:30

after the LaTeX run in the run buffer. This merely indicates that errors were present, and errors will always be present when preview-latex is operating. There might be also real errors, so in case of doubt, look for them explicitly in either run buffer or the resulting .log file.

B.6 preview-latex when not using LaTeX

B.6.1 Does preview-latex work with PDFLaTeX?

Yes, but the foreground color appears fixed to black. Competent volunteers to fix this welcome. PDFLaTeX works fine with AUCTeX version 11.50 or later. For earlier versions, you need to have LaTeX-command-style configured manually to call PDFLaTeX.

B.6.2 Does preview-latex work with `elatex'?

No problem here. If you configure your AUCTeX to use `elatex', or simply have `latex' point to `elatex', this will work fine.

B.6.3 Does preview-latex work with ConTeXt?

In short, no. The `preview' package is LaTeX-dependent. Adding support for other formats requires volunteers.

B.6.4 Does preview-latex work with plain TeX?

Again, no. Restructuring the `preview' package for `plain' operation would be required. Volunteers welcome.

In some cases you might get around by making a wrapper pseudo-Master file looking like the following:

     \documentclass{article}
     \usepackage{plain}
     \begin{document}
     \begin{plain}
     \input myplainfile
     \end{plain}
     \end{document}