Previous: Advice for non-privileged users, Up: Installation


2.7 Installation under MS Windows

Installation of preview-latex under Windows has been verified to work with current CVS versions of GNU Emacs (no released version 21.x will work), and with both Cygwin and native versions of XEmacs. Here are the steps to perform:

  1. The installation of preview-latex will require the MSYS tool set from http://www.mingw.org. If you have the Cygwin tool set from http://cygwin.com installed, that should do just fine as well, but it is quite larger and slower.

    If you are installing preview-latex with one of those sets for an Emacs compiled in a different one, you should try to avoid tool-specific path names like /cygwin/c. Instead, use the c: syntax. It might also help to use forward slashes instead of the backward slashes more typical for MS Windows: while backward slashes are supposed to work if properly escaped in the shell, this is one area easily overlooked by the developers. The same holds for file or directory names with spaces in them. Another noteworthy problem is that you should be consistent with regard to using upper and lower case characters for directory names: while Windows ignores any differences in that area, the configuration scripts don't.

    It is appreciated if you report any problems you experienced when installing preview-latex, as we are trying our best to make it work even for platforms that we don't use ourselves.

    Compiling Emacs is outside of the scope of this manual. preview-latex itself does not require a C compiler for installation.

  2. Install a current version of XEmacs (such as 21.4.10) from http://www.xemacs.org or try getting and compiling an CVS version of GNU Emacs from http://savannah.gnu.org/cvs/?group=emacs. Precompiled versions happen to be available at http://www.crasseux.com/emacs/ and http://nqmacs.sf.net/.
  3. 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.
  4. Install AUCTeX according to its instructions. It is recommended that you install at least 11.55: PDF support starts with 11.51, and various bugs in particular for XEmacs are fixed in 11.55. This package is available from the XEmacs package repository but might still be in prerelease state.
  5. You need a copy of GhostScript.
  6. Perl is needed for building the documentation. When we release tarballs for preview-latex, we also pregenerate the documentation. If you install the `prebuilt-docs' tarball over the normal source after configuration is complete, the dependencies for the documentation will be satisfied without needing to run Perl. If you are building preview-latex from CVS, however, you'll need Perl.
  7. Now the fun stuff starts. Unpack the preview-latex distribution into some installation directory. Do not unpack it right into your Emacs' own directories: the installation will copy the material that needs to be placed there. Keep the installation directory separate: you can remove its contents after installation completes. Since you are reading this, you probably have already unpacked preview-latex, but it should still be easy to move it elsewhere now.
  8. Ready for takeoff. Start some shell (typically bash) capable of running configure, change into the installation directory and call ./configure with appropriate options.

    Typical options you'll want to specify will be

    --prefix=drive:/path/to/emacs-directory
    which tells configure where to perform the installation. It may also make configure find (X)Emacs automatically, if this doesn't happen try one of `--with-emacs' or `--with-xemacs' as described below. All automatic detection of files and directories restricts itself to directories below the prefix.
    --with-emacs
    if you are installing Emacs. You can use `--with-emacs=/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 your PATH environment setting).
    --with-xemacs
    If you are using XEmacs, of course use `--with-xemacs' in the same manner.
    --with-texmf-dir=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. See Configure for more information about the available options.
    --with-packagedir=/dir
    This XEmacs-only option configures the directory for XEmacs packages. A typical user-local setting would be ~/.xemacs/xemacs-packages. If this directory exists and is below prefix, it should be detected automatically.
    --with-lispdir=/path/to/site-lisp
    This tells where to install the setup file preview-latex.el. The other files from preview-latex will be installed in a subdirectory called preview. If you have a site-start.d directory for automatic package startup, please refer to the full installation instructions in Configure in order to make use of it.

    Calling ./configure --help 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="/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.

  9. If you need to use the prebuilt documentation (see above), now is the time to unpack it over the rest of the installation directory.
  10. Run make in the installation directory.
  11. Run make install in the installation directory.
  12. The above should leave you with a file preview-latex.el in a suitable place in load-path. If this is a special place where files get automatically loaded at startup, preview-latex will be automatically enabled in LaTeX modes. If this is not such a place, you can explicitly enable preview-latex with the incantation
              (load "preview-latex.el" nil t t)
         

    in your personal .emacs file or, if you have more than one user using your system, in the global site-start.el file.

  13. Load circ.tex into Emacs or XEmacs and see if you can generate previews.

    If this barfs and tells you that image type `png' is not supported, try adding the line

              (setq preview-image-type 'pnm)
         

    at the end of your installed version of preview-latex.el. If this helps, complain to wherever you got your Emacs: all current Emacs/XEmacs versions capable of running preview-latex by now can be compiled to support PNG images. Which is important, because PNM files take away vast amount of disk space, and thus also of load/save time.

Well, that about is all. Have fun!