]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex/doc/preview-readme.texi
4f67e0410769942138ce58e23dacb9b0a7354900
[gnu-emacs-elpa] / packages / auctex / doc / preview-readme.texi
1 @include macros.texi
2 @ifset rawfile
3 @node Introduction, What use is it?, (dir), (dir)
4 @top @previewlatex{} in a nutshell
5 @paragraphindent none
6 @end ifset
7 @c -----------------------
8 @cindex Readme
9 Does your neck hurt from turning between previewer windows and the
10 source too often? This @AUCTeX{} component will render your displayed
11 @LaTeX{} equations right into the editing window where they belong.
12
13 The purpose of @previewlatex{} is to embed @LaTeX{} environments such as
14 display math or figures into the source buffers and switch conveniently
15 between source and image representation.
16
17 @menu
18 * What use is it?::
19 * Activating preview-latex::
20 * Getting started::
21 * Basic modes of operation::
22 * More documentation::
23 * Availability::
24 * Contacts::
25 @end menu
26
27 @ifset rawfile
28 @node What use is it?, Activating preview-latex, Introduction, Introduction
29 @chapter What use is it?
30 @raisesections
31 @end ifset
32 @ifclear rawfile
33 @node What use is it?, Activating preview-latex, Introduction, Introduction
34 @section What use is it?
35 @end ifclear
36 @cindex Philosophy of @previewlatex{}
37 @acronym{WYSIWYG} (what you see is what you get) sometimes is considered
38 all the rage, sometimes frowned upon. Do we really want it? Wrong
39 question. The right question is @emph{what} we want from it. Except
40 when finetuning the layout, we don't want to use printer fonts for
41 on-screen text editing. The low resolution and contrast of a computer
42 screen render all but the coarsest printer fonts (those for low-quality
43 newsprint) unappealing, and the margins and pagination of the print are
44 not wanted on the screen, either. On the other hand, more complex
45 visual compositions like math formulas and tables can't easily be taken
46 in when seen only in the source. @previewlatex{} strikes a balance: it
47 only uses graphic renditions of the output for certain, configurable
48 constructs, does this only when told, and then right in the source code.
49 Switching back and forth between the source and preview is easy and
50 natural and can be done for each image independently. Behind the scenes
51 of @previewlatex{}, a sophisticated framework of other programs like
52 @samp{dvipng}, Dvips and Ghostscript are employed together with a
53 special @LaTeX{} style file for extracting the material of interest in
54 the background and providing fast interactive response.
55
56 @node Activating preview-latex, Getting started, What use is it?, Introduction
57 @section Activating @previewlatex{}
58 @cindex Activation
59 After installation, the package may need to be activated (and remember
60 to activate @AUCTeX{} too). In XEmacs, and in any prepackaged versions
61 worth their salt, activation should be automatic upon installation. If
62 this seems not the case, complain to your installation provider.
63
64 The usual activation (if it is not done automatically) would be
65
66 @example
67 (load "preview-latex.el" nil t t)
68 @end example
69
70 If you still don't get a ``Preview'' menu in @LaTeX{} mode in spite
71 of @AUCTeX{} showing its ``Command'', your installation is broken. One
72 possible cause are duplicate Lisp files that might be detectable with
73 @kbd{@key{M-x} list-load-path-shadows @key{RET}}.
74
75 @node Getting started, Basic modes of operation, Activating preview-latex, Introduction
76 @section Getting started
77
78 Once activated, @previewlatex{} and its documentation will be accessible
79 via its menus (note that @previewlatex{} requires @AUCTeX{} to be
80 loaded). When you have loaded a @LaTeX{} document (a
81 sample document @file{circ.tex} is included in the distribution, but
82 most documents including math and/or figures should do), you can use
83 its menu or @kbd{C-c C-p C-d} (for @samp{Preview/Document}).
84 Previews will now be generated for various objects in your document.
85 You can use the time to take a short look at the other menu entries and
86 key bindings in the @samp{Preview} menu. You'll see the previewed
87 objects change into a roadworks sign when @previewlatex{} has determined
88 just what it is going to preview. Note that you can freely navigate the
89 buffer while this is going on. When the process is finished you will
90 see the objects typeset in your buffer.
91
92 It is a bad idea, however, to edit the buffer before the roadworks signs
93 appear, since that is the moment when the correlation between the
94 original text and the buffer locations gets established. If the buffer
95 changes before that point of time, the previews will not be placed where
96 they belong. If you do want to change some obvious error you just
97 spotted, we recommend you stop the background process by pressing
98 @kbd{C-c C-k}.
99
100 To see/edit the @LaTeX{} code for a specific object, put the point (the
101 cursor) on it and press @kbd{C-c C-p C-p} (for @samp{Preview/at point}).
102 It will also do to click with the middle mouse button on the preview.
103 Now you can edit the code, and generate a new preview by again pressing
104 @kbd{C-c C-p C-p} (or by clicking with the middle mouse button on the
105 icon before the edited text).
106
107 If you are using the @code{desktop} package, previews will remain from
108 one session to the next as long as you don't kill your buffer. If you
109 are using XEmacs, you will probably need to upgrade the package to
110 the newest one; things are being fixed just as I am writing this.
111
112 @node Basic modes of operation, More documentation, Getting started, Introduction
113 @section Basic modes of operation
114
115 @previewlatex{} has a number of methods for generating its graphics.
116 Its default operation is equivalent to using the `@LaTeX{}' command from
117 @AUCTeX{}. If this happens to be a call of PDF@LaTeX{} generating
118 @acronym{PDF} output (you need at least @w{@AUCTeX{} 11.51} for this),
119 then Ghostscript will be called directly on the resulting @acronym{PDF}
120 file. If a @acronym{DVI} file gets produced, first Dvips and then
121 Ghostscript get called by default.
122
123 The image type to be generated by Ghostscript can be configured with
124
125 @example
126 @kbd{M-x} customize-variable @kbd{RET} preview-image-type @kbd{RET}
127 @end example
128 @vindex preview-image-type
129
130 @noindent
131 The default is @samp{png} (the most efficient image type). A special
132 setting is @samp{dvipng} in case you have the @samp{dvipng}
133 @cindex Using dvipng
134 @pindex dvipng
135 program installed. In this case, @samp{dvipng} will be used for
136 converting @acronym{DVI} files and Ghostscript (with a @samp{PNG}
137 device) for converting @acronym{PDF} files. @samp{dvipng} is much
138 faster than the combination of Dvips and Ghostscript. You can get
139 downloads, access to its @acronym{CVS} archive and further information
140 from its @uref{http://savannah.nongnu.org/projects/dvipng, project
141 site}.
142
143 @node More documentation, Availability, Basic modes of operation, Introduction
144 @section More documentation
145 After the installation, documentation in the form of
146 @ifinfo
147 @ifclear rawfile
148 this
149 @end ifclear
150 @ifset rawfile
151 an
152 @end ifset
153 @end ifinfo
154 @ifnotinfo
155 an
156 @end ifnotinfo
157 info manual will be available. You can access it with the standalone
158 info reader with
159
160 @example
161 info preview-latex
162 @end example
163
164 @noindent
165 or by pressing @kbd{C-h i d m preview-latex @key{RET}} in Emacs. Once
166 @previewlatex{} is activated, you can instead use @kbd{C-c C-p
167 @key{TAB}} (or the menu entry @samp{Preview/Read documentation}).
168
169 Depending on your installation,
170 @ifnottex
171 a printable
172 @end ifnottex
173 @iftex
174 this printed
175 @end iftex
176 manual may also be available in the form of @file{preview-latex.dvi} or
177 @file{preview-latex.ps}.
178
179 Detailed documentation for the @LaTeX{} style used for extracting the
180 preview images is placed in @file{preview.dvi} in a suitable directory
181 during installation; on typical teTeX-based systems,
182
183 @example
184 texdoc preview
185 @end example
186
187 @noindent
188 will display it.
189
190 @node Availability, Contacts, More documentation, Introduction
191 @section Availability
192 @cindex Download
193 @cindex @sc{cvs} access
194
195 The @previewlatex{} project is now part of @AUCTeX{} and accessible as
196 part of the @uref{http://savannah.gnu.org/projects/auctex,@AUCTeX{}
197 project page}. You can get its files from the
198 @uref{ftp://ftp.gnu.org/pub/gnu/auctex,@AUCTeX{} download area}. As of
199 @w{@AUCTeX{} 11.81}, @previewlatex{} should already be integrated into
200 @AUCTeX{}, so no separate download will be necessary.
201
202 You will also find @file{.rpm} files there for Fedora and possibly
203 SuSE. Anonymous @acronym{CVS} is available as well.
204
205 @node Contacts, , Availability, Introduction
206 @section Contacts
207 @cindex Contacts
208 @cindex Mailing list
209
210 Bug reports should be sent by using @kbd{M-x preview-report-bug
211 @key{RET}}, as this will fill in a lot of information interesting to
212 us. If the installation fails (but this should be a rare event), report
213 bugs to @email{bug-auctex@@gnu.org}.
214
215 There is a general discussion list for @AUCTeX{} which also
216 covers @previewlatex{}, look at
217 @uref{http://lists.gnu.org/mailman/listinfo/auctex}. For more
218 information on the mailing list, send a message with just the word
219 ``help'' as subject or body to @email{auctex-request@@gnu.org}. For the
220 developers, there is the @email{auctex-devel@@gnu.org} list; it would
221 probably make sense to direct feature requests and questions about
222 internal details there. There is a low-volume read-only announcement
223 list available to which you can subscribe by sending a mail with
224 ``subscribe'' in the subject to @email{info-auctex-request@@gnu.org}.
225
226 Offers to support further development will be appreciated. If you want
227 to show your appreciation with a donation to the main developer, you can
228 do so via PayPal to @email{dak@@gnu.org}, and of course you can arrange
229 for service contracts or for added functionality. Take a look at the
230 @file{TODO} list for suggestions in that area.