2023-07-27 19:52:58 +00:00
This is preview-latex.info, produced by makeinfo version 7.0.3 from
2022-08-25 17:42:37 +00:00
preview-latex.texi.
This manual is for preview-latex, a LaTeX preview mode for AUCTeX
2023-07-27 19:52:58 +00:00
(version 13.2.1 from 2023-07-20).
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2017-2019, 2021 Free
Software Foundation, Inc.
2022-08-25 17:42:37 +00:00
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts and no
Back-Cover Texts. A copy of the license is included in the section
2023-07-27 19:52:58 +00:00
entitled “GNU Free Documentation License.”
2022-08-25 17:42:37 +00:00
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* preview-latex: (preview-latex). Preview LaTeX fragments in Emacs
END-INFO-DIR-ENTRY
INFO-DIR-SECTION TeX
START-INFO-DIR-ENTRY
* preview-latex: (preview-latex). Preview LaTeX fragments in Emacs
END-INFO-DIR-ENTRY
File: preview-latex.info, Node: Top, Prev: (dir), Up: (dir)
preview-latex
*************
This manual may be copied under the conditions spelled out in *note
Copying this Manual::.
preview-latex is a package embedding preview fragments into Emacs
source buffers under the AUCTeX editing environment for LaTeX. It uses
2023-07-27 19:52:58 +00:00
‘ preview.sty’ for the extraction of certain environments (most notably
2022-08-25 17:42:37 +00:00
displayed formulas). Other applications of this style file are possible
and exist.
2023-07-27 19:52:58 +00:00
The name of the package is really ‘ preview-latex’ , all in lowercase
2022-08-25 17:42:37 +00:00
letters, with a hyphen. If you typeset it, you can use a sans-serif
font to visually offset it.
* Menu:
* Copying:: Copying
* Introduction:: Getting started.
* Installation:: Make Install.
* Keys and lisp:: Key bindings and user-level lisp functions.
* Simple customization:: To make it fit in.
* Known problems:: When things go wrong.
* For advanced users:: Internals and more customizations.
* ToDo:: Future development.
* Frequently Asked Questions:: All about preview-latex
* Copying this Manual:: GNU Free Documentation License
* Index:: A menu of many topics.
File: preview-latex.info, Node: Copying, Next: Introduction, Prev: Top, Up: Top
Copying
*******
For the conditions for copying parts of preview-latex, see the General
Public Licenses referred to in the copyright notices of the files, the
General Public Licenses accompanying them and the explanatory section in
*note (auctex)Copying::.
This manual specifically is covered by the GNU Free Documentation
License (*note Copying this Manual::).
File: preview-latex.info, Node: Introduction, Next: Installation, Prev: Copying, Up: Top
1 Introduction
**************
Does your neck hurt from turning between previewer windows and the
source too often? This AUCTeX component will render your displayed
LaTeX equations right into the editing window where they belong.
The purpose of preview-latex is to embed LaTeX environments such as
display math or figures into the source buffers and switch conveniently
between source and image representation.
* Menu:
* What use is it?::
* Activating preview-latex::
* Getting started::
* Basic modes of operation::
* More documentation::
* Availability::
* Contacts::
File: preview-latex.info, Node: What use is it?, Next: Activating preview-latex, Prev: Introduction, Up: Introduction
1.1 What use is it?
===================
WYSIWYG (what you see is what you get) sometimes is considered all the
rage, sometimes frowned upon. Do we really want it? Wrong question.
The right question is _what_ we want from it. Except when finetuning
2023-07-27 19:52:58 +00:00
the layout, we don’ t want to use printer fonts for on-screen text
2022-08-25 17:42:37 +00:00
editing. The low resolution and contrast of a computer screen render
all but the coarsest printer fonts (those for low-quality newsprint)
unappealing, and the margins and pagination of the print are not wanted
on the screen, either. On the other hand, more complex visual
2023-07-27 19:52:58 +00:00
compositions like math formulas and tables can’ t easily be taken in when
2022-08-25 17:42:37 +00:00
seen only in the source. preview-latex strikes a balance: it only uses
graphic renditions of the output for certain, configurable constructs,
does this only when told, and then right in the source code. Switching
back and forth between the source and preview is easy and natural and
can be done for each image independently. Behind the scenes of
preview-latex, a sophisticated framework of other programs like
2023-07-27 19:52:58 +00:00
‘ dvipng’ , Dvips and Ghostscript are employed together with a special
2022-08-25 17:42:37 +00:00
LaTeX style file for extracting the material of interest in the
background and providing fast interactive response.
File: preview-latex.info, Node: Activating preview-latex, Next: Getting started, Prev: What use is it?, Up: Introduction
1.2 Activating preview-latex
============================
After installation, the package may need to be activated (and remember
to activate AUCTeX too). If preview-latex is installed via the Emacs
package manager (ELPA), activation should be automatic upon
installation.
The usual activation (if it is not done automatically) would be
(load "preview-latex.el" nil t t)
2023-07-27 19:52:58 +00:00
If you still don’ t get a “Preview” menu in LaTeX mode in spite of
AUCTeX showing its “Command”, your installation is broken. One possible
cause are duplicate Lisp files that might be detectable with ‘ M-x
list-load-path-shadows <RET>’ .
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: Getting started, Next: Basic modes of operation, Prev: Activating preview-latex, Up: Introduction
1.3 Getting started
===================
Once activated, preview-latex and its documentation will be accessible
via its menus (note that preview-latex requires AUCTeX to be loaded).
2023-07-27 19:52:58 +00:00
When you have loaded a LaTeX document (a sample document ‘ circ.tex’ is
2022-08-25 17:42:37 +00:00
included in the distribution, but most documents including math and/or
2023-07-27 19:52:58 +00:00
figures should do), you can use its menu or ‘ C-c C-p C-d’ (for
‘ Preview/Document’ ). Previews will now be generated for various objects
2022-08-25 17:42:37 +00:00
in your document. You can use the time to take a short look at the
2023-07-27 19:52:58 +00:00
other menu entries and key bindings in the ‘ Preview’ menu. You’ ll see
2022-08-25 17:42:37 +00:00
the previewed objects change into a roadworks sign when preview-latex
has determined just what it is going to preview. Note that you can
freely navigate the buffer while this is going on. When the process is
finished you will see the objects typeset in your buffer.
It is a bad idea, however, to edit the buffer before the roadworks
signs appear, since that is the moment when the correlation between the
original text and the buffer locations gets established. If the buffer
changes before that point of time, the previews will not be placed where
they belong. If you do want to change some obvious error you just
2023-07-27 19:52:58 +00:00
spotted, we recommend you stop the background process by pressing ‘ C-c
C-k’ .
2022-08-25 17:42:37 +00:00
To see/edit the LaTeX code for a specific object, put the point (the
2023-07-27 19:52:58 +00:00
cursor) on it and press ‘ C-c C-p C-p’ (for ‘ Preview/at point’ ). It will
2022-08-25 17:42:37 +00:00
also do to click with the middle mouse button on the preview. Now you
2023-07-27 19:52:58 +00:00
can edit the code, and generate a new preview by again pressing ‘ C-c C-p
C-p’ (or by clicking with the middle mouse button on the icon before the
2022-08-25 17:42:37 +00:00
edited text).
2023-07-27 19:52:58 +00:00
If you are using the ‘ desktop’ package, previews will remain from one
session to the next as long as you don’ t kill your buffer.
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: Basic modes of operation, Next: More documentation, Prev: Getting started, Up: Introduction
1.4 Basic modes of operation
============================
preview-latex has a number of methods for generating its graphics. Its
2023-07-27 19:52:58 +00:00
default operation is equivalent to using the ‘ LaTeX’ command from
2022-08-25 17:42:37 +00:00
AUCTeX. If this happens to be a call of PDFLaTeX generating PDF output
(you need at least AUCTeX 11.51 for this), then Ghostscript will be
called directly on the resulting PDF file. If a DVI file gets produced,
first Dvips and then Ghostscript get called by default.
The image type to be generated by Ghostscript can be configured with
M-x customize-option <RET> preview-image-type <RET>
2023-07-27 19:52:58 +00:00
The default is ‘ png’ (the most efficient image type). A special setting
is ‘ dvipng’ in case you have the ‘ dvipng’ program installed. In this
case, ‘ dvipng’ will be used for converting DVI files and Ghostscript
(with a ‘ PNG’ device) for converting PDF files. ‘ dvipng’ is much faster
2022-08-25 17:42:37 +00:00
than the combination of Dvips and Ghostscript. You can get downloads,
access to its CVS archive and further information from its project site
(https://savannah.nongnu.org/projects/dvipng).
File: preview-latex.info, Node: More documentation, Next: Availability, Prev: Basic modes of operation, Up: Introduction
1.5 More documentation
======================
After the installation, documentation in the form of this info manual
will be available. You can access it with the standalone info reader
with
info preview-latex
2023-07-27 19:52:58 +00:00
or by pressing ‘ C-h i d m preview-latex <RET>’ in Emacs. Once
preview-latex is activated, you can instead use ‘ C-c C-p <TAB>’ (or the
menu entry ‘ Preview/Read documentation’ ).
2022-08-25 17:42:37 +00:00
Depending on your installation, a printable manual may also be
2023-07-27 19:52:58 +00:00
available in the form of ‘ preview-latex.pdf’ .
2022-08-25 17:42:37 +00:00
Detailed documentation for the LaTeX style used for extracting the
2023-07-27 19:52:58 +00:00
preview images is placed in ‘ preview.pdf’ in a suitable directory during
2022-08-25 17:42:37 +00:00
installation; on typical TeX Live-based systems,
texdoc preview
will display it.
File: preview-latex.info, Node: Availability, Next: Contacts, Prev: More documentation, Up: Introduction
1.6 Availability
================
The preview-latex project is now part of AUCTeX and accessible as part
of the AUCTeX project page (https://savannah.gnu.org/projects/auctex).
You can get its files from the AUCTeX download area
(https://ftp.gnu.org/pub/gnu/auctex/). As of AUCTeX 11.81,
preview-latex should already be integrated into AUCTeX, so no separate
download will be necessary.
Anonymous Git is available at <git://git.savannah.gnu.org/auctex.git>
or <https://git.savannah.gnu.org/git/auctex.git>. You can also browse
the repository (https://git.savannah.gnu.org/cgit/auctex.git) via web
interface.
File: preview-latex.info, Node: Contacts, Prev: Availability, Up: Introduction
1.7 Contacts
============
2023-07-27 19:52:58 +00:00
Bug reports should be sent by using ‘ M-x preview-report-bug <RET>’ , as
2022-08-25 17:42:37 +00:00
this will fill in a lot of information interesting to us. If the
installation fails (but this should be a rare event), report bugs to
<bug-auctex@gnu.org>.
There is a general discussion list for AUCTeX which also covers
preview-latex, look at <https://lists.gnu.org/mailman/listinfo/auctex>.
For more information on the mailing list, send a message with just the
2023-07-27 19:52:58 +00:00
word “help” as subject or body to <auctex-request@gnu.org>. For the
2022-08-25 17:42:37 +00:00
developers, there is the <auctex-devel@gnu.org> list; it would probably
make sense to direct feature requests and questions about internal
details there. There is a low-volume read-only announcement list
2023-07-27 19:52:58 +00:00
available to which you can subscribe by sending a mail with “subscribe”
2022-08-25 17:42:37 +00:00
in the subject to <info-auctex-request@gnu.org>.
Offers to support further development will be appreciated. If you
want to show your appreciation with a donation to the main developer,
you can do so via PayPal to <dak@gnu.org>, and of course you can arrange
for service contracts or for added functionality. Take a look at the
2023-07-27 19:52:58 +00:00
‘ TODO’ list for suggestions in that area.
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: Installation, Next: Keys and lisp, Prev: Introduction, Up: Top
2 Installation
**************
Installation is now being covered in *note (auctex)Installation::.
File: preview-latex.info, Node: Keys and lisp, Next: Simple customization, Prev: Installation, Up: Top
3 Key bindings and user-level lisp functions
********************************************
2023-07-27 19:52:58 +00:00
preview-latex adds key bindings starting with ‘ C-c C-p’ to the supported
2022-08-25 17:42:37 +00:00
modes of AUCTeX (*Note (auctex)Key Index::). It will also add its own
2023-07-27 19:52:58 +00:00
‘ Preview’ menu in the menu bar, as well as an icon in the toolbar.
2022-08-25 17:42:37 +00:00
The following only describes the interactive use: view the
2023-07-27 19:52:58 +00:00
documentation strings with ‘ C-h f’ if you need the Lisp information.
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-p’
‘ preview-at-point’
2022-08-25 17:42:37 +00:00
Preview/Generate previews (or toggle) at point
If the cursor is positioned on or inside of a preview area, this
toggles its visibility, regenerating the preview if necessary. If
not, it will run the surroundings through preview. The
surroundings include all areas up to the next valid preview, unless
invalid previews occur before, in which case the area will include
the last such preview in either direction. And overriding any
2023-07-27 19:52:58 +00:00
other action, if a region is active (‘ transient-mark-mode’ ), it is
run through ‘ preview-region’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ <mouse-2>’
2022-08-25 17:42:37 +00:00
The middle mouse button has a similar action bound to it as
2023-07-27 19:52:58 +00:00
‘ preview-at-point’ , only that it knows which preview to apply it to
2022-08-25 17:42:37 +00:00
according to the position of the click. You can click either
anywhere on a previewed image, or when the preview is opened and
showing the source text, you can click on the icon preceding the
source text. In other areas, the usual mouse key action
(typically: paste) is not affected.
2023-07-27 19:52:58 +00:00
‘ <mouse-3>’
2022-08-25 17:42:37 +00:00
The right mouse key pops up a context menu with several options:
toggling the preview, regenerating it, removing it (leaving the
unpreviewed text), copying the text inside of the preview, and
copying it in a form suitable for copying as an image into a mail
or news article. This is a one-image variant of the following
command:
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-w’
‘ preview-copy-region-as-mml’
2022-08-25 17:42:37 +00:00
Copy a region as MML
This command is also available as a variant in the context menu on
the right mouse button (where the region is the preview that has
been clicked on). It copies the current region into the kill
buffer in a form suitable for copying as a text including images
into a mail or news article using mml-mode (*note Composing:
(emacs-mime)Composing.).
If you regenerate or otherwise kill the preview in its source
buffer before the mail or news gets posted, this will fail. Also
you should generate images you want to send with
2023-07-27 19:52:58 +00:00
‘ preview-transparent-border’ set to ‘ nil’ , or the images will have
2022-08-25 17:42:37 +00:00
an ugly border. preview-latex detects this condition and asks
whether to regenerate the region with borders switched off. As
2023-07-27 19:52:58 +00:00
this is an asynchronous operation running in the background, you’ ll
2022-08-25 17:42:37 +00:00
need to call this command explicitly again to get the newly
generated images into the kill ring.
2023-07-27 19:52:58 +00:00
Preview your articles with ‘ mml-preview’ (on ‘ C-c C-m P’ ) to make
2022-08-25 17:42:37 +00:00
sure they look fine.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-e’
‘ preview-environment’
2022-08-25 17:42:37 +00:00
Preview/Generate previews for environment
Run preview on LaTeX environment. The environments in
2023-07-27 19:52:58 +00:00
‘ preview-inner-environments’ are treated as inner levels so that
for instance, the ‘ split’ environment in
‘ \begin{equation}\begin{split}...\end{split}\end{equation}’ is
2022-08-25 17:42:37 +00:00
properly displayed. If called with a numeric argument, the
corresponding number of outward nested environments is treated as
inner levels.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-s’
‘ preview-section’
2022-08-25 17:42:37 +00:00
Preview/Generate previews for section
Run preview on this LaTeX section.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-r’
‘ preview-region’
2022-08-25 17:42:37 +00:00
Preview/Generate previews for region
Run preview on current region.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-b’
‘ preview-buffer’
2022-08-25 17:42:37 +00:00
Preview/Generate previews for buffer
Run preview on the current buffer.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-d’
‘ preview-document’
2022-08-25 17:42:37 +00:00
Preview/Generate previews for document
Run preview on the current document.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-c C-p’
‘ preview-clearout-at-point’
2022-08-25 17:42:37 +00:00
Preview/Remove previews at point
Clear out (remove) the previews that are immediately adjacent to
point.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-c C-s’
‘ preview-clearout-section’
2022-08-25 17:42:37 +00:00
Preview/Remove previews from section
Clear out all previews in current section.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-c C-r’
‘ preview-clearout’
2022-08-25 17:42:37 +00:00
Preview/Remove previews from region
Clear out all previews in the current region.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-c C-b’
‘ preview-clearout-buffer’
2022-08-25 17:42:37 +00:00
Preview/Remove previews from buffer
Clear out all previews in current buffer. This makes the current
buffer lose all previews.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-c C-d’
‘ preview-clearout-document’
2022-08-25 17:42:37 +00:00
Preview/Remove previews from document
Clear out all previews in current document. The document consists
of all buffers that have the same master file as the current
buffer. This makes the current document lose all previews.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-f’
‘ preview-cache-preamble’
2022-08-25 17:42:37 +00:00
Preview/Turn preamble cache on
Dump a pregenerated format file. For the rest of the session, this
file is used when running on the same master file. Use this if you
know your LaTeX takes a long time to start up, the speedup will be
most noticeable when generating single or few previews. If you
change your preamble, do this again. preview-latex will try to
detect the necessity of that automatically when editing changes to
the preamble are done from within Emacs, but it will not notice if
the preamble effectively changes because some included file or
style file is tampered with.
Note that support for preamble cache is limited for LaTeX variants.
c.f. <https://github.com/davidcarlisle/dpctex/issues/15>
2023-07-27 19:52:58 +00:00
• XeLaTeX cannot use preamble cache at all. The reason is
intrinsic in XeLaTeX, so preview-latex can’ t help.
• LuaLaTeX works with preamble cache only when the preamble is
simple enough, i.e., when it doesn’ t load opentype fonts and
it doesn’ t use lua codes in preamble.
‘ C-c C-p C-c C-f’
‘ preview-cache-preamble-off’
2022-08-25 17:42:37 +00:00
Preview/Turn preamble cache off
Clear the pregenerated format file and stop using preambles for the
current document. If the caching gives you problems, use this.
2023-07-27 19:52:58 +00:00
‘ C-c C-p C-i’
‘ preview-goto-info-page’
2022-08-25 17:42:37 +00:00
Preview/Read Documentation
Read this info manual.
2023-07-27 19:52:58 +00:00
‘ M-x preview-report-bug <RET>’
‘ preview-report-bug’
2022-08-25 17:42:37 +00:00
Preview/Report Bug
This is the preferred way of reporting bugs as it will fill in what
version of preview-latex you are using as well as versions of
relevant other software, and also some of the more important
settings. Please use this method of reporting, if at all possible
and before reporting a bug, have a look at *note Known problems::.
2023-07-27 19:52:58 +00:00
‘ C-c C-k’
2022-08-25 17:42:37 +00:00
LaTeX/TeX Output/Kill Job
Kills the preview-generating process. This is really an AUCTeX
keybinding, but it is included here as a hint. If you are
generating a preview and then make a change to the buffer,
preview-latex may be confused and place the previews wrong.
File: preview-latex.info, Node: Simple customization, Next: Known problems, Prev: Keys and lisp, Up: Top
4 Simple customization
**********************
2023-07-27 19:52:58 +00:00
Customization options can be found by typing ‘ M-x customize-group <RET>
preview <RET>’ . Remember to set the option when you have changed it.
2022-08-25 17:42:37 +00:00
The list of suggestions can be made very long (and is covered in detail
in *note For advanced users::), but some are:
2023-07-27 19:52:58 +00:00
• Change the color of the preview background
2022-08-25 17:42:37 +00:00
If you use a non-white background in Emacs, you might have color
artifacts at the edges of your previews. Playing around with the
2023-07-27 19:52:58 +00:00
option ‘ preview-transparent-color’ in the ‘ Preview Appearance’
2022-08-25 17:42:37 +00:00
group might improve things. With some settings, the cursor may
cover the whole background of a preview, however.
This option is specific to the display engine in use.
2023-07-27 19:52:58 +00:00
• Showing ‘ \label’ s
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
When using preview-latex, the ‘ \label’ s are hidden by the previews.
2022-08-25 17:42:37 +00:00
It is possible to make them visible in the output by using the
2023-07-27 19:52:58 +00:00
LaTeX package ‘ showkeys’ alternatively ‘ showlabels’ . However, the
2022-08-25 17:42:37 +00:00
boxes of these labels will be outside the region preview-latex
considers as the preview image. To enable a similar mechanism
2023-07-27 19:52:58 +00:00
internal to preview-latex, enable the ‘ showlabels’ option in the
variable ‘ preview-default-option-list’ in the ‘ Preview Latex’
2022-08-25 17:42:37 +00:00
group.
It must be noted, however, that a much better idea may be to use
the RefTeX package for managing references. *Note RefTeX in a
Nutshell: (reftex)RefTeX in a Nutshell.
2023-07-27 19:52:58 +00:00
• Open previews automatically
2022-08-25 17:42:37 +00:00
The current default is to open previews automatically when you
enter them with cursor left/right motions. Auto-opened previews
will close again once the cursor leaves them again (this is also
done when doing incremental search, or query-replace operations),
unless you changed anything in it. In that case, you will have to
2023-07-27 19:52:58 +00:00
regenerate the preview (via e.g., ‘ C-c C-p C-p’ ). Other options
for ‘ preview-auto-reveal’ are available via ‘ customize’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
• Automatically cache preambles
2022-08-25 17:42:37 +00:00
Currently preview-latex asks you whether you want to cache the
2023-07-27 19:52:58 +00:00
document preamble (everything before ‘ \begin{document}’ ) before it
2022-08-25 17:42:37 +00:00
generates previews for a buffer the first time. Caching the
preamble will significantly speed up regeneration of previews. The
larger your preamble is, the more this will be apparent. Once a
preamble is cached, preview-latex will try to keep track of when it
is changed, and dump a fresh format in that case. If you
experience problems with this, or if you want it to happen without
asking you the first time, you can customize the variable
2023-07-27 19:52:58 +00:00
‘ preview-auto-cache-preamble’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
• Attempt to keep counters accurate when editing
2022-08-25 17:42:37 +00:00
Since preview-latex frequently runs only small regions through
LaTeX, values like equation counters are not consistent from run to
run. If this bothers you, customize the variable
2023-07-27 19:52:58 +00:00
‘ preview-preserve-counters’ to ‘ t’ (this is consulted by
‘ preview-required-option-list’ ). LaTeX will then output a load of
2022-08-25 17:42:37 +00:00
counter information during compilation, and this information will
be used on subsequent updates to keep counters set to useful
values. The additional information takes additional time to
analyze, but this is relevant mostly only when you are regenerating
all previews at once, and maybe you will be less tempted to do so
when counters appear more or less correct.
2023-07-27 19:52:58 +00:00
• Preview your favourite LaTeX constructs
2022-08-25 17:42:37 +00:00
If you have a certain macro or environment that you want to
preview, first check if it can be chosen by cutomizing
2023-07-27 19:52:58 +00:00
‘ preview-default-option-list’ in the ‘ Preview Latex’ group.
2022-08-25 17:42:37 +00:00
If it is not available there, you can add it to
2023-07-27 19:52:58 +00:00
‘ preview-default-preamble’ also in the ‘ Preview Latex’ group, by
adding a ‘ \PreviewMacro’ or ‘ \PreviewEnvironment’ entry (*note
Provided commands::) _after_ the ‘ \RequirePackage’ line. For
example, if you want to preview the ‘ center’ environment, press the
2022-08-25 17:42:37 +00:00
<Show> button and the last <INS> button, then add
\PreviewEnvironment{center}
2023-07-27 19:52:58 +00:00
in the space that just opened. Note that since ‘ center’ is a
2022-08-25 17:42:37 +00:00
generic formatting construct of LaTeX, a general configuration like
that is not quite prudent. You better to do this on a per-document
base so that it is easy to disable this behavior when you find this
particular entry gives you trouble.
One possibility is to save such settings in the corresponding
file-local variable instead of your global configuration (*note
Local Variables in Files: (emacs)File Variables.). A perhaps more
convenient place for such options would be in a configuration file
in the same directory with your project (*note Package options::).
The usual file for preview-latex preconfiguration is
2023-07-27 19:52:58 +00:00
‘ prauctex.cfg’ . If you also want to keep the systemwide defaults,
2022-08-25 17:42:37 +00:00
you should add a line
\InputIfFileExists{preview/prauctex.cfg}{}{}
2023-07-27 19:52:58 +00:00
to your own version of ‘ prauctex.cfg’ (this is assuming that global
files relating to the ‘ preview’ package are installed in a
subdirectory ‘ preview’ , the default behavior).
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
• Don’ t preview inline math
2022-08-25 17:42:37 +00:00
If you have performance problems because your document is full of
2023-07-27 19:52:58 +00:00
inline math (‘ $...$’ ), or if your usage of ‘ $’ conflicts with
preview-latex’ s, you can turn off inline math previews. In the
‘ Preview Latex’ group, remove ‘ textmath’ from
‘ preview-default-option-list’ by customizing this variable.
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: Known problems, Next: For advanced users, Prev: Simple customization, Up: Top
5 Known problems
****************
A number of issues are known concerning the interoperation with various
other software. Some of the known problems can be solved by moving to
newer versions of the problematic software or by simple patches.
* Menu:
* Font problems with Dvips::
* Too small bounding boxes::
* x-symbol interoperation::
* Middle-clicks paste instead of toggling::
* No images are displayed with gs 9.27 and earlier::
2022-11-08 03:31:08 +00:00
* Black texts are too hard to read on dark background::
2022-08-25 17:42:37 +00:00
If you find something not mentioned here, please send a bug report
2023-07-27 19:52:58 +00:00
using ‘ M-x preview-report-bug <RET>’ , which will fill in a lot of
2022-08-25 17:42:37 +00:00
information interesting to us and send it to the <bug-auctex@gnu.org>
list. Please use the bug reporting commands if at all possible.
File: preview-latex.info, Node: Font problems with Dvips, Next: Too small bounding boxes, Up: Known problems
5.1 Font problems with Dvips
============================
Some fonts have been reported to produce wrong characters with
preview-latex. preview-latex calls Dvips by default with the option
2023-07-27 19:52:58 +00:00
‘ -Pwww’ in order to get scalable fonts for nice results. If you are
2022-08-25 17:42:37 +00:00
using antialiasing, however, the results might be sufficiently nice with
2023-07-27 19:52:58 +00:00
bitmapped fonts, anyway. You might try ‘ -Ppdf’ for another stab at
2022-08-25 17:42:37 +00:00
scalable fonts, or other printer definitions. Use
2023-07-27 19:52:58 +00:00
‘ M-x customize-option <RET> preview-fast-dvips-command <RET>’
2022-08-25 17:42:37 +00:00
and
2023-07-27 19:52:58 +00:00
‘ M-x customize-option <RET> preview-dvips-command <RET>’
2022-08-25 17:42:37 +00:00
in order to customize this.
One particular problem is that several printer setup files (typically
2023-07-27 19:52:58 +00:00
in a file called ‘ /usr/share/texmf/dvips/config/config.pdf’ if you are
using the ‘ -Ppdf’ switch) contain the ‘ G’ option for ‘ character
shifting’ . This option will result in ‘ fi’ being rendered as ‘£’
2022-08-25 17:42:37 +00:00
(British Pounds sign) in several fonts, unless your version of Dvips has
a long-standing bug in its implementation fixed (only very recent
versions of Dvips have).
File: preview-latex.info, Node: Too small bounding boxes, Next: x-symbol interoperation, Prev: Font problems with Dvips, Up: Known problems
5.2 Too small bounding boxes
============================
The bounding box of a preview is determined by the LaTeX package using
the pure TeX bounding boxes. If there is material extending outside of
the TeX box, that material will be missing from the preview image. This
2023-07-27 19:52:58 +00:00
happens for the label-showing boxes from the ‘ showkeys’ package. This
particular problem can be circumvented by using the ‘ showlabels’ option
2022-08-25 17:42:37 +00:00
of the preview package.
In general, you should try to fix the problem in the TeX code, like
avoiding drawing outside of the picture with PSTricks.
2023-07-27 19:52:58 +00:00
One possible remedy is to set ‘ preview-fast-conversion’ to ‘ Off’
2022-08-25 17:42:37 +00:00
(*note The Emacs interface::). The conversion will take more time, but
will then use the bounding boxes from EPS files generated by Dvips.
Dvips generally does not miss things, but it does not understand
2023-07-27 19:52:58 +00:00
PostScript constructs like ‘ \resizebox’ or ‘ \rotate’ commands, so will
2022-08-25 17:42:37 +00:00
generate rather wrong boxes for those. Dvips can be helped with the
2023-07-27 19:52:58 +00:00
‘ psfixbb’ package option to preview (*note The LaTeX style file::),
2022-08-25 17:42:37 +00:00
which will tag the corners of the included TeX box. This will mostly be
convenient for _pure_ PostScript stuff like that created by PSTricks,
which Dvips would otherwise reserve no space for.
File: preview-latex.info, Node: x-symbol interoperation, Next: Middle-clicks paste instead of toggling, Prev: Too small bounding boxes, Up: Known problems
5.3 x-symbol interoperation
===========================
Thanks to the work of Christoph Wedler, starting with version
2023-07-27 19:52:58 +00:00
‘ 4.0h/beta’ of x-symbol, the line parsing of AUCTeX and preview-latex is
2022-08-25 17:42:37 +00:00
fully supported. Earlier versions exhibit problems. However, versions
2023-07-27 19:52:58 +00:00
before ‘ 4.2.2’ will cause a drastic slowdown of preview-latex’ s parsing
pass, so we don’ t recommend to use versions earlier than that.
2022-08-25 17:42:37 +00:00
If you wonder what x-symbol is, it is a package that transforms
various tokens and subscripts to a more readable form while editing and
offers a few input methods handy especially for dealing with math. Take
a look at <http://x-symbol.sourceforge.net/>.
2023-07-27 19:52:58 +00:00
x-symbol versions up to ‘ 4.5.1-beta’ at least require an 8bit-clean
2022-08-25 17:42:37 +00:00
TeX implementation (meaning that its terminal output should not use
2023-07-27 19:52:58 +00:00
‘ ^^’ -started escape sequences) for cooperation with preview-latex.
2022-08-25 17:42:37 +00:00
Later versions may get along without it, like preview-latex does now.
2023-07-27 19:52:58 +00:00
If you experience problems with ‘ circ.tex’ in connection with both
2022-08-25 17:42:37 +00:00
x-symbol and Latin-1 characters, you may need to change your language
environment or, as a last resort, customize the variable
2023-07-27 19:52:58 +00:00
‘ LaTeX-command-style’ by replacing the command ‘ latex’ with ‘ latex
-translate-file=cp8bit’ .
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: Middle-clicks paste instead of toggling, Next: No images are displayed with gs 9.27 and earlier, Prev: x-symbol interoperation, Up: Known problems
5.4 Middle-clicks paste instead of toggling
===========================================
2023-07-27 19:52:58 +00:00
This is probably the fault of your favorite package. ‘ isearch.el’ is
2022-08-25 17:42:37 +00:00
known to be affected while searches are in progress, but the code is
such a complicated mess that no patch is in sight. Better just end the
2023-07-27 19:52:58 +00:00
search with ‘ <RET>’ before toggling and resume with ‘ C-s C-s’ or similar
2022-08-25 17:42:37 +00:00
afterwards. Since previews over the current match will auto-open,
anyway, this should not be much of a problem in practice.
2022-11-08 03:31:08 +00:00
File: preview-latex.info, Node: No images are displayed with gs 9.27 and earlier, Next: Black texts are too hard to read on dark background, Prev: Middle-clicks paste instead of toggling, Up: Known problems
2022-08-25 17:42:37 +00:00
5.5 No images are displayed with gs 9.27 and earlier
====================================================
preview-latex tries to adjust the foreground and background colors of
generated images to those of Emacs. Unfortunately, incompatible changes
introduced in Ghostscript 9.27 breaks the traditional method partially,
and preview-latex can display no images under certain circumstances.
A new method implemented alternatively works only with Ghostscript >
9.27. If you are using Ghostscript 9.27 or earlier, customize the
2023-07-27 19:52:58 +00:00
option ‘ preview-pdf-adjust-color-method’ .
2022-08-25 17:42:37 +00:00
-- User Option: preview-pdf-adjust-color-method
Method to adjust colors of images generated from PDF. It is not
consulted when the LaTeX command produces DVI files.
2023-07-27 19:52:58 +00:00
When the option is ‘ t’ (default), preview-latex adjusts the FG and
2022-08-25 17:42:37 +00:00
BG colors of the generated images by the new method. This method
2023-07-27 19:52:58 +00:00
requires that Ghostscript has working ‘ DELAYBIND’ feature, thus is
2022-08-25 17:42:37 +00:00
invalid with gs 9.27 (and possibly < 9.27).
2023-07-27 19:52:58 +00:00
When it is ‘ compatible’ , preview-latex uses traditional method.
2022-08-25 17:42:37 +00:00
This option is provided for backward compatibility with older gs.
See the below explanation for detail.
2023-07-27 19:52:58 +00:00
When ‘ nil’ , no adjustment is done and “black on white” image is
2022-08-25 17:42:37 +00:00
generated regardless of Emacs color. This is provided for fallback
for gs 9.27 users with customized foreground color. See the below
explanation for detail.
When the LaTeX command produces PDF rather than DVI and Emacs has
2023-07-27 19:52:58 +00:00
non-trivial foreground color, the traditional method (‘ compatible’ )
makes gs >= 9.27 to stop with error. Here, “non-trivial foreground
color” includes customized themes.
2022-08-25 17:42:37 +00:00
If you use such non-trivial foreground color and the version of
Ghostscript equals to 9.27, you have two options:
2023-07-27 19:52:58 +00:00
1. Choose the value ‘ compatible’ and customize
‘ preview-reference-face’ to have default (black) foreground
2022-08-25 17:42:37 +00:00
color. This makes the generated image almost non-readable on
dark background, so the next option would be your only choice
in that case.
2023-07-27 19:52:58 +00:00
2. Choose the value ‘ nil’ , which forces plain “black on white”
2022-08-25 17:42:37 +00:00
appearance for the generated image. You can at least read
what are written in the image although they may not match with
your Emacs color well.
2023-07-27 19:52:58 +00:00
The default value used to be ‘ compatible’ for short period before
Ghostscript 9.50 was released but now is ‘ t’ .
2022-08-25 17:42:37 +00:00
2022-11-08 03:31:08 +00:00
File: preview-latex.info, Node: Black texts are too hard to read on dark background, Prev: No images are displayed with gs 9.27 and earlier, Up: Known problems
5.6 Black texts are too hard to read on dark background
=======================================================
Unfortunately, foreground color adjustment discussed in the previous
2023-07-27 19:52:58 +00:00
node doesn’ t work for XeLaTeX for technical reason. The texts are
always rendered as black in the preview images, so it’ s almost
2022-11-08 03:31:08 +00:00
impossible to read them on dark background. Hence XeLaTeX users who
like dark background in Emacs frame should customize
2023-07-27 19:52:58 +00:00
‘ preview-pdf-adjust-color-method’ to ‘ nil’ .
2022-11-08 03:31:08 +00:00
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: For advanced users, Next: ToDo, Prev: Known problems, Up: Top
6 For advanced users
********************
This package consists of two parts: a LaTeX style that splits the output
into appropriate parts with one preview object on each page, and an
Emacs-lisp part integrating the thing into Emacs (aided by AUCTeX).
* Menu:
* The LaTeX style file::
* The Emacs interface::
* The preview images::
* Misplaced previews::
File: preview-latex.info, Node: The LaTeX style file, Next: The Emacs interface, Prev: For advanced users, Up: For advanced users
6.1 The LaTeX style file
========================
The main purpose of this package is the extraction of certain
environments (most notably displayed formulas) from LaTeX sources as
graphics. This works with DVI files postprocessed by either Dvips and
Ghostscript or dvipng, but it also works when you are using PDFTeX for
generating PDF files (usually also postprocessed by Ghostscript).
Current uses of the package include the preview-latex package for
WYSIWYG functionality in the AUCTeX editing environment, generation of
previews in LyX, as part of the operation of the pst-pdf package, the
tbook XML system and some other tools.
2023-07-27 19:52:58 +00:00
Producing EPS files with Dvips and its derivatives using the ‘ -E’
2022-08-25 17:42:37 +00:00
option is not a good alternative: People make do by fiddling around with
2023-07-27 19:52:58 +00:00
‘ \thispagestyle{empty}’ and hoping for the best (namely, that the
2022-08-25 17:42:37 +00:00
specified contents will indeed fit on single pages), and then trying to
guess the baseline of the resulting code and stuff, but this is at best
dissatisfactory. The preview package provides an easy way to ensure
that exactly one page per request gets shipped, with a well-defined
baseline and no page decorations. While you still can use the preview
2023-07-27 19:52:58 +00:00
package with the ‘ classic’
2022-08-25 17:42:37 +00:00
dvips -E -i
2023-07-27 19:52:58 +00:00
invocation, there are better ways available that don’ t rely on Dvips not
2022-08-25 17:42:37 +00:00
getting confused by PostScript specials.
2023-07-27 19:52:58 +00:00
For most applications, you’ ll want to make use of the ‘ tightpage’
2022-08-25 17:42:37 +00:00
option. This will embed the page dimensions into the PostScript or PDF
2023-07-27 19:52:58 +00:00
code, obliterating the need to use the ‘ -E -i’ options to Dvips. You
2022-08-25 17:42:37 +00:00
can then produce all image files with a single run of Ghostscript from a
single PDF or PostScript (as opposed to EPS) file.
Various options exist that will pass TeX dimensions and other
information about the respective shipped out material (including
descender size) into the log file, where external applications might
make use of it.
The possibility for generating a whole set of graphics with a single
run of Ghostscript (whether from LaTeX or PDFLaTeX) increases both speed
and robustness of applications. It is also feasible to use dvipng on a
DVI file with the options
-picky -noghostscript
to omit generating any image file that requires Ghostscript, then let a
script generate all missing files using Dvips/Ghostscript. This will
usually speed up the process significantly.
* Menu:
* Package options::
* Provided commands::
File: preview-latex.info, Node: Package options, Next: Provided commands, Prev: The LaTeX style file, Up: The LaTeX style file
6.1.1 Package options
---------------------
The package is included with the customary
\usepackage[OPTIONS]{preview}
You should usually load this package as the last one, since it redefines
several things that other packages may also provide.
The following options are available:
2023-07-27 19:52:58 +00:00
‘ active’
2022-08-25 17:42:37 +00:00
is the most essential option. If this option is not specified, the
2023-07-27 19:52:58 +00:00
‘ preview’ package will be inactive and the document will be typeset
as if the ‘ preview’ package were not loaded, except that all
2022-08-25 17:42:37 +00:00
declarations and environments defined by the package are still
legal but have no effect. This allows defining previewing
characteristics in your document, and only activating them by
calling LaTeX as
latex '\PassOptionsToPackage{active}{preview} \input{FILENAME}'
2023-07-27 19:52:58 +00:00
‘ noconfig’
Usually the file ‘ prdefault.cfg’ gets loaded whenever the ‘ preview’
package gets activated. ‘ prdefault.cfg’ is supposed to contain
2022-08-25 17:42:37 +00:00
definitions that can cater for otherwise bad results, for example,
if a certain document class would otherwise lead to trouble. It
also can be used to override any settings made in this package,
since it is loaded at the very end of it. In addition, there may
2023-07-27 19:52:58 +00:00
be configuration files specific for certain ‘ preview’ options like
‘ auctex’ which have more immediate needs. The ‘ noconfig’ option
2022-08-25 17:42:37 +00:00
suppresses loading of those option files, too.
2023-07-27 19:52:58 +00:00
‘ psfixbb’
2022-08-25 17:42:37 +00:00
Dvips determines the bounding boxes from the material in the DVI
file it understands. Lots of PostScript specials are not part of
that. Since the TeX boxes do not make it into the DVI file, but
merely characters, rules and specials do, Dvips might include far
2023-07-27 19:52:58 +00:00
too small areas. The option ‘ psfixbb’ will include ‘ /dev/null’ as
2022-08-25 17:42:37 +00:00
a graphic file in the ultimate upper left and lower right corner of
the previewed box. This will make Dvips generate an appropriate
bounding box.
2023-07-27 19:52:58 +00:00
‘ dvips’
2022-08-25 17:42:37 +00:00
If this option is specified as a class option or to other packages,
several packages pass things like page size information to Dvips,
or cause crop marks or draft messages written on pages. This
seriously hampers the usability of previews. If this option is
specified, the changes will be undone if possible.
2023-07-27 19:52:58 +00:00
‘ pdftex’
2022-08-25 17:42:37 +00:00
If this option is set, PDFTeX is assumed as the output driver.
2023-07-27 19:52:58 +00:00
This mainly affects the ‘ tightpage’ option.
‘ xetex’
2022-08-25 17:42:37 +00:00
If this option is set, XeTeX is assumed as the output driver. This
2023-07-27 19:52:58 +00:00
mainly affects the ‘ tightpage’ option.
‘ displaymath’
2022-08-25 17:42:37 +00:00
will make all displayed math environments subject to preview
processing. This will typically be the most desired option.
2023-07-27 19:52:58 +00:00
‘ floats’
2022-08-25 17:42:37 +00:00
will make all float objects subject to preview processing. If you
want to be more selective about what floats to pass through to a
2023-07-27 19:52:58 +00:00
preview, you should instead use the ‘ \PreviewSnarfEnvironment’
2022-08-25 17:42:37 +00:00
command on the floats you want to have previewed.
2023-07-27 19:52:58 +00:00
‘ textmath’
2022-08-25 17:42:37 +00:00
will make all text math subject to previews. Since math mode is
used throughly inside of LaTeX even for other purposes, this works
2023-07-27 19:52:58 +00:00
by redefining ‘ \(’ , ‘ \)’ and ‘ $’ and the ‘ math’ environment
2022-08-25 17:42:37 +00:00
(apparently some people use that). Only occurences of these text
math delimiters in later loaded packages and in the main document
will thus be affected.
2023-07-27 19:52:58 +00:00
‘ graphics’
will subject all ‘ \includegraphics’ commands to a preview.
‘ sections’
2022-08-25 17:42:37 +00:00
will subject all section headers to a preview.
2023-07-27 19:52:58 +00:00
‘ delayed’
will delay all activations and redefinitions the ‘ preview’ package
makes until ‘ \’ ‘ begin{document}’ . The purpose of this is to cater
for documents which should be subjected to the ‘ preview’ package
2022-08-25 17:42:37 +00:00
without having been prepared for it. You can process such
documents with
latex '\RequirePackage[active,delayed,OPTIONS]{preview}
\input{FILENAME}'
2023-07-27 19:52:58 +00:00
This relaxes the requirement to be loading the ‘ preview’ package as
2022-08-25 17:42:37 +00:00
last package.
DRIVER
2023-07-27 19:52:58 +00:00
loads a special driver file ‘ prDRIVER.def’ . The remaining options
2022-08-25 17:42:37 +00:00
are implemented through the use of driver files.
2023-07-27 19:52:58 +00:00
‘ auctex’
2022-08-25 17:42:37 +00:00
This driver will produce fake error messages at the start and end
of every preview environment that enable the Emacs package
preview-latex in connection with AUCTeX to pinpoint the exact
source location where the previews have originated. Unfortunately,
there is no other reliable means of passing the current TeX input
position _in_ a line to external programs. In order to make the
parsing more robust, this option also switches off quite a few
diagnostics that could be misinterpreted.
You should not specify this option manually, since it will only be
needed by automated runs that want to parse the pseudo error
2023-07-27 19:52:58 +00:00
messages. Those runs will then use ‘ \PassOptionsToPackage’ in
order to effect the desired behaviour. In addition, ‘ prauctex.cfg’
will get loaded unless inhibited by the ‘ noconfig’ option. This
2022-08-25 17:42:37 +00:00
caters for the most frequently encountered problematic commands.
2023-07-27 19:52:58 +00:00
‘ showlabels’
2022-08-25 17:42:37 +00:00
During the editing process, some people like to see the label names
in their equations, figures and the like. Now if you are using
2023-07-27 19:52:58 +00:00
Emacs for editing, and in particular preview-latex, I’ d strongly
2022-08-25 17:42:37 +00:00
recommend that you check out the RefTeX package which pretty much
obliterates the need for this kind of functionality. If you still
2023-07-27 19:52:58 +00:00
want it, standard LaTeX provides it with the ‘ showkeys’ package,
and there is also the less encompassing ‘ showlabels’ package.
2022-08-25 17:42:37 +00:00
Unfortunately, since those go to some pain not to change the page
2023-07-27 19:52:58 +00:00
layout and spacing, they also don’ t change ‘ preview’ ’ s idea of the
2022-08-25 17:42:37 +00:00
TeX dimensions of the involved boxes. So if you are using
2023-07-27 19:52:58 +00:00
‘ preview’ for determing bounding boxes, those packages are mostly
useless. The option ‘ showlabels’ offers a substitute for them.
‘ tightpage’
It is not uncommon to want to use the results of ‘ preview’ as
2022-08-25 17:42:37 +00:00
graphic images for some other application. One possibility is to
generate a flurry of EPS files with
dvips -E -i -Pwww -o OUTPUTFILE.000 INPUTFILE
However, in case those are to be processed further into graphic
image files by Ghostscript, this process is inefficient since all
of those files need to be processed one by one. In addition, it is
necessary to extract the bounding box comments from the EPS files
and convert them into page dimension parameters for Ghostscript in
order to avoid full-page graphics. This is not even possible if
you wanted to use Ghostscript in a _single_ run for generating the
files from a single PostScript file, since Dvips will in that case
leave no bounding box information anywhere.
2023-07-27 19:52:58 +00:00
The solution is to use the ‘ tightpage’ option. That way a single
2022-08-25 17:42:37 +00:00
command line like
gs -sDEVICE=png16m -dTextAlphaBits=4 -r300
-dGraphicsAlphaBits=4 -dSAFER -q -dNOPAUSE
-sOutputFile=OUTPUTFILE%d.png INPUTFILE.ps
will be able to produce tight graphics from a single PostScript
2023-07-27 19:52:58 +00:00
file generated with Dvips _without_ use of the options ‘ -E -i’ , in
2022-08-25 17:42:37 +00:00
a single run.
2023-07-27 19:52:58 +00:00
The ‘ tightpage’ option actually also works when using the ‘ pdftex’
2022-08-25 17:42:37 +00:00
option and generating PDF files with PDFTeX. The resulting PDF
file has separate page dimensions for every page and can directly
be converted with one run of Ghostscript into image files.
2023-07-27 19:52:58 +00:00
If neither ‘ dvips’ or ‘ pdftex’ have been specified, the
2022-08-25 17:42:37 +00:00
corresponding option will get autodetected and invoked.
2023-07-27 19:52:58 +00:00
If you need this in a batch environment where you don’ t want to use
‘ preview’ ’ s automatic extraction facilities, no problem: just don’ t
2022-08-25 17:42:37 +00:00
use any of the extraction options, and wrap everything to be
2023-07-27 19:52:58 +00:00
previewed into ‘ preview’ environments. This is how LyX does its
2022-08-25 17:42:37 +00:00
math previews.
2023-07-27 19:52:58 +00:00
If the pages under the ‘ tightpage’ option are just too tight, you
can adjust by setting the length ‘ \PreviewBorder’ to a different
value by using ‘ \setlength’ . The default value is ‘ 0.50001bp’ ,
2022-08-25 17:42:37 +00:00
which is half of a usual PostScript point, rounded up. If you go
2023-07-27 19:52:58 +00:00
below this value, the resulting page size may drop below ‘ 1bp’ , and
2022-08-25 17:42:37 +00:00
Ghostscript does not seem to like that. If you need finer control,
you can adjust the bounding box dimensions individually by changing
2023-07-27 19:52:58 +00:00
the macro ‘ \PreviewBbAdjust’ with the help of ‘ \renewcommand’ . Its
2022-08-25 17:42:37 +00:00
default value is
\newcommand \PreviewBbAdjust
{-\PreviewBorder -\PreviewBorder
\PreviewBorder \PreviewBorder}
This adjusts the left, lower, right and upper borders by the given
amount. The macro must contain 4 TeX dimensions after another, and
you may not omit the units if you specify them explicitly instead
2023-07-27 19:52:58 +00:00
of by register. PostScript points have the unit ‘ bp’ .
‘ lyx’
2022-08-25 17:42:37 +00:00
This option is for the sake of LyX developers. It will output a
2023-07-27 19:52:58 +00:00
few diagnostics relevant for the sake of LyX’ preview functionality
2022-08-25 17:42:37 +00:00
(at the time of writing, mostly implemented for math insets, in
versions of LyX starting with 1.3.0).
2023-07-27 19:52:58 +00:00
‘ counters’
2022-08-25 17:42:37 +00:00
This writes out diagnostics at the start and the end of previews.
Only the counters changed since the last output get written, and if
no counters changed, nothing gets written at all. The list
2023-07-27 19:52:58 +00:00
consists of counter name and value, both enclosed in ‘ {}’ braces,
2022-08-25 17:42:37 +00:00
followed by a space. The last such pair is followed by a colon
2023-07-27 19:52:58 +00:00
(‘ :’ ) if it is at the start of the preview snippet, and by a period
(‘ .’ ) if it is at the end. The order of different diagnostics like
2022-08-25 17:42:37 +00:00
this being issued depends on the order of the specification of the
options when calling the package.
Systems like preview-latex use this for keeping counters accurate
when single previews are regenerated.
2023-07-27 19:52:58 +00:00
‘ footnotes’
2022-08-25 17:42:37 +00:00
This makes footnotes render as previews, and only as their footnote
symbol. A convenient editing feature inside of Emacs.
The following options are just for debugging purposes of the package
and similar to the corresponding TeX commands they allude to:
2023-07-27 19:52:58 +00:00
‘ tracingall’
2022-08-25 17:42:37 +00:00
causes lots of diagnostic output to appear in the log file during
2023-07-27 19:52:58 +00:00
the preview collecting phases of TeX’ s operation. In contrast to
2022-08-25 17:42:37 +00:00
the similarly named TeX command, it will not switch to
2023-07-27 19:52:58 +00:00
‘ \errorstopmode’ , nor will it change the setting of
‘ \tracingonline’ .
‘ showbox’
2022-08-25 17:42:37 +00:00
This option will show the contents of the boxes shipped out to the
2023-07-27 19:52:58 +00:00
DVI files. It also sets ‘ \showboxbreadth’ and ‘ \showboxdepth’ to
2022-08-25 17:42:37 +00:00
their maximum values at the end of loading this package, but you
2023-07-27 19:52:58 +00:00
may reset them if you don’ t like that.
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: Provided commands, Prev: Package options, Up: The LaTeX style file
6.1.2 Provided commands
-----------------------
2023-07-27 19:52:58 +00:00
‘ \begin{preview}...\end{preview}’
The ‘ preview’ environment causes its contents to be set as a single
2022-08-25 17:42:37 +00:00
preview image. Insertions like figures and footnotes (except those
included in minipages) will typically lead to error messages or be
2023-07-27 19:52:58 +00:00
lost. In case the ‘ preview’ package has not been activated, the
2022-08-25 17:42:37 +00:00
contents of this environment will be typeset normally.
2023-07-27 19:52:58 +00:00
‘ \begin{nopreview}...\end{nopreview}’
The ‘ nopreview’ environment will cause its contents not to undergo
any special treatment by the ‘ preview’ package. When ‘ preview’ is
2022-08-25 17:42:37 +00:00
active, the contents will be discarded like all main text that does
2023-07-27 19:52:58 +00:00
not trigger the ‘ preview’ hooks. When ‘ preview’ is not active, the
2022-08-25 17:42:37 +00:00
contents will be typeset just like the main text.
Note that both of these environments typeset things as usual when
preview is not active. If you need something typeset
2023-07-27 19:52:58 +00:00
conditionally, use the ‘ \ifPreview’ conditional for it.
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ \PreviewMacro’
If you want to make a macro like ‘ \includegraphics’ (actually, this
is what is done by the ‘ graphics’ option to ‘ preview’ ) produce a
2022-08-25 17:42:37 +00:00
preview image, you put a declaration like
\PreviewMacro[*[[!]{\includegraphics}
or, more readable,
\PreviewMacro[{*[][]{}}]{\includegraphics}
2023-07-27 19:52:58 +00:00
into your preamble. The optional argument to ‘ \PreviewMacro’
specifies the arguments ‘ \includegraphics’ accepts, since this is
2022-08-25 17:42:37 +00:00
necessary information for properly ending the preview box. Note
that if you are using the more readable form, you have to enclose
2023-07-27 19:52:58 +00:00
the argument in a ‘ [{’ and ‘ }]’ pair. The inner braces are
necessary to stop any included ‘ []’ pairs from prematurely ending
the optional argument, and to make a single ‘ {}’ denoting an
optional argument not get stripped away by TeX’ s argument parsing.
2022-08-25 17:42:37 +00:00
The letters simply mean
2023-07-27 19:52:58 +00:00
‘ *’
indicates an optional ‘ *’ modifier, as in ‘ \includegraphics*’ .
‘ [’
2022-08-25 17:42:37 +00:00
indicates an optional argument in brackets. This syntax is
somewhat baroque, but brief.
2023-07-27 19:52:58 +00:00
‘ []’
2022-08-25 17:42:37 +00:00
also indicates an optional argument in brackets. Be sure to
have encluded the entire optional argument specification in an
additional pair of braces as described above.
2023-07-27 19:52:58 +00:00
‘ !’
2022-08-25 17:42:37 +00:00
indicates a mandatory argument.
2023-07-27 19:52:58 +00:00
‘ {}’
2022-08-25 17:42:37 +00:00
indicates the same. Again, be sure to have that additional
level of braces around the whole argument specification.
2023-07-27 19:52:58 +00:00
‘ ?’ DELIMITER{TRUE CASE}{FALSE CASE}
2022-08-25 17:42:37 +00:00
is a conditional. The next character is checked against being
equal to DELIMITER. If it is, the specification TRUE CASE is
used for the further parsing, otherwise FALSE CASE will be
employed. In neither case is something consumed from the
input, so {TRUE CASE} will still have to deal with the
upcoming delimiter.
2023-07-27 19:52:58 +00:00
‘ @’ {LITERAL SEQUENCE}
2022-08-25 17:42:37 +00:00
will insert the given sequence literally into the executed
call of the command.
2023-07-27 19:52:58 +00:00
‘ -’
2022-08-25 17:42:37 +00:00
will just drop the next token. It will probably be most often
2023-07-27 19:52:58 +00:00
used in the true branch of a ‘ ?’ specification.
‘ #’ {ARGUMENT}{REPLACEMENT}
2022-08-25 17:42:37 +00:00
is a transformation rule that calls a macro with the given
argument and replacement text on the rest of the argument
list. The replacement is used in the executed call of the
command. This can be used for parsing arbitrary constructs.
2023-07-27 19:52:58 +00:00
For example, the ‘ []’ option could manually be implemented
with the option string ‘ ?[{#{[#1]}{[{#1}]}}{}’ . PStricks
2022-08-25 17:42:37 +00:00
users might enjoy this sort of flexibility.
2023-07-27 19:52:58 +00:00
‘ :’ {ARGUMENT}{REPLACEMENT}
is again a transformation rule. As opposed to ‘ #’ , however,
the result of the transformation is parsed again. You’ ll
2022-08-25 17:42:37 +00:00
rarely need this.
There is a second optional argument in brackets that can be used to
declare any default action to be taken instead. This is mostly for
the sake of macros that influence numbering: you would want to keep
2023-07-27 19:52:58 +00:00
their effects in that respect. The default action should use ‘ #1’
2022-08-25 17:42:37 +00:00
for referring to the original (not the patched) command with the
parsed options appended. Not specifying a second optional argument
2023-07-27 19:52:58 +00:00
here is equivalent to specifying ‘ [#1]’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ \PreviewMacro*’
A similar invocation ‘ \PreviewMacro*’ simply throws the macro and
2022-08-25 17:42:37 +00:00
all of its arguments declared in the manner above away. This is
2023-07-27 19:52:58 +00:00
mostly useful for having things like ‘ \footnote’ not do their magic
on their arguments. More often than not, you don’ t want to declare
any arguments to scan to ‘ \PreviewMacro*’ since you would want the
2022-08-25 17:42:37 +00:00
remaining arguments to be treated as usual text and typeset in that
manner instead of being thrown away. An exception might be, say,
2023-07-27 19:52:58 +00:00
sort keys for ‘ \cite’ .
2022-08-25 17:42:37 +00:00
A second optional argument in brackets can be used to declare any
default action to be taken instead. This is for the sake of macros
that influence numbering: you would want to keep their effects in
2023-07-27 19:52:58 +00:00
that respect. The default action might use ‘ #1’ for referring to
2022-08-25 17:42:37 +00:00
the original (not the patched) command with the parsed options
appended. Not specifying a second optional argument here is
2023-07-27 19:52:58 +00:00
equivalent to specifying ‘ []’ since the command usually gets thrown
2022-08-25 17:42:37 +00:00
away.
As an example for using this argument, you might want to specify
\PreviewMacro*[{[]}][#1{}]{\footnote}
This will replace a footnote by an empty footnote, but taking any
optional parameter into account, since an optional paramter changes
the numbering scheme. That way the real argument for the footnote
remains for processing by preview-latex.
2023-07-27 19:52:58 +00:00
‘ \PreviewEnvironment’
The macro ‘ \PreviewEnvironment’ works just as ‘ \PreviewMacro’ does,
2022-08-25 17:42:37 +00:00
only for environments.
2023-07-27 19:52:58 +00:00
‘ \PreviewEnvironment*’
And the same goes for ‘ \PreviewEnvironment*’ as compared to
‘ \PreviewMacro*’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ \PreviewSnarfEnvironment’
2022-08-25 17:42:37 +00:00
This macro does not typeset the original environment inside of a
preview box, but instead typesets just the contents of the original
environment inside of the preview box, leaving nothing for the
original environment. This has to be used for figures, for
example, since they would
1. produce insertion material that cannot be extracted to the
preview properly,
2. complain with an error message about not being in outer par
mode.
2023-07-27 19:52:58 +00:00
‘ \PreviewOpen’
‘ \PreviewClose’
2022-08-25 17:42:37 +00:00
Those Macros form a matched preview pair. This is for macros that
2023-07-27 19:52:58 +00:00
behave similar as ‘ \begin’ and ‘ \end’ of an environment. It is
essential for the operation of ‘ \PreviewOpen’ that the macro
2022-08-25 17:42:37 +00:00
treated with it will open an additional group even when the preview
2023-07-27 19:52:58 +00:00
falls inside of another preview or inside of a ‘ nopreview’
environment. Similarly, the macro treated with ‘ \PreviewClose’
2022-08-25 17:42:37 +00:00
will close an environment even when inactive.
2023-07-27 19:52:58 +00:00
‘ \ifPreview’
In case you need to know whether ‘ preview’ is active, you can use
the conditional ‘ \ifPreview’ together with ‘ \else’ and ‘ \fi’ .
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: The Emacs interface, Next: The preview images, Prev: The LaTeX style file, Up: For advanced users
6.2 The Emacs interface
=======================
2023-07-27 19:52:58 +00:00
You can use ‘ M-x customize-group <RET> preview-latex <RET>’ in order to
2022-08-25 17:42:37 +00:00
customize these variables, or use the menus for it. We explain the
various available options together with explaining how they work
together in making preview-latex work as intended.
2023-07-27 19:52:58 +00:00
‘ preview-LaTeX-command’
2022-08-25 17:42:37 +00:00
When you generate previews on a buffer or a region, the command in
2023-07-27 19:52:58 +00:00
‘ preview-LaTeX-command’ gets run (that variable should only be
2022-08-25 17:42:37 +00:00
changed with Customize since its structure is somewhat peculiar,
though expressive). As usual with AUCTeX, you can continue working
while this is going on. It is not a good idea to change the file
until after preview-latex has established where to place the
previews which it can only do after the LaTeX run completes. This
run produces a host of pseudo-error messages that get parsed by
preview-latex at the end of the LaTeX run and give it the necessary
information about where in the source file the LaTeX code for the
various previews is located exactly. The parsing takes a moment
and will render Emacs busy.
2023-07-27 19:52:58 +00:00
‘ preview-LaTeX-command-replacements’
2022-08-25 17:42:37 +00:00
This variable specifies transformations to be used before calling
2023-07-27 19:52:58 +00:00
the configured command. One possibility is to have ‘ \pdfoutput=0 ’
appended to every command starting with ‘ pdf’ . This particular
2022-08-25 17:42:37 +00:00
setting is available as the shortcut
2023-07-27 19:52:58 +00:00
‘ preview-LaTeX-disable-pdfoutput’ . Since preview-latex can work
2022-08-25 17:42:37 +00:00
with PDF files by now, there is little incentive for using this
option, anymore (for projects not requiring PDF output, the added
2023-07-27 19:52:58 +00:00
speed of ‘ dvipng’ might make this somewhat attractive).
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ preview-required-option-list’
‘ preview-LaTeX-command’ uses ‘ preview-required-option-list’ in
order to pass options such as ‘ auctex’ , ‘ active’ and ‘ dvips’ to the
‘ preview’ package. This means that the user need (and should) not
2022-08-25 17:42:37 +00:00
supply these in the document itself in case he wants to be able to
still compile his document without it turning into an incoherent
mass of little pictures. These options even get passed in when the
2023-07-27 19:52:58 +00:00
user loads ‘ preview’ explicitly in his document.
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
The default includes an option ‘ counters’ that is controlled by the
2022-08-25 17:42:37 +00:00
boolean variable
2023-07-27 19:52:58 +00:00
‘ preview-preserve-counters’
This option will cause the ‘ preview’ package to emit information
2022-08-25 17:42:37 +00:00
that will assist in keeping things like equation counters and
section numbers reasonably correct even when you are regenerating
only single previews.
2023-07-27 19:52:58 +00:00
‘ preview-default-option-list’
‘ preview-default-preamble’
If the document does not call in the package ‘ preview’ itself (via
‘ \usepackage’ ) in the preamble, the preview package is loaded using
default options from ‘ preview-default-option-list’ and additional
commands specified in ‘ preview-default-preamble’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ preview-fast-conversion’
This is relevant only for DVI mode. It defaults to ‘ On’ and
2022-08-25 17:42:37 +00:00
results in the whole document being processed as one large
PostScript file from which the single images are extracted with the
help of parsing the PostScript for use of so-called DSC comments.
The bounding boxes are extracted with the help of TeX instead of
getting them from Dvips. If you are experiencing bounding box
2023-07-27 19:52:58 +00:00
problems, try setting this option to ‘ Off’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ preview-prefer-TeX-bb’
If this option is ‘ On’ , it tells preview-latex never to try to
2022-08-25 17:42:37 +00:00
extract bounding boxes from the bounding box comments of EPS files,
but rather rely on the boxes it gets from TeX. If you activated
2023-07-27 19:52:58 +00:00
‘ preview-fast-conversion’ , this is done, anyhow, since there are no
2022-08-25 17:42:37 +00:00
EPS files from which to read this information. The option defaults
2023-07-27 19:52:58 +00:00
to ‘ Off’ , simply because about the only conceivable reason to
switch off ‘ preview-fast-conversion’ would be that you have some
bounding box problem and want to get Dvips’ angle on that matter.
‘ preview-scale-function’
‘ preview-reference-face’
‘ preview-document-pt-list’
‘ preview-default-document-pt’
‘ preview-scale-function’ determines by what factor images should be
2022-08-25 17:42:37 +00:00
scaled when appearing on the screen. If you specify a numerical
value here, the physical size on the screen will be that of the
original paper output scaled by the specified factor, at least if
2023-07-27 19:52:58 +00:00
Emacs’ information about screen size and resolution are correct.
The default is to let ‘ preview-scale-from-face’ determine the scale
2022-08-25 17:42:37 +00:00
function. This function determines the scale factor by making the
size of the default font in the document match that of the
on-screen fonts.
The size of the screen fonts is deduced from the font
2023-07-27 19:52:58 +00:00
‘ preview-reference-face’ (usually the default face used for
2022-08-25 17:42:37 +00:00
display), the size of the default font for the document is
2023-07-27 19:52:58 +00:00
determined by calling ‘ preview-document-pt’ . This function
consults the members of ‘ preview-document-pt-list’ in turn until it
2022-08-25 17:42:37 +00:00
gets the desired information. The default consults first
2023-07-27 19:52:58 +00:00
‘ preview-parsed-font-size’ , then calls ‘ preview-auctex-font-size’
which asks AUCTeX about any size specification like ‘ 12pt’ to the
2022-08-25 17:42:37 +00:00
documentclass that it might have detected when parsing the
document, and finally reverts to just assuming
2023-07-27 19:52:58 +00:00
‘ preview-default-document-pt’ as the size used in the document
2022-08-25 17:42:37 +00:00
(defaulting to 10pt).
If you find that the size of previews and the other Emacs display
2023-07-27 19:52:58 +00:00
clashes, something goes wrong. ‘ preview-parsed-font-size’ is
determined at ‘ \begin{document}’ time; if the default font size
2022-08-25 17:42:37 +00:00
changes after that, it will not get reported. If you have an
2023-07-27 19:52:58 +00:00
outdated version of ‘ preview.sty’ in your path, the size might not
2022-08-25 17:42:37 +00:00
be reported at all. If in this case AUCTeX is unable to find a
size specification, and if you are using a document class with a
2023-07-27 19:52:58 +00:00
different default value (like ‘ KomaScript’ ), the default fallback
2022-08-25 17:42:37 +00:00
assumption will probably be wrong and preview-latex will scale up
things too large. So better specify those size options even when
you know that LaTeX does not need them: preview-latex might benefit
from them. Another possibility for error is that you have not
2023-07-27 19:52:58 +00:00
enabled AUCTeX’ s document parsing options. The fallback method of
2022-08-25 17:42:37 +00:00
asking AUCTeX about the size might be disabled in future versions
of preview-latex since in general it is more reliable to get this
information from the LaTeX run itself.
2023-07-27 19:52:58 +00:00
‘ preview-fast-dvips-command’
‘ preview-dvips-command’
2022-08-25 17:42:37 +00:00
The regular command for turning a DVI file into a single PostScript
2023-07-27 19:52:58 +00:00
file is ‘ preview-fast-dvips-command’ , while ‘ preview-dvips-command’
2022-08-25 17:42:37 +00:00
is used for cranking out a DVI file where every preview is in a
separate EPS file. Which of the two commands gets used depends on
2023-07-27 19:52:58 +00:00
the setting of ‘ preview-fast-conversion’ . The printer specified
here is ‘ -Pwww’ by default, which will usually get you scalable
2022-08-25 17:42:37 +00:00
fonts where available. If you are experiencing problems, you might
want to try playing around with Dvips options (*Note
(dvips)Command-line options::).
The conversion of the previews into PostScript or EPS files gets
started after the LaTeX run completes when Emacs recognizes the
first image while parsing the error messages. When Emacs has
finished parsing the error messages, it activates all detected
previews. This entails throwing away any previous previews
covering the same areas, and then replacing the text in its visual
appearance by a placeholder looking like a roadworks sign.
2023-07-27 19:52:58 +00:00
‘ preview-nonready-icon-specs’
2022-08-25 17:42:37 +00:00
This is the roadworks sign displayed while previews are being
prepared. You may want to customize the font sizes at which
preview-latex switches over between different icon sizes, and the
ascent ratio which determines how high above the base line the icon
gets placed.
2023-07-27 19:52:58 +00:00
‘ preview-error-icon-specs’
‘ preview-icon-specs’
2022-08-25 17:42:37 +00:00
Those are icons placed before the source code of an opened preview
and, respectively, the image specs to be used for PostScript
errors, and a normal open preview in text representation.
2023-07-27 19:52:58 +00:00
‘ preview-inner-environments’
2022-08-25 17:42:37 +00:00
This is a list of environments that are regarded as inner levels of
2023-07-27 19:52:58 +00:00
an outer environment when doing ‘ preview-environment’ . One example
2022-08-25 17:42:37 +00:00
when this is needed is in
2023-07-27 19:52:58 +00:00
‘ \begin{equation}\begin{split}...\end{split}\end{equation}’ , and
accordingly ‘ split’ is one entry in ‘ preview-inner-environments’ .
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: The preview images, Next: Misplaced previews, Prev: The Emacs interface, Up: For advanced users
6.3 The preview images
======================
2023-07-27 19:52:58 +00:00
‘ preview-image-type’
‘ preview-image-creators’
‘ preview-gs-image-type-alist’
2022-08-25 17:42:37 +00:00
What happens when LaTeX is finished depends on the configuration of
2023-07-27 19:52:58 +00:00
‘ preview-image-type’ . What to do for each of the various settings
is specified in the variable ‘ preview-image-creators’ . The options
2022-08-25 17:42:37 +00:00
to pass into Ghostscript and what Emacs image type to use is
2023-07-27 19:52:58 +00:00
specified in ‘ preview-gs-image-type-alist’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
‘ preview-image-type’ defaults to ‘ png’ . For this to work, your
version of Ghostscript needs to support the ‘ png16m’ device. If
2022-08-25 17:42:37 +00:00
you are experiencing problems here, you might want to reconfigure
2023-07-27 19:52:58 +00:00
‘ preview-gs-image-type-alist’ or ‘ preview-image-type’ .
Reconfiguring ‘ preview-image-creators’ is only necessary for adding
2022-08-25 17:42:37 +00:00
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
2023-07-27 19:52:58 +00:00
customization group ‘ Preview Gs’ for this.
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Another noteworthy setting of ‘ preview-image-type’ is ‘ dvipng’ : in
this case, the ‘ dvipng’ program will get run on DVI output (see
2022-08-25 17:42:37 +00:00
below for PDF). This is in general much faster than Dvips and
Ghostscript. In that case, the option
2023-07-27 19:52:58 +00:00
‘ preview-dvipng-command’
2022-08-25 17:42:37 +00:00
will get run for doing the conversion, and it is expected that
2023-07-27 19:52:58 +00:00
‘ 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
2022-08-25 17:42:37 +00:00
the case for PDF output by PDFLaTeX, but it will also happen if the
DVI file contains PostScript specials in which case the affected
2023-07-27 19:52:58 +00:00
images will get run through Dvips and Ghostscript once ‘ dvipng’
2022-08-25 17:42:37 +00:00
finishes.
2023-07-27 19:52:58 +00:00
Note for pLaTeX and upLaTeX users: It is known that ‘ dvipng’ is not
compatible with pLaTeX and upLaTeX. If ‘ preview-image-type’ is set
to ‘ dvipng’ and (u)pLaTeX is used, ‘ dvipng’ just fails and
2022-08-25 17:42:37 +00:00
preview-latex falls back on Dvips and Ghostscript.
2023-07-27 19:52:58 +00:00
‘ preview-gs-options’
2022-08-25 17:42:37 +00:00
Most interesting to the user perhaps is the setting of this
variable. It contains the default antialiasing settings
2023-07-27 19:52:58 +00:00
‘ -dTextAlphaBits=4’ and ‘ -dGraphicsAlphaBits=4’ . Decreasing those
values to 2 or 1 might increase Ghostscript’ s performance if you
2022-08-25 17:42:37 +00:00
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.
File: preview-latex.info, Node: Misplaced previews, Prev: The preview images, Up: For advanced users
6.4 Misplaced previews
======================
If you are reading this section, the first thing is to check that your
problem is not caused by x-symbol in connection with an installation not
supporting 8-bit characters (*note x-symbol interoperation::). If not,
2023-07-27 19:52:58 +00:00
here’ s the beef:
2022-08-25 17:42:37 +00:00
As explained previously, Emacs uses pseudo-error messages generated
2023-07-27 19:52:58 +00:00
by the ‘ preview’ package in order to pinpoint the exact source location
2022-08-25 17:42:37 +00:00
where a preview originated. This works in running text, but fails when
preview material happens to lie in macro arguments, like the contents of
2023-07-27 19:52:58 +00:00
‘ \emph’ . Those macros first read in their entire argument, munge it
2022-08-25 17:42:37 +00:00
through, perhaps transform it somehow, process it and perhaps then
typeset something. When they finally typeset something, where is the
location where the stuff originated? TeX, having read in the entire
argument before, does not know and actually there would be no sane way
of defining it.
For previews contained inside such a macro argument, the default
behaviour of preview-latex is to use a position immediately after the
closing brace of the argument. All the previews get placed there, all
at a zero-width position, which means that Emacs displays it in an order
that preview-latex cannot influence (currently in Emacs it is even
possible that the order changes between runs). And since the placement
of those previews is goofed up, you will not be able to regenerate them
by clicking on them. The default behaviour is thus somewhat
undesirable.
The solution (like with other preview problems) is to tell the LaTeX
2023-07-27 19:52:58 +00:00
‘ preview’ package how to tackle this problem (*note The LaTeX style
file::). Simply, you don’ t need ‘ \emph’ do anything at all during
2022-08-25 17:42:37 +00:00
previews! You only want the text math previewed, so the solution is to
2023-07-27 19:52:58 +00:00
use ‘ \PreviewMacro*\emph’ in the preamble of your document which will
make LaTeX ignore ‘ \emph’ completely as long as it is not part of a
2022-08-25 17:42:37 +00:00
larger preview (in which case it gets typeset as usual). Its argument
thus becomes ordinary text and gets treated like ordinary text.
Note that it would be a bad idea to declare
2023-07-27 19:52:58 +00:00
‘ \PreviewMacro*[{{}}]\emph’ since then both ‘ \emph’ as well as its
2022-08-25 17:42:37 +00:00
argument would be ignored instead of previewed. For user-level macros,
this is almost never wanted, but there may be internal macros where you
might want to ignore internal arguments.
The same mechanism can be used for a number of other text-formatting
2023-07-27 19:52:58 +00:00
commands like ‘ \textrm’ , ‘ \textit’ and the like. While they all use the
same internal macro ‘ \text@command’ , it will not do to redefine just
2022-08-25 17:42:37 +00:00
that, since they call it only after having read their argument in, and
then it already is too late. So you need to disable every of those
commands by hand in your document preamble.
Actually, we wrote all of the above just to scare you. At least all
of the above mentioned macros and a few more are already catered for by
2023-07-27 19:52:58 +00:00
a configuration file ‘ prauctex.cfg’ that gets loaded by default unless
the ‘ preview’ package gets loaded with the ‘ noconfig’ option. You can
2022-08-25 17:42:37 +00:00
make your own copy of this file in a local directory and edit it in case
of need. You can also add loading of a file of your liking to
2023-07-27 19:52:58 +00:00
‘ preview-default-preamble’ , or alternatively do the manual disabling of
your favorite macro in ‘ preview-default-preamble’ , which is customizable
in the ‘ Preview Latex’ group.
2022-08-25 17:42:37 +00:00
File: preview-latex.info, Node: ToDo, Next: Frequently Asked Questions, Prev: For advanced users, Up: Top
Appendix A ToDo
***************
2023-07-27 19:52:58 +00:00
• Support other formats than just LaTeX
2022-08-25 17:42:37 +00:00
plain TeX users and ConTeXt users should not have to feel left out.
While ConTeXt is not supported yet by released versions of AUCTeX,
at least supporting plain would help people, and be a start for
ConTeXt as well. There are plain-based formats like MusiXTeX that
could benefit a lot from preview-latex. The main part of the
2023-07-27 19:52:58 +00:00
difficulties here is to adapt ‘ preview.dtx’ to produce stuff not
2022-08-25 17:42:37 +00:00
requiring LaTeX.
2023-07-27 19:52:58 +00:00
• Support nested snippets
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Currently you can’ t have both a footnote (which gets displayed as
2022-08-25 17:42:37 +00:00
just its footnote number) and math inside of a footnote rendered as
an image: such nesting might be achieved by rerunning preview-latex
on the footnote contents when one opens the footnote for editing.
2023-07-27 19:52:58 +00:00
• Support other text properties than just images
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Macros like ‘ \textit’ can be rendered as images, but the resulting
2022-08-25 17:42:37 +00:00
humungous blob is not suitable for editing, in particular since the
line filling from LaTeX does not coincide with that of Emacs. It
would be much more useful if text properties just switched the
relevant font to italics rather than replacing the whole text with
an image. It would also make editing quite easier. Then there are
things like footnotes that are currently just replaced by their
footnote number. While editing is not a concern here (the number
is not in the original text, anyway), it would save a lot of
conversion time if no images were generated, but Emacs just
displayed a properly fontified version of the footnote number.
Also, this might make preview-latex useful even on text terminals.
2023-07-27 19:52:58 +00:00
• Find a way to facilitate Source Specials
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Probably in connection with adding appropriate support to ‘ dvipng’ ,
2022-08-25 17:42:37 +00:00
it would be nice if clicking on an image from a larger piece of
source code would place the cursor at the respective source code
location.
2023-07-27 19:52:58 +00:00
• Make ‘ preview.dtx’ look reasonable in AUCTeX
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
It is a bit embarrassing that ‘ preview.dtx’ is written in a manner
2022-08-25 17:42:37 +00:00
that will not give either good syntax highlighting or good
indentation when employing AUCTeX.
2023-07-27 19:52:58 +00:00
• Web page work
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Currently, preview-latex’ s web page is not structured at all.
2022-08-25 17:42:37 +00:00
Better navigation would be desirable, as well as separate News and
Errata eye catchers.
2023-07-27 19:52:58 +00:00
• Manual improvements
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
− Pepper the manual with screen shots and graphics
2022-08-25 17:42:37 +00:00
This will be of interest for the HTML and TeX renditions of
the texinfo manual. Since Texinfo now supports images as
well, this could well be nice to have.
2023-07-27 19:52:58 +00:00
− Fix duplicates
2022-08-25 17:42:37 +00:00
Various stuff appears several times.
2023-07-27 19:52:58 +00:00
• Implement rendering pipelines for Emacs
2022-08-25 17:42:37 +00:00
The current preview-latex interface is fundamentally flawed, not
only because of a broken implementation. A general batchable and
daemonizable rendering infrastructure that can work on all kinds of
preview images for embedding into buffers is warranted. The
current implementation has a rather adhoc flavor and is not easily
extended. It will not work outside of AUCTeX, either.
2023-07-27 19:52:58 +00:00
• Integrate into RefTeX
2022-08-25 17:42:37 +00:00
When referencing to equations and the like, the preview-images of
the source rather than plain text should be displayed. If the
preview in question covers labels, those should appear in the
bubble help and/or a context menu. Apropos:
2023-07-27 19:52:58 +00:00
• Implement LaTeX error indicators
2022-08-25 17:42:37 +00:00
Previews on erroneous LaTeX passages might gain a red border or
similar.
2023-07-27 19:52:58 +00:00
• Pop up relevant online documentation for frequent errors
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
A lot of errors are of the “badly configured” variety. Perhaps the
2022-08-25 17:42:37 +00:00
relevant info pages should be delivered in addition to the error
message.
2023-07-27 19:52:58 +00:00
• Implement a table editing mode where every table cell gets output
2022-08-25 17:42:37 +00:00
as a separate preview. Alternatively, output the complete table
metrics in a way that lets people click on individual cells for
editing purposes.
2023-07-27 19:52:58 +00:00
• Benchmark and kill Emacs inefficiencies
2022-08-25 17:42:37 +00:00
Both the LaTeX run under Emacs control as well as actual image
insertion in Emacs could be faster. CVS Emacs has improved in that
respect, but it still is slower than desirable.
2023-07-27 19:52:58 +00:00
• Improve image support under Emacs
2022-08-25 17:42:37 +00:00
The general image and color handling in Emacs is inefficient and
partly defective. This is still the case in CVS. One option would
be to replace the whole color and image handling with GDK routines
when this library is available, since it has been optimized for it.
File: preview-latex.info, Node: Frequently Asked Questions, Next: Copying this Manual, Prev: ToDo, Up: Top
Appendix B Frequently Asked Questions
*************************************
* Menu:
* Introduction to FAQ::
* Requirements::
* Installation Trouble::
* Customization::
* Troubleshooting::
* Other formats::
File: preview-latex.info, Node: Introduction to FAQ, Next: Requirements, Prev: Frequently Asked Questions, Up: Frequently Asked Questions
B.1 Introduction
================
B.1.1 How can I contribute to the FAQ?
--------------------------------------
Send an email with the subject:
Preview FAQ
to <auctex-devel@gnu.org>.
File: preview-latex.info, Node: Requirements, Next: Installation Trouble, Prev: Introduction to FAQ, Up: Frequently Asked Questions
B.2 Requirements
================
B.2.1 Which version of Emacs is needed?
---------------------------------------
preview-latex nominally requires GNU Emacs with a version of at least
2023-07-27 19:52:58 +00:00
26.1.
2022-08-25 17:42:37 +00:00
B.2.2 Which versions of Ghostscript and AUCTeX are needed?
----------------------------------------------------------
We recommend to use GNU or AFPL Ghostscript with a version of at least
7.07.
preview-latex has been distributed as part of AUCTeX since version
11.80. If your version of AUCTeX is older than that, or if it does not
contain a working copy of preview-latex, complain to wherever you got it
from.
B.2.3 I have trouble with the display format...
-----------------------------------------------
2023-07-27 19:52:58 +00:00
We recommend keeping the variable ‘ preview-image-type’ set to ‘ dvipng’
(if you have it installed) or ‘ png’ . This is the default and can be set
via the ‘ Preview/Customize’ menu.
2022-08-25 17:42:37 +00:00
All other formats are known to have inconveniences, either in file
size or quality. There are some Emacs versions around not supporting
PNG; the proper way to deal with that is to complain to your Emacs
provider. Short of that, checking out PNM or JPEG formats might be a
good way to find out whether the lack of PNG format support might be the
only problem with your Emacs.
B.2.4 For which OS does preview work?
-------------------------------------
It is known to work under the X Window System for Linux and for several
flavors of Unix: we have reports for HP and Solaris.
There are several development versions of Emacs around for native
MacOS Carbon, and preview-latex is working with them, too.
With Windows, both native Emacs and Cygwin Emacs should work.
2023-07-27 19:52:58 +00:00
However, it is known that MiKTeX (https://miktex.org/) sometimes doesn’ t
2022-08-25 17:42:37 +00:00
work with preview-latex. In that case, use TeX Live
(https://tug.org/texlive/) instead.
File: preview-latex.info, Node: Installation Trouble, Next: Customization, Prev: Requirements, Up: Frequently Asked Questions
B.3 Installation Trouble
========================
2023-07-27 19:52:58 +00:00
B.3.1 I just get ‘ LaTeX found no preview images’ .
2022-08-25 17:42:37 +00:00
-------------------------------------------------
The reason for this is that LaTeX found no preview images in the
document in question.
One reason might be that there are no previews to be seen. If you
have not used preview-latex before, you might not know its manner of
operation. One sure-fire way to test if you just have a document where
no previews are to be found is to use the provided example document
2023-07-27 19:52:58 +00:00
‘ circ.tex’ (you will have to copy it to some directory where you have
2022-08-25 17:42:37 +00:00
write permissions). If the symptom persists, you have a problem, and
the problem is most likely a LaTeX problem. Here are possible reasons:
Filename database not updated
Various TeX distributions have their own ways of knowing where the
files are without actually searching directories. The normal
preview-latex installation should detect common tools for that
purpose and use them. If this goes wrong, or if the files get
installed into a place where they are not looked for, the LaTeX run
will fail.
An incomplete manual installation
This should not happen if you followed installation instructions.
Unfortunately, people know better all the time. If only
2023-07-27 19:52:58 +00:00
‘ preview.sty’ gets installed without a set of supplementary files
also in the ‘ latex’ subdirectory, preview-latex runs will not
2022-08-25 17:42:37 +00:00
generate any errors, but they will not produce any previews,
either.
2023-07-27 19:52:58 +00:00
An outdated ‘ preview’ installation
The ‘ preview.sty’ package is useful for more than just
2022-08-25 17:42:37 +00:00
preview-latex. For example, it is part of TeX Live. So you have
to make sure that preview-latex does not get to work with outdated
style and configuration files: some newer features will not work
with older TeX style files, and really old files will make
2023-07-27 19:52:58 +00:00
preview-latex fail completely. There usual is a local ‘ texmf’
2022-08-25 17:42:37 +00:00
tree, or even a user-specific tree that are searched before the
default tree. Make sure that the first version of those files that
gets found is the correct one.
File: preview-latex.info, Node: Customization, Next: Troubleshooting, Prev: Installation Trouble, Up: Frequently Asked Questions
B.4 Customization
=================
2023-07-27 19:52:58 +00:00
B.4.1 How to include additional environments like ‘ enumerate’
2022-08-25 17:42:37 +00:00
-------------------------------------------------------------
By default, preview-latex is intended mainly for displaying mathematical
2023-07-27 19:52:58 +00:00
formulas, so environments like ‘ enumerate’ or ‘ tabular’ (except where
2022-08-25 17:42:37 +00:00
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}
2023-07-27 19:52:58 +00:00
In general, ‘ preview’ should be loaded as the last thing before the
2022-08-25 17:42:37 +00:00
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.
2023-07-27 19:52:58 +00:00
B.4.2 What if I don’ t want to change the document?
2022-08-25 17:42:37 +00:00
--------------------------------------------------
The easiest way is to generate a configuration file in the current
2023-07-27 19:52:58 +00:00
directory. You can basically either create ‘ prdefault.cfg’ which is
used for any use of the ‘ preview’ package, or you can use ‘ prauctex.cfg’
2022-08-25 17:42:37 +00:00
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
2023-07-27 19:52:58 +00:00
file name should match that, but not your own ‘ prauctex.cfg’ ), then you
2022-08-25 17:42:37 +00:00
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
2023-07-27 19:52:58 +00:00
your document, you need to add your own ‘ \usepackage’ call to ‘ preview’
2022-08-25 17:42:37 +00:00
so that it will be able to interpret its various definition commands.
2023-07-27 19:52:58 +00:00
It is an error to add the ‘ active’ option to this invocation: you don’ t
2022-08-25 17:42:37 +00:00
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
2023-07-27 19:52:58 +00:00
facilities of ‘ preview.sty’ to tell it how to resolve this, whether you
2022-08-25 17:42:37 +00:00
want no previews, previews of whole slides or previews of inner
material.
File: preview-latex.info, Node: Troubleshooting, Next: Other formats, Prev: Customization, Up: Frequently Asked Questions
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
2023-07-27 19:52:58 +00:00
‘ .log’ file.
2022-08-25 17:42:37 +00:00
B.5.2 Why do my DVI and PDF output files vanish?
------------------------------------------------
In order to produce the preview images preview-latex runs LaTeX on the
master or region file. The resulting DVI or PDF file can happen to have
the same name as the output file of a regular LaTeX run. So the regular
output file gets overwritten and is subsequently deleted by
preview-latex.
B.5.3 My output file suddenly only contains preview images?!
------------------------------------------------------------
As mentioned in the previews FAQ entry, preview-latex might use the file
name of the original output file for the creation of preview images. If
the original output file is being displayed with a viewer when this
happens, you might see strange effects depending on the viewer, e.g. a
message about the file being corrupted or the display of all the preview
images instead of your typeset document. (Also *note Customization::.)
File: preview-latex.info, Node: Other formats, Prev: Troubleshooting, Up: Frequently Asked Questions
B.6 preview-latex when not using LaTeX
======================================
B.6.1 Does preview-latex work with PDFLaTeX?
--------------------------------------------
2023-07-27 19:52:58 +00:00
Yes, as long as you use AUCTeX’ s own PDFLaTeX mode and have not messed
with ‘ TeX-command-list’ .
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
B.6.2 Does preview-latex work with ‘ elatex’ ?
2022-08-25 17:42:37 +00:00
--------------------------------------------
2023-07-27 19:52:58 +00:00
No problem here. If you configure your AUCTeX to use ‘ elatex’ , or
simply have ‘ latex’ point to ‘ elatex’ , this will work fine. Modern TeX
2022-08-25 17:42:37 +00:00
distributions use eTeX for LaTeX, anyway.
B.6.3 Does preview-latex work with ConTeXt?
-------------------------------------------
2023-07-27 19:52:58 +00:00
In short, no. The ‘ preview’ package is LaTeX-dependent. Adding support
2022-08-25 17:42:37 +00:00
for other formats requires volunteers.
B.6.4 Does preview-latex work with plain TeX?
---------------------------------------------
2023-07-27 19:52:58 +00:00
Again, no. Restructuring the ‘ preview’ package for ‘ plain’ operation
2022-08-25 17:42:37 +00:00
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}
File: preview-latex.info, Node: Copying this Manual, Next: Index, Prev: Frequently Asked Questions, Up: Top
Appendix C Copying this Manual
******************************
The copyright notice for this manual is:
This manual is for preview-latex, a LaTeX preview mode for AUCTeX
2023-07-27 19:52:58 +00:00
(version 13.2.1 from 2023-07-20).
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2017-2019, 2021 Free
Software Foundation, Inc.
2022-08-25 17:42:37 +00:00
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts and no
Back-Cover Texts. A copy of the license is included in the section
2023-07-27 19:52:58 +00:00
entitled “GNU Free Documentation License.”
2022-08-25 17:42:37 +00:00
The full license text can be read here:
* Menu:
* GNU Free Documentation License:: License for copying this manual.
File: preview-latex.info, Node: GNU Free Documentation License, Up: Copying this Manual
C.1 GNU Free Documentation License
==================================
Version 1.3, 3 November 2008
2023-07-27 19:52:58 +00:00
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software
2022-08-25 17:42:37 +00:00
Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
2023-07-27 19:52:58 +00:00
functional and useful document “free” in the sense of freedom: to
2022-08-25 17:42:37 +00:00
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or
noncommercially. Secondarily, this License preserves for the
author and publisher a way to get credit for their work, while not
being considered responsible for modifications made by others.
2023-07-27 19:52:58 +00:00
This License is a kind of “copyleft”, which means that derivative
2022-08-25 17:42:37 +00:00
works of the document must themselves be free in the same sense.
It complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a
free program should come with manuals providing the same freedoms
that the software does. But this License is not limited to
software manuals; it can be used for any textual work, regardless
of subject matter or whether it is published as a printed book. We
recommend this License principally for works whose purpose is
instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium,
that contains a notice placed by the copyright holder saying it can
be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration,
to use that work under the conditions stated herein. The
2023-07-27 19:52:58 +00:00
“Document”, below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as “you”. You accept
2022-08-25 17:42:37 +00:00
the license if you copy, modify or distribute the work in a way
requiring permission under copyright law.
2023-07-27 19:52:58 +00:00
A “Modified Version” of the Document means any work containing the
2022-08-25 17:42:37 +00:00
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
2023-07-27 19:52:58 +00:00
A “Secondary Section” is a named appendix or a front-matter section
2022-08-25 17:42:37 +00:00
of the Document that deals exclusively with the relationship of the
2023-07-27 19:52:58 +00:00
publishers or authors of the Document to the Document’ s overall
2022-08-25 17:42:37 +00:00
subject (or to related matters) and contains nothing that could
fall directly within that overall subject. (Thus, if the Document
is in part a textbook of mathematics, a Secondary Section may not
explain any mathematics.) The relationship could be a matter of
historical connection with the subject or with related matters, or
of legal, commercial, philosophical, ethical or political position
regarding them.
2023-07-27 19:52:58 +00:00
The “Invariant Sections” are certain Secondary Sections whose
2022-08-25 17:42:37 +00:00
titles are designated, as being those of Invariant Sections, in the
notice that says that the Document is released under this License.
If a section does not fit the above definition of Secondary then it
is not allowed to be designated as Invariant. The Document may
contain zero Invariant Sections. If the Document does not identify
any Invariant Sections then there are none.
2023-07-27 19:52:58 +00:00
The “Cover Texts” are certain short passages of text that are
2022-08-25 17:42:37 +00:00
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
that says that the Document is released under this License. A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
2023-07-27 19:52:58 +00:00
A “Transparent” copy of the Document means a machine-readable copy,
2022-08-25 17:42:37 +00:00
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed
of pixels) generic paint programs or (for drawings) some widely
available drawing editor, and that is suitable for input to text
formatters or for automatic translation to a variety of formats
suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has
been arranged to thwart or discourage subsequent modification by
readers is not Transparent. An image format is not Transparent if
used for any substantial amount of text. A copy that is not
2023-07-27 19:52:58 +00:00
“Transparent” is called “Opaque”.
2022-08-25 17:42:37 +00:00
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and standard-conforming
simple HTML, PostScript or PDF designed for human modification.
Examples of transparent image formats include PNG, XCF and JPG.
Opaque formats include proprietary formats that can be read and
edited only by proprietary word processors, SGML or XML for which
the DTD and/or processing tools are not generally available, and
the machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
2023-07-27 19:52:58 +00:00
The “Title Page” means, for a printed book, the title page itself,
2022-08-25 17:42:37 +00:00
plus such following pages as are needed to hold, legibly, the
material this License requires to appear in the title page. For
2023-07-27 19:52:58 +00:00
works in formats which do not have any title page as such, “Title
Page” means the text near the most prominent appearance of the
work’ s title, preceding the beginning of the body of the text.
2022-08-25 17:42:37 +00:00
2023-07-27 19:52:58 +00:00
The “publisher” means any person or entity that distributes copies
2022-08-25 17:42:37 +00:00
of the Document to the public.
2023-07-27 19:52:58 +00:00
A section “Entitled XYZ” means a named subunit of the Document
2022-08-25 17:42:37 +00:00
whose title either is precisely XYZ or contains XYZ in parentheses
following text that translates XYZ in another language. (Here XYZ
stands for a specific section name mentioned below, such as
2023-07-27 19:52:58 +00:00
“Acknowledgements”, “Dedications”, “Endorsements”, or “History”.)
To “Preserve the Title” of such a section when you modify the
Document means that it remains a section “Entitled XYZ” according
2022-08-25 17:42:37 +00:00
to this definition.
The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document. These
Warranty Disclaimers are considered to be included by reference in
this License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and
has no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License
applies to the Document are reproduced in all copies, and that you
add no other conditions whatsoever to those of this License. You
may not use technical measures to obstruct or control the reading
or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you
distribute a large enough number of copies you must also follow the
conditions in section 3.
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly
have printed covers) of the Document, numbering more than 100, and
2023-07-27 19:52:58 +00:00
the Document’ s license notice requires Cover Texts, you must
2022-08-25 17:42:37 +00:00
enclose the copies in covers that carry, clearly and legibly, all
these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the
covers in addition. Copying with changes limited to the covers, as
long as they preserve the title of the Document and satisfy these
conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto
adjacent pages.
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with
each Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free
of added material. If you use the latter option, you must take
reasonably prudent steps, when you begin distribution of Opaque
copies in quantity, to ensure that this Transparent copy will
remain thus accessible at the stated location until at least one
year after the last time you distribute an Opaque copy (directly or
through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies,
to give them a chance to provide you with an updated version of the
Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it. In addition, you must do these things in
the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title
distinct from that of the Document, and from those of previous
versions (which should, if there were any, be listed in the
History section of the Document). You may use the same title
as a previous version if the original publisher of that
version gives permission.
B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the
principal authors of the Document (all of its principal
authors, if it has fewer than five), unless they release you
from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license
notice giving the public permission to use the Modified
Version under the terms of this License, in the form shown in
the Addendum below.
G. Preserve in that license notice the full lists of Invariant
2023-07-27 19:52:58 +00:00
Sections and required Cover Texts given in the Document’ s
2022-08-25 17:42:37 +00:00
license notice.
H. Include an unaltered copy of this License.
2023-07-27 19:52:58 +00:00
I. Preserve the section Entitled “History”, Preserve its Title,
2022-08-25 17:42:37 +00:00
and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the
2023-07-27 19:52:58 +00:00
Title Page. If there is no section Entitled “History” in the
2022-08-25 17:42:37 +00:00
Document, create one stating the title, year, authors, and
publisher of the Document as given on its Title Page, then add
an item describing the Modified Version as stated in the
previous sentence.
J. Preserve the network location, if any, given in the Document
for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for
previous versions it was based on. These may be placed in the
2023-07-27 19:52:58 +00:00
“History” section. You may omit a network location for a work
2022-08-25 17:42:37 +00:00
that was published at least four years before the Document
itself, or if the original publisher of the version it refers
to gives permission.
2023-07-27 19:52:58 +00:00
K. For any section Entitled “Acknowledgements” or “Dedications”,
2022-08-25 17:42:37 +00:00
Preserve the Title of the section, and preserve in the section
all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered
in their text and in their titles. Section numbers or the
equivalent are not considered part of the section titles.
2023-07-27 19:52:58 +00:00
M. Delete any section Entitled “Endorsements”. Such a section
2022-08-25 17:42:37 +00:00
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled
2023-07-27 19:52:58 +00:00
“Endorsements” or to conflict in title with any Invariant
2022-08-25 17:42:37 +00:00
Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
material copied from the Document, you may at your option designate
some or all of these sections as invariant. To do this, add their
2023-07-27 19:52:58 +00:00
titles to the list of Invariant Sections in the Modified Version’ s
2022-08-25 17:42:37 +00:00
license notice. These titles must be distinct from any other
section titles.
2023-07-27 19:52:58 +00:00
You may add a section Entitled “Endorsements”, provided it contains
2022-08-25 17:42:37 +00:00
nothing but endorsements of your Modified Version by various
2023-07-27 19:52:58 +00:00
parties—for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of
a standard.
2022-08-25 17:42:37 +00:00
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end of
the list of Cover Texts in the Modified Version. Only one passage
of Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document
already includes a cover text for the same cover, previously added
by you or by arrangement made by the same entity you are acting on
behalf of, you may not add another; but you may replace the old
one, on explicit permission from the previous publisher that added
the old one.
The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
this License, under the terms defined in section 4 above for
modified versions, provided that you include in the combination all
of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all
their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name
but different contents, make the title of each such section unique
by adding at the end of it, in parentheses, the name of the
original author or publisher of that section if known, or else a
unique number. Make the same adjustment to the section titles in
the list of Invariant Sections in the license notice of the
combined work.
In the combination, you must combine any sections Entitled
2023-07-27 19:52:58 +00:00
“History” in the various original documents, forming one section
Entitled “History”; likewise combine any sections Entitled
“Acknowledgements”, and any sections Entitled “Dedications”. You
must delete all sections Entitled “Endorsements.”
2022-08-25 17:42:37 +00:00
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
rules of this License for verbatim copying of each of the documents
in all other respects.
You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert
a copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of a
2023-07-27 19:52:58 +00:00
storage or distribution medium, is called an “aggregate” if the
2022-08-25 17:42:37 +00:00
copyright resulting from the compilation is not used to limit the
2023-07-27 19:52:58 +00:00
legal rights of the compilation’ s users beyond what the individual
2022-08-25 17:42:37 +00:00
works permit. When the Document is included in an aggregate, this
License does not apply to the other works in the aggregate which
are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half
2023-07-27 19:52:58 +00:00
of the entire aggregate, the Document’ s Cover Texts may be placed
2022-08-25 17:42:37 +00:00
on covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic
form. Otherwise they must appear on printed covers that bracket
the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section
4. Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also
include the original English version of this License and the
original versions of those notices and disclaimers. In case of a
disagreement between the translation and the original version of
this License or a notice or disclaimer, the original version will
prevail.
2023-07-27 19:52:58 +00:00
If a section in the Document is Entitled “Acknowledgements”,
“Dedications”, or “History”, the requirement (section 4) to
2022-08-25 17:42:37 +00:00
Preserve its Title (section 1) will typically require changing the
actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void,
and will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from
that copyright holder, and you cure the violation prior to 30 days
after your receipt of the notice.
Termination of your rights under this section does not terminate
the licenses of parties who have received copies or rights from you
under this License. If your rights have been terminated and not
permanently reinstated, receipt of a copy of some or all of the
same material does not give you any rights to use it.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
<https://www.gnu.org/licenses/>.
Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered
2023-07-27 19:52:58 +00:00
version of this License “or any later version” applies to it, you
2022-08-25 17:42:37 +00:00
have the option of following the terms and conditions either of
that specified version or of any later version that has been
published (not as a draft) by the Free Software Foundation. If the
Document does not specify a version number of this License, you may
choose any version ever published (not as a draft) by the Free
Software Foundation. If the Document specifies that a proxy can
decide which future versions of this License can be used, that
2023-07-27 19:52:58 +00:00
proxy’ s public statement of acceptance of a version permanently
2022-08-25 17:42:37 +00:00
authorizes you to choose that version for the Document.
11. RELICENSING
2023-07-27 19:52:58 +00:00
“Massive Multiauthor Collaboration Site” (or “MMC Site”) means any
2022-08-25 17:42:37 +00:00
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server.
2023-07-27 19:52:58 +00:00
A “Massive Multiauthor Collaboration” (or “MMC”) contained in the
2022-08-25 17:42:37 +00:00
site means any set of copyrightable works thus published on the MMC
site.
2023-07-27 19:52:58 +00:00
“CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0
2022-08-25 17:42:37 +00:00
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
2023-07-27 19:52:58 +00:00
“Incorporate” means to publish or republish a Document, in whole or
2022-08-25 17:42:37 +00:00
in part, as part of another Document.
2023-07-27 19:52:58 +00:00
An MMC is “eligible for relicensing” if it is licensed under this
2022-08-25 17:42:37 +00:00
License, and if all works that were first published under this
License somewhere other than this MMC, and subsequently
incorporated in whole or in part into the MMC, (1) had no cover
texts or invariant sections, and (2) were thus incorporated prior
to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the
site under CC-BY-SA on the same site at any time before August 1,
2009, provided the MMC is eligible for relicensing.
ADDENDUM: How to use this License for your documents
====================================================
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:
Copyright (C) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover
2023-07-27 19:52:58 +00:00
Texts, replace the “with...Texts.” line with this:
2022-08-25 17:42:37 +00:00
with the Invariant Sections being LIST THEIR TITLES, with
the Front-Cover Texts being LIST, and with the Back-Cover Texts
being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.
File: preview-latex.info, Node: Index, Prev: Copying this Manual, Up: Top
Index
*****