]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex/doc/install.texi
f13798bbfd4ceb62eba47ea1a328a29f8f336cf9
[gnu-emacs-elpa] / packages / auctex / doc / install.texi
1 @c This is part of the AUCTeX Manual.
2 @c Copyright (C) 1994, 1996, 2003, 2004, 2005, 2006, 2007
3 @c Free Software Foundation, Inc.
4 @c See the file auctex.texi for copying conditions.
5 @ifset rawfile
6 @include macros.texi
7 @node Installation,,(dir),(dir)
8 @top Installing @AUCTeX{}
9 @end ifset
10
11 @ifclear rawfile
12 @node Installation
13 @chapter Installing @AUCTeX{}
14 @end ifclear
15
16 Installing @AUCTeX{} should be simple: merely @command{./configure},
17 @command{make}, and @code{make install} for a standard site-wide
18 installation (most other installations can be done by specifying a
19 @option{--prefix=@dots{}} option).
20
21 On many systems, this will already activate the package, making its
22 modes the default instead of the built-in modes of Emacs. If this is
23 not the case, consult @ref{Loading the package}. Please read through
24 this document fully before installing anything. The installation
25 procedure has changed as compared to earlier versions. Users of @w{MS
26 Windows} are asked to consult
27 @ifset rawfile
28 the file @file{INSTALL.windows}.
29 @end ifset
30 @ifclear rawfile
31 @xref{Installation under MS Windows}.
32 @end ifclear
33
34 @ifclear rawfile
35 @menu
36 * Prerequisites::
37 * Configure::
38 * Build/install::
39 * Loading the package::
40 * Advice for package providers::
41 * Advice for non-privileged users::
42 * Installation under MS Windows::
43 * Customizing::
44 @end menu
45 @end ifclear
46
47 @ifset rawfile
48 @menu
49 * Prerequisites::
50 * Configure::
51 * Build/install::
52 * Loading the package::
53 * Advice for package providers::
54 * Advice for non-privileged users::
55 * Customizing::
56 @end menu
57 @end ifset
58
59 @ifset rawfile
60 @node Prerequisites
61 @chapter Prerequisites
62 @raisesections
63 @end ifset
64
65 @ifclear rawfile
66 @node Prerequisites
67 @section Prerequisites
68 @end ifclear
69
70 @itemize @bullet
71 @item A recent version of Emacs, alternatively XEmacs
72
73 @w{Emacs 20} is no longer supported, and neither is XEmacs with a
74 version of @code{xemacs-base} older than 1.84 (released in sumo from
75 02/02/2004). Using @previewlatex{} requires a version of Emacs compiled
76 with image support. While the X11 version of @w{Emacs 21} will likely
77 work, @w{Emacs 22} and later is the preferred platform.
78
79 @table @b
80 @item Windows
81 Precompiled versions are available from
82 @uref{ftp://ftp.gnu.org/gnu/emacs/windows/}.
83 @item Mac OS X
84 For an overview of precompiled versions of Emacs for Mac OS X see for
85 example @uref{http://www.emacswiki.org/cgi-bin/wiki/EmacsForMacOS}.
86 @item GNU/Linux
87 Most GNU/Linux distributions nowadays provide a variant of Emacs 22 or
88 later via their package repositories.
89 @item Self-compiled
90 Compiling Emacs yourself requires a C compiler and a number of tools and
91 development libraries. Details are beyond the scope of this manual.
92 Instructions for checking out the source code can be found at
93 @uref{https://savannah.gnu.org/bzr/?group=emacs}.
94 @end table
95
96 If you really need to use @w{Emacs 21} on platforms where this implies
97 missing image support, you should disable the installation of
98 @previewlatex{} (see below).
99
100 While XEmacs (version 21.4.15, 21.4.17 or later) is supported, doing
101 this in a satisfactory manner has proven to be difficult. This is
102 mostly due to technical shortcomings and differing API's which are hard
103 to come by. If @AUCTeX{} is your main application for XEmacs, you are
104 likely to get better results and support by switching to Emacs. Of
105 course, you can improve support for your favorite editor by giving
106 feedback in case you encounter bugs.
107
108 @item A working @TeX{} installation
109
110 Well, @AUCTeX{} would be pointless without that. Processing
111 documentation requires @TeX{}, @LaTeX{} and Texinfo during installation.
112 @previewlatex{} requires Dvips for its operation in @acronym{DVI} mode.
113 The default configuration of @AUCTeX{} is tailored for te@TeX{} or
114 @TeX{}live-based distributions, but can be adapted easily.
115
116 @item A recent Ghostscript
117
118 This is needed for operation of @previewlatex{} in both @acronym{DVI}
119 and @acronym{PDF} mode. Most versions of Ghostscript nowadays in use
120 should work fine (version 7.0 and newer). If you encounter problems,
121 check
122 @ifset rawfile
123 the @file{PROBLEMS} file.
124 @end ifset
125 @ifclear rawfile
126 @ref{Problems with Ghostscript,,,preview-latex,the @previewlatex{} manual}.
127 @end ifclear
128
129 @item The @code{texinfo} package
130
131 Strictly speaking, you can get away without it if you are building
132 from the distribution tarball, have not modified any files and don't
133 need a printed version of the manual: the pregenerated info file is
134 included in the tarball. At least @w{version 4.0} is required.
135
136 @end itemize
137
138 For some known issues with various software, see
139 @ifset rawfile
140 the @file{PROBLEMS} file.
141 @end ifset
142 @ifclear rawfile
143 @ref{Known problems,,,preview-latex,the @previewlatex{} manual}.
144 @end ifclear
145
146 @node Configure
147 @section Configure
148
149 The first step is to configure the source code, telling it where
150 various files will be. To do so, run
151
152 @example
153 ./configure @var{options}
154 @end example
155
156 (Note: if you have fetched @AUCTeX{} from @acronym{CVS} rather than
157 a regular release, you will have to first follow the instructions in
158 @file{README.CVS}).
159
160 On many machines, you will not need to specify any options, but if
161 @command{configure} cannot determine something on its own, you'll need to
162 help it out with one of these options:
163
164 @table @code
165 @item --prefix=@file{/usr/local}
166 All automatic placements for package components will be chosen from
167 sensible existing hierarchies below this: directories like @file{man},
168 @file{share} and @file{bin} are supposed to be directly below
169 @var{prefix}.
170
171 Only if no workable placement can be found there, in some cases an
172 alternative search will be made in a prefix deduced from a suitable
173 binary.
174
175 @file{/usr/local} is the default @var{prefix}, intended to be suitable
176 for a site-wide installation. If you are packaging this as an
177 operating system component for distribution, the setting @file{/usr}
178 will probably be the right choice. If you are planning to install the
179 package as a single non-priviledged user, you will typically set
180 @var{prefix} to your home directory.
181
182 @item --with-emacs[=@var{/path/to/emacs}]
183 If you are using a pretest which isn't in your @code{$PATH}, or
184 @command{configure} is not finding the right Emacs executable, you can
185 specify it with this option.
186
187 @item --with-xemacs[=@var{/path/to/xemacs}]
188 Configure for generation under XEmacs (Emacs is the default). Again,
189 the name of the right XEmacs executable can be specified, complete with
190 path if necessary.
191
192 @item --with-packagedir=@var{/dir}
193 This XEmacs-only option configures the directory for XEmacs packages. A
194 typical user-local setting would be @file{~/.xemacs/xemacs-packages}.
195 If this directory exists and is below @var{prefix}, it should be
196 detected automatically. This will install and activate the package.
197
198 @item --without-packagedir
199 This XEmacs-only option switches the detection of a package directory
200 and corresponding installation off. Consequently, the Emacs
201 installation scheme will be used. This might be appropriate if you are
202 using a different package system/installer than the XEmacs one and want
203 to avoid conflicts.
204
205 The Emacs installation scheme has the following options:
206
207 @item --with-lispdir=@var{/dir}
208 This Emacs-only option specifies the location of the @file{site-lisp}
209 directory within @samp{load-path} under which the files will get
210 installed (the bulk will get installed in a subdirectory).
211 @file{./configure} should figure this out by itself.
212
213 @item --with-auctexstartfile=@file{auctex.el}
214 @itemx --with-previewstartfile=@file{preview-latex.el}
215 This is the name of the respective startup files. If @var{lispdir}
216 contains a subdirectory @file{site-start.d}, the start files are
217 placed there, and @file{site-start.el} should
218 load them automatically. Please be aware that you must not move the
219 start files after installation since other files are found
220 @emph{relative} to them.
221
222 @item --with-packagelispdir=@file{auctex}
223 This is the directory where the bulk of the package gets located. The
224 startfile adds this into @var{load-path}.
225
226 @item --with-auto-dir=@var{/dir}
227 You can use this option to specify the directory containing
228 automatically generated information. It is not necessary for most
229 @TeX{} installs, but may be used if you don't like the directory that
230 configure is suggesting.
231
232 @item --help
233 This is not an option specific to @AUCTeX{}. A number of standard
234 options to @command{configure} exist, and we do not have the room to
235 describe them here; a short description of each is available, using
236 @code{--help}. If you use @samp{--help=recursive}, then also
237 @previewlatex{}-specific options will get listed.
238
239 @item --disable-preview
240 This disables configuration and installation of @previewlatex{}. This
241 option is not actually recommended. If your Emacs does not support
242 images, you should really upgrade to a newer version. Distributors
243 should, if possible, refrain from distributing @AUCTeX{} and
244 @previewlatex{} separately in order to avoid confusion and upgrade
245 hassles if users install partial packages on their own.
246
247 @item --with-texmf-dir=@var{/dir}@*--without-texmf-dir
248 @cindex preview-install-styles
249 This option is used for specifying a @acronym{TDS}-compliant directory
250 hierarchy. Using @code{--with-texmf-dir=@var{/dir}} you can specify
251 where the @TeX{} @acronym{TDS} directory hierarchy resides, and the
252 @TeX{} files will get installed in
253 @file{@var{/dir}/tex/latex/preview/}.
254
255 If you use the @code{--without-texmf-dir} option, the @TeX{}-related
256 files will be kept in the Emacs Lisp tree, and at runtime the
257 @env{TEXINPUTS} environment variable will be made to point there. You
258 can install those files into your own @TeX{} tree at some later time
259 with @kbd{M-x preview-install-styles RET}.
260
261 @item --with-tex-dir=@var{/dir}
262 If you want to specify an exact directory for the preview @TeX{} files,
263 use @code{--with-tex-dir=@var{/dir}}. In this case, the files will be
264 placed in @file{@var{/dir}}, and you'll also need the following option:
265
266 @item --with-doc-dir=@var{/dir}
267 This option may be used to specify where the @TeX{} documentation goes.
268 It is to be used when you are using @code{--with-tex-dir=@var{/dir}},
269 but is normally not necessary otherwise.
270 @end table
271
272 @node Build/install
273 @section Build/install
274
275 @cindex Installation
276 @cindex Make
277
278 Once @command{configure} has been run, simply enter
279
280 @example
281 make
282 @end example
283
284 @noindent
285 at the prompt to byte-compile the lisp files, extract the @TeX{} files
286 and build the documentation files. To install the files into the
287 locations chosen earlier, type
288
289 @example
290 make install
291 @end example
292
293 You may need special privileges to install, e.g., if you are installing
294 into system directories.
295
296 @node Loading the package
297 @section Loading the package
298 @cindex @file{.emacs}
299
300 You can detect the successful activation of @AUCTeX{} and
301 @previewlatex{} in the menus after loading a @LaTeX{} file like
302 @file{preview/circ.tex}: @AUCTeX{} then gives you a @samp{Command} menu,
303 and @previewlatex{} gives you a @samp{Preview} menu.
304
305 For XEmacs, if the installation occured into a valid package directory
306 (which is the default), then this should work out of the box.
307
308 @cindex @file{auctex.el}
309 @cindex @file{tex-site.el}
310 With Emacs (or if you explicitly disabled use of the package system),
311 the startup files @file{auctex.el} and @file{preview-latex.el} may
312 already be in a directory of the @file{site-start.d/} variety if your
313 Emacs installation provides it. In that case they should be
314 automatically loaded on startup and nothing else needs to be done. If
315 not, they should at least have been placed somewhere in your
316 @code{load-path}. You can then load them by placing the lines
317
318 @example
319 (load "auctex.el" nil t t)
320 (load "preview-latex.el" nil t t)
321 @end example
322
323 into your init file.
324
325 If you explicitly used @code{--with-lispdir}, you may need to add the
326 specified directory into Emacs' @code{load-path} variable by adding
327 something like
328
329 @example
330 (add-to-list 'load-path "~/elisp")
331 @end example
332
333 before the above lines into your Emacs startup file.
334
335 For site-wide activation in GNU Emacs, see
336 @ifset rawfile
337 below.
338 @end ifset
339 @ifclear rawfile
340 @xref{Advice for package providers}.
341 @end ifclear
342
343 Once activated, the modes provided by @AUCTeX{} are used per default for
344 all supported file types. If you want to change the modes for which it
345 is operative instead of the default, use
346 @example
347 @kbd{M-x customize-variable @key{RET} TeX-modes @key{RET}}
348 @end example
349
350 If you want to remove a preinstalled @AUCTeX{} completely before any of
351 its modes have been used,
352 @example
353 (unload-feature 'tex-site)
354 @end example
355 should accomplish that.
356
357 @node Advice for package providers
358 @section Providing @AUCTeX{} as a package
359
360 As a package provider, you should make sure that your users will be
361 served best according to their intentions, and keep in mind that a
362 system might be used by more than one user, with different
363 preferences.
364
365 There are people that prefer the built-in Emacs modes for editing
366 @TeX{} files, in particular plain @TeX{} users. There are various
367 ways to tell @AUCTeX{} even after auto-activation that it should
368 not get used, and they are described in
369 @ifset rawfile
370 the @file{README} file.
371 @end ifset
372 @ifclear rawfile
373 @ref{Introduction,,Introduction to @AUCTeX{}}.
374 @end ifclear
375
376 So if you have users that don't want to use the preinstalled @AUCTeX{},
377 they can easily get rid of it. Activating @AUCTeX{} by default is
378 therefore a good choice.
379
380 If the installation procedure did not achieve this already by placing
381 @file{auctex.el} and @file{preview-latex.el} into a possibly existing
382 @file{site-start.d} directory, you can do this by placing
383
384 @example
385 (load "auctex.el" nil t t)
386 (load "preview-latex.el" nil t t)
387 @end example
388
389 @noindent in the system-wide @file{site-start.el}.
390
391 If your package is intended as an XEmacs package or to accompany a
392 precompiled version of Emacs, you might not know which @TeX{} system
393 will be available when @previewlatex{} gets used. In this case you
394 should build using the @code{--without-texmf-dir} option described
395 previously. This can also be convenient for systems that are intended
396 to support more than a single TeX distribution. Since more often than
397 not @TeX{} packages for operating system distributions are either much
398 more outdated or much less complete than separately provided systems
399 like @w{@TeX{} Live}, this method may be generally preferable when
400 providing packages.
401
402 The following package structure would be adequate for a typical fully
403 supported Unix-like installation:
404
405 @table @samp
406 @item preview-tetex
407 Style files and documentation for @file{preview.sty}, placed into a
408 @TeX{} tree where it is accessible from the te@TeX{} executables usually
409 delivered with a system. If there are other commonly used @TeX{} system
410 packages, it might be appropriate to provide separate packages for
411 those.
412 @item auctex-emacs-tetex
413 This package will require the installation of @samp{preview-tetex} and
414 will record in @samp{TeX-macro-global} where to find the @TeX{} tree.
415 It is also a good idea to run
416 @example
417 emacs -batch -f TeX-auto-generate-global
418 @end example
419 when either @AUCTeX{} or te@TeX{} get installed or upgraded. If your
420 users might want to work with a different @TeX{} distribution (nowadays
421 pretty common), instead consider the following:
422 @item auctex-emacs
423 This package will be compiled with @samp{--without-texmf-dir} and will
424 consequently contain the @samp{preview} style files in its private
425 directory. It will probably not be possible to initialize
426 @samp{TeX-macro-global} to a sensible value, so running
427 @samp{TeX-auto-generate-global} does not appear useful. This package
428 would neither conflict with nor provide @samp{preview-tetex}.
429 @item auctex-xemacs-tetex
430 @itemx auctex-xemacs
431 Those are the obvious XEmacs equivalents. For XEmacs, there is the
432 additional problem that the XEmacs sumo package tree already possibly
433 provides its own version of @AUCTeX{}, and the user might even have used
434 the XEmacs package manager to updating this package, or even installing
435 a private @AUCTeX{} version. So you should make sure that such a
436 package will not conflict with existing XEmacs packages and will be
437 at an appropriate place in the load order (after site-wide and
438 user-specific locations, but before a distribution-specific sumo package
439 tree). Using the @code{--without-packagedir} option might be one idea
440 to avoid conflicts. Another might be to refrain from providing an
441 XEmacs package and just rely on the user or system administrator to
442 instead use the XEmacs package system.
443 @end table
444
445 @node Advice for non-privileged users
446 @section Installation for non-privileged users
447
448 Often people without system administration privileges want to install
449 software for their private use. In that case you need to pass more
450 options to the @command{configure} script. For XEmacs users, this is
451 fairly easy, because the XEmacs package system has been designed to make
452 this sort of thing practical: but GNU Emacs users (and XEmacs users for
453 whom the package system is for some reason misbehaving) may need to do a
454 little more work.
455
456 The main expedient is using the @option{--prefix} option to the
457 @file{configure} script, and let it point to the personal home
458 directory. In that way, resulting binaries will be installed under the
459 @file{bin} subdirectory of your home directory, manual pages under
460 @file{man} and so on. It is reasonably easy to maintain a bunch of
461 personal software, since the prefix argument is supported by most
462 @file{configure} scripts.
463
464 You'll have to add something like
465 @file{/home/myself/share/emacs/site-lisp} to your @code{load-path}
466 variable, if it isn't there already.
467
468 XEmacs users can achieve the same end by pointing @command{configure} at an
469 appropriate package directory (normally
470 @option{--with-packagedir=~/.xemacs/xemacs-packages} will serve). The
471 package directory stands a good chance at being detected automatically
472 as long as it is in a subtree of the specified @var{prefix}.
473
474 Now here is another thing to ponder: perhaps you want to make it easy
475 for other users to share parts of your personal Emacs configuration. In
476 general, you can do this by writing @samp{~myself/} anywhere where you
477 specify paths to something installed in your personal subdirectories,
478 not merely @samp{~/}, since the latter, when used by other users, will
479 point to non-existent files.
480
481 For yourself, it will do to manipulate environment variables in your
482 @file{.profile} resp.@: @file{.login} files. But if people will be
483 copying just Elisp files, their copies will not work. While it would
484 in general be preferable if the added components where available from
485 a shell level, too (like when you call the standalone info reader, or
486 try using @file{preview.sty} for functionality besides of Emacs
487 previews), it will be a big help already if things work from inside
488 of Emacs.
489
490 Here is how to do the various parts:
491
492 @subheading Making the Elisp available
493
494 In GNU Emacs, it should be sufficient if people just do
495
496 @lisp
497 (load "~myself/share/emacs/site-lisp/auctex.el" nil t t)
498 (load "~myself/share/emacs/site-lisp/preview-latex.el" nil t t)
499 @end lisp
500
501 where the path points to your personal installation. The rest of the
502 package should be found relative from there without further ado.
503
504 In XEmacs, you should ask the other users to add symbolic links in the
505 subdirectories @file{lisp}, @file{info} and @file{etc} of their
506 @file{~/.xemacs/xemacs-packages/} directory. (Alas, there is presently
507 no easy programmatic way to do this, except to have a script do the
508 symlinking for them.)
509
510 @subheading Making the Info files available
511
512 For making the info files accessible from within Elisp, something like
513 the following might be convenient to add into your or other people's
514 startup files:
515
516 @lisp
517 (eval-after-load 'info
518 '(add-to-list 'Info-directory-list "~myself/info"))
519 @end lisp
520
521 In XEmacs, as long as XEmacs can see the package, there should be no
522 need to do anything at all; the info files should be immediately
523 visible. However, you might want to set @env{INFOPATH} anyway, for the
524 sake of standalone readers outside of XEmacs. (The info files in XEmacs
525 are normally in @file{~/.xemacs/xemacs-packages/info}.)
526
527 @subheading Making the @LaTeX{} style available
528
529 If you want others to be able to share your installation, you should
530 configure it using @samp{--without-texmf-dir}, in which case things
531 should work as well for them as for you.
532
533 @ifclear rawfile
534 @node Installation under MS Windows
535 @section Installation under MS Windows
536 @include wininstall.texi
537 @end ifclear
538
539 @node Customizing
540 @section Customizing
541 @cindex Site initialization
542 @cindex Initialization
543 @cindex @file{tex-site.el}
544 @cindex Personal customization
545 @cindex Site customization
546 @cindex Customization
547 @cindex Customization, personal
548 @cindex Customization, site
549 Most of the site-specific customization should already have happened
550 during configuration of @AUCTeX{}. Any further customization can be
551 done with customization buffers directly in Emacs. Just type @kbd{M-x
552 customize-group RET AUCTeX RET} to open the customization group for
553 @AUCTeX{} or use the menu entries provided in the mode menus. Editing
554 the file @file{tex-site.el} as suggested in former versions of @AUCTeX{}
555 should not be done anymore because the installation routine will
556 overwrite those changes.
557
558 You might check some variables with a special significance. They are
559 accessible directly by typing @kbd{M-x customize-variable RET <variable>
560 RET}.
561
562 @defopt TeX-macro-global
563 Directories containing the site's @TeX{} style files.
564 @end defopt
565
566 Normally, @AUCTeX{} will only allow you to complete macros and
567 environments which are built-in, specified in @AUCTeX{} style files or
568 defined by yourself. If you issue the @kbd{M-x
569 TeX-auto-generate-global} command after loading @AUCTeX{}, you will be
570 able to complete on all macros available in the standard style files
571 used by your document. To do this, you must set this variable to a list
572 of directories where the standard style files are located. The
573 directories will be searched recursively, so there is no reason to list
574 subdirectories explicitly. Automatic configuration will already have
575 set the variable for you if it could use the program @samp{kpsewhich}.
576 In this case you normally don't have to alter anything.