[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.5 Providing AUCTeX as a package

As a package provider, you should make sure that your users will be served best according to their intentions, and keep in mind that a system might be used by more than one user, with different preferences.

There are people that prefer the built-in Emacs modes for editing TeX files, in particular plain TeX users. There are various ways to tell AUCTeX even after auto-activation that it should not get used, and they are described in Introduction to AUCTeX.

So if you have users that don’t want to use the preinstalled AUCTeX, they can easily get rid of it. Activating AUCTeX by default is therefore a good choice.

If the installation procedure did not achieve this already by placing ‘auctex.el’ and ‘preview-latex.el’ into a possibly existing ‘site-start.d’ directory, you can do this by placing

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)

in the system-wide ‘site-start.el’.

If your package is intended as an XEmacs package or to accompany a precompiled version of Emacs, you might not know which TeX system will be available when preview-latex gets used. In this case you should build using the --without-texmf-dir option described previously. This can also be convenient for systems that are intended to support more than a single TeX distribution. Since more often than not TeX packages for operating system distributions are either much more outdated or much less complete than separately provided systems like TeX Live, this method may be generally preferable when providing packages.

The following package structure would be adequate for a typical fully supported Unix-like installation:


Style files and documentation for ‘preview.sty’, placed into a TeX tree where it is accessible from the teTeX executables usually delivered with a system. If there are other commonly used TeX system packages, it might be appropriate to provide separate packages for those.


This package will require the installation of ‘preview-tetex’ and will record in ‘TeX-macro-global’ where to find the TeX tree. It is also a good idea to run

emacs -batch -f TeX-auto-generate-global

when either AUCTeX or teTeX get installed or upgraded. If your users might want to work with a different TeX distribution (nowadays pretty common), instead consider the following:


This package will be compiled with ‘--without-texmf-dir’ and will consequently contain the ‘preview’ style files in its private directory. It will probably not be possible to initialize ‘TeX-macro-global’ to a sensible value, so running ‘TeX-auto-generate-global’ does not appear useful. This package would neither conflict with nor provide ‘preview-tetex’.


Those are the obvious XEmacs equivalents. For XEmacs, there is the additional problem that the XEmacs sumo package tree already possibly provides its own version of AUCTeX, and the user might even have used the XEmacs package manager to updating this package, or even installing a private AUCTeX version. So you should make sure that such a package will not conflict with existing XEmacs packages and will be at an appropriate place in the load order (after site-wide and user-specific locations, but before a distribution-specific sumo package tree). Using the --without-packagedir option might be one idea to avoid conflicts. Another might be to refrain from providing an XEmacs package and just rely on the user or system administrator to instead use the XEmacs package system.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Mosè Giordano on July 24, 2017 using texi2html 1.82.