1.2.7 Installation under MS Windows
In a Nutshellβ
The following are brief installation instructions for the impatient. In case you donβt understand some of this, run into trouble of some sort, or need more elaborate information, refer to the detailed instructions further below.
Install the prerequisites, i.e. GNU Emacs, MSYS or Cygwin, a TeX system, and Ghostscript.
Open the MSYS shell or a Cygwin shell and change to the directory containing the unzipped file contents.
Configure AUCTeX:
For Emacs: Many people like to install AUCTeX into the pseudo file system hierarchy set up by the Emacs installation. Assuming Emacs is installed in β
C:/Program Files/Emacsβ and the directory for local additions of your TeX system, e.g. MiKTeX, is βC:/localtexmfβ, you can do this by typing the following statement at the shell prompt:./configure --prefix='C:/Program Files/Emacs' \ --infodir='C:/Program Files/Emacs/info' \ --with-texmf-dir='C:/localtexmf'The commands above is example for common usage. More on configuration options can be found in the detailed installation instructions below.
If the configuration script failed to find all required programs, make sure that these programs are in your system path and add directories containing the programs to the
PATHenvironment variable if necessary. Here is how to do that in W2000/XP:- On the desktop, right click βMy Computer" and select properties.
- Click on βAdvanced" in the βSystem Properties" window.
- Select βEnvironment Variables".
- Select βpath" in βSystem Variables" and click βedit". Move to the front in the line (this might require scrolling) and add the missing path including drive letter, ended with a semicolon.
If there were no further error messages, type
makeIn case there were, please refer to the detailed description below.
Finish the installation by typing
make install
Detailed Installation Instructionsβ
Installation of AUCTeX under Windows is in itself not more complicated than on other platforms. However, meeting the prerequisites might require more work than on some other platforms, and feel less natural.
If you are experiencing any problems, even if you think they are of your own making, be sure to report them to auctex-devel@gnu.org so that we can explain things better in future.
Windows is a problematic platform for installation scripts. The main problem is that the installation procedure requires consistent file names in order to find its way in the directory hierarchy, and Windows path names are a mess.
The installation procedure tries finding stuff in system search paths and in Emacs paths. For that to succeed, you have to use the same syntax and spelling and case of paths everywhere: in your system search paths, in Emacsβ load-path variable, as argument to the scripts. If your path names contain spaces or other βshell-unfriendlyβ characters, most notably backslashes for directory separators, place the whole path in β"double quote marks"β whenever you specify it on a command line.
Avoid βhelpfulβ magic file names like β/cygdrive/cβ and βC:\PROGRA~1\β like the plague. It is quite unlikely that the scripts will be able to identify the actual file names involved. Use the full paths, making use of normal Windows drive letters like β 'C:/Program Files/Emacs' β where required, and using the same combination of upper- and lowercase letters as in the actual files. File names containing shell-special characters like spaces or backslashes (if you prefer that syntax) need to get properly quoted to the shell: the above example used single quotes for that.
Ok, now here are the steps to perform:
You need to unpack the AUCTeX distribution (which you seemingly have done since you are reading this). It must be unpacked in a separate installation directory outside of your Emacs file hierarchy: the installation will later copy all necessary files to their final destination, and you can ultimately remove the directory where you unpacked the files.
Line endings are a problem under Windows. The distribution contains only text files, and theoretically most of the involved tools should get along with that. However, the files are processed by various utilities, and it is conceivable that not all of them will use the same line ending conventions. If you encounter problems, it might help if you try unpacking (or checking out) the files in binary mode, if your tools allow that.
If you donβt have a suitable unpacking tool, skip to the next step: this should provide you with a working β
unzipβ command.The installation of AUCTeX will require the MSYS tool set from http://www.mingw.org/ or the Cygwin tool set from https://cygwin.com/. The latter is slower and larger (the download size of the base system is about 15 MB) but comes with a package manager that allows for updating the tool set and installing additional packages like, for example, the spell checker aspell.
If Cygwin specific paths like β
/cygdrive/cβ crop up in the course of the installation, using a non-Cygwin Emacs could conceivably cause trouble. Using Cygwin either for everything or nothing might save headaches, if things donβt work out.Install a current version of Emacs from https://ftp.gnu.org/gnu/emacs/windows/.
You need a working TeX installation. One popular installation under Windows is MiKTeX. Another much more extensive system is TeX Live which is rather close to its Unix cousins.
A working copy of Ghostscript is required for preview-latex operation. Examining the output from
gswin32c -hon a Windows command line should tell you whether your Ghostscript supports the
png16mdevice needed for PNG support. MiKTeX apparently comes with its own Ghostscript called βmgs.exeβ.Perl is needed for rebuilding the documentation if you are working with a copy from Git or have touched documentation source files in the preview-latex part. If the line endings of the file β
preview/latex/preview.dtxβ donβt correspond with what Perl calls\nwhen reading text files, youβll run into trouble.Now the fun stuff starts. If you have not yet done so, unpack the AUCTeX distribution into a separate directory after rereading the instructions for unpacking above.
Ready for takeoff. Start some shell (typically
bash) capable of runningconfigure, change into the installation directory and call./configurewith appropriate options.Typical options youβll want to specify will be
--prefix=drive:/path/to/emacs-hierarchyβwhich tells β
configureβ where to perform the installation. It may also make βconfigureβ find Emacs automatically; if this doesnβt happen, try β--with-emacsβ as described below. All automatic detection of files and directories restricts itself to directories below theprefixor in the same hierarchy as the program accessing the files. Usually, directories like βmanβ, βshareβ and βbinβ will be situated right underprefix.This option also affects the defaults for placing the Texinfo documentation files (see also β
--infodirβ below) and automatically generated style hooks.If you have a central directory hierarchy (not untypical with Cygwin) for such stuff, you might want to specify its root here. You stand a good chance that this will be the only option you need to supply, as long as your TeX-related executables are in your system path, which they better be for AUCTeXβs operation, anyway.
--with-emacsβif you are installing for a version of Emacs. You can use β
--with-emacs=drive:/path/to/emacsβ to specify the name of the installed Emacs executable, complete with its path if necessary (if Emacs is not within a directory specified in yourPATHenvironment setting).--with-lispdir=drive:/path/to/site-lispβThis option tells a place in
load-pathbelow which the files are situated. The startup files βauctex.elβ and βpreview-latex.elβ will get installed here unless a subdirectory βsite-start.dβ exists which will then be used instead. The other files from AUCTeX will be installed in a subdirectory called βauctexβ.If you think that you need a different setup, please refer to the full installation instructions in Configure.
--infodir=drive:/path/to/info/directoryβIf you are installing into an Emacs directory, info files have to be put into the β
infoβ folder below that directory. The configuration script will usually try to install into the folder βshare/infoβ, so you have to override this by specifying something like β--infodir='C:/Program Files/info'β for the configure call.--with-auto-dir=drive:/dirβDirectory containing automatically generated information. You should not normally need to set this, as β
--prefixβ should take care of this.--disable-previewβUse this option if your Emacs version is unable to support image display.
--with-texmf-dir=drive:/dirβThis will specify the directory where your TeX installation sits. If your TeX installation does not conform to the TDS (TeX directory standard), you may need to specify more options to get everything in place.
For more information about any of the above and additional options, see Configure.
Calling β
./configure --help=recursiveβ will tell about other options, but those are almost never required.Some executables might not be found in your path. That is not a good idea, but you can get around by specifying environment variables to β
configureβ:GS="drive:/path/to/gswin32c.exe" ./configure β¦should work for this purpose. β
gswin32c.exeβ is the usual name for the required command line executable under Windows; in contrast, βgswin32.exeβ is likely to fail.As an alternative to specifying variables for the β
configureβ call you can add directories containing the required executables to thePATHvariable of your Windows system. This is especially a good idea if Emacs has trouble finding the respective programs later during normal operation.Run
makein the installation directory.Run
make installin the installation directory.With Emacs, activation of AUCTeX and preview-latex depends on a working β
site-start.dβ directory or similar setup, since then the startup files βauctex.elβ and βpreview-latex.elβ will have been placed there. If this has not been done, you should be able to load the startup files manually with(load "auctex.el" nil t t) (load "preview-latex.el" nil t t)in either a site-wide β
site-start.elβ or your personal startup file (usually accessible as β~/.emacsβ or β~/.emacs.d/init.elβ from within Emacs).The default configuration of AUCTeX is probably not the best fit for Windows systems with MiKTeX. You might want to add
(require 'tex-mik)after loading β
auctex.elβ and βpreview-latex.elβ in order to get more appropriate values for some customization options.You can always use
M-x customize-group RET AUCTeX RETin order to customize more stuff, or use the β
Customizeβ menu.Load β
circ.texβ into Emacs and see if you get the βCommandβ menu. Try using it to LaTeX the file.Check whether the β
Previewβ menu is available in this file. Use it to generate previews for the document.If this barfs and tells you that image type β
pngβ is not supported, you can either add PNG support to your Emacs installation or choose another image format to be used by preview-latex.Adding support for an image format usually involves the installation of a library, e.g. from http://gnuwin32.sf.net/. If you got your Emacs from https://www.gnu.org/ you might want to check its README file for details.
A different image format can be chosen by setting the variable
preview-image-type. While it is recommended to keep the βdvipngβ or βpngβ setting, you can temporarily select a different format like βpnmβ to check if the lack of PNG support is the only problem with your Emacs installation.Try adding the line
(setq preview-image-type 'pnm)to your init file for a quick test. You should remove the line after the test again, because PNM files take away vast amounts of disk space, and thus also of load/save time.
Well, that about is all. Have fun!