preview-latex: The preview images
6.3 The preview images
======================
'preview-image-type'
'preview-image-creators'
'preview-gs-image-type-alist'
What happens when LaTeX is finished depends on the configuration of
'preview-image-type'. What to do for each of the various settings
is specified in the variable 'preview-image-creators'. The options
to pass into Ghostscript and what Emacs image type to use is
specified in 'preview-gs-image-type-alist'.
'preview-image-type' defaults to 'png'. For this to work, your
version of Ghostscript needs to support the 'png16m' device. If
you are experiencing problems here, you might want to reconfigure
'gs-image-type-alist' or 'preview-image-type'. Reconfiguring
'preview-image-creators' is only necessary for adding additional
image types.
Most devices make preview-latex start up a single Ghostscript
process for the entire preview run (as opposed to one per image)
and feed it either sections of a PDF file (if PDFLaTeX was used),
or (after running Dvips) sections of a single PostScript file or
separate EPS files in sequence for conversion into PNG format which
can be displayed much faster by Emacs. Actually, not in sequence
but backwards since you are most likely editing at the end of the
document. And as an added convenience, any preview that happens to
be on-screen is given higher priority so that preview-latex will
first cater for the images that are displayed. There are various
options customizable concerning aspects of that operation, see the
customization group 'Preview Gs' for this.
Another noteworthy setting of 'preview-image-type' is 'dvipng': in
this case, the 'dvipng' program will get run on DVI output (see
below for PDF). This is in general much faster than Dvips and
Ghostscript. In that case, the option
'preview-dvipng-command'
will get run for doing the conversion, and it is expected that
'preview-dvipng-image-type'
images get produced ('dvipng' might be configured for other image
types as well). You will notice that 'preview-gs-image-type-alist'
contains an entry for 'dvipng': this actually has nothing to with
'dvipng' itself but specifies the image type and Ghostscript device
option to use when 'dvipng' can't be used. This will obviously be
the case for PDF output by PDFLaTeX, but it will also happen if the
DVI file contains PostScript specials in which case the affected
images will get run through Dvips and Ghostscript once 'dvipng'
finishes.
'preview-gs-options'
Most interesting to the user perhaps is the setting of this
variable. It contains the default antialiasing settings
'-dTextAlphaBits=4' and '-dGraphicsAlphaBits=4'. Decreasing those
values to 2 or 1 might increase Ghostscript's performance if you
find it lacking.
Running and feeding Ghostscript from preview-latex happens
asynchronously again: you can resume editing while the images arrive.
While those pretty pictures filling in the blanks on screen tend to make
one marvel instead of work, rendering the non-displayed images
afterwards will not take away your attention and will eventually
guarantee that jumping around in the document will encounter only
prerendered images.