Skip to main content

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’.

The --without-texmf-dir option can 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:

β€˜preview-tetex’​

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.

β€˜auctex-emacs-tetex’​

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:

β€˜auctex-emacs’​

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’.