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:
- If you unpacked the distribution using Winzip or similar, you better
restart using infozip on the `.zip' file, or standard Unix tools
(see the next point) on the `.tar.gz' file: tools that make the
mistake of turning Unix line endings into MSDOS line endings will cause
trouble later in installation and operation.
- 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.
- 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
Savannah. Precompiled
versions happen to be available at http://www.crasseux.com/emacs/
and http://nqmacs.sf.net/.
- 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.
- 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.
- You need a copy of GhostScript.
- Perl is needed for rebuilding the
documentation if you are working with a copy from CVS or have
touched documentation source files.
- 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.
- 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- is an XEmacs-only option giving the location of the package directory.
This will install and activate the package. Emacs uses a different
installation scheme:
--with-lispdir=
/path/to/site-lisp- This Emacs-only option tells where to install the setup file
preview-latex.el (if not autodetected). 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.
- If you need to use the prebuilt documentation (see above), now is the
time to unpack it over the rest of the installation directory.
- Run make in the installation directory.
- Run
make install
in the installation directory.
- In the case of XEmacs, the package directory setup creates startup files
as necessary and you can skip to the next point. If you are using
Emacs, the installation procedure should have left 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.
- 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!