DOCUMENT CONVERSIONS
This document outlines various different methods for converting latex documents into other formats which can then be made available on the web.
DVI: latex
Simly run latex on the document in question to produce the dvi file. The dvi file can then be placed on the web server and linked to from a suitable webpage.POSTSCRIPT: dvips
First run latex to obtain the dvi file. Then usedvips -D600 -o file.ps file[.dvi]
The option -D600 sets the resolution in dpi to the same as is obtained when sending direct to the printer. Without this option the postscript file may only be 300dpi.
The resulting postscript file can then be compressed using gzip to save disk space. Such compressed files can be automatically uncompressed and viewed by netscape when the appropriate link is chosen.
PDF: ps2pdf, epstopdf, pdflatex
There are 2 ways to produce PDF output. One method is to produce a postscript file as explained above and then use ps2pdf, e.g.ps2pdf file.ps file.pdf
The second method is use pdflatex. Most latex documents can be used with pdflatex except that any included postscript graphics needs to be first converted to pdf format. This can be done simply with epstopdf, e.g.
epstopdf figure.eps
will produce figure.pdf and keep ''the bounding box''
Assuming you insert such graphics with either the epsfig or includegraphics command then you can make your tex work with both pdflatex and latex simply by refering to the files without the extensions. latex or pdflatex will then look for default extension including eps or ps for latex and pdf for pdflatex, e.g. doing
\includegraphics{figure}
it will look for figure.eps or figure.ps when running latex but will look for figure.pdf when running pdflatex.
If you use pstex andd pstex_t files from xfig then you need to remove the explicit .pstex extension reference made in the pstex_t file to make it work with pdflatex.
LATEX2HTML
First latex the document as normal as latex2html will use the generated .aux files for crossreferencing etc. Then in its simplest form you simply do
latex2html file.tex
Doing this it will use the default options and eventually generate all the HTML and GIF images in a subdirectory with the name file. The resulting files can then be put on the web server (or alternatively you could have moved the tex file to the web server before you started).
To see the full list of option to latex2html run
latex2html -h
and the full instruction manual is available on the Help web pages, simply follow the links to online documentation.
Some useful options may be
- -address
- Supply your own string if you don't like the default <Name> <Date>. For example
-address "Last changed $address_data[1].<BR><I>K.A. Gillow.</I><BR><A
HREF=mailto:gillow@maths.ox.ac.uk>gillow@maths.ox.ac.uk</A>"- -dir
- Sets the output directory to something other than file.
- -info
- Do not make an about this document page.
- -no_math
- all maths is passed to latex and produced as a gif. The default behaviour means it will try to use plain text to display equation if the entire equation can be done that way. However combining this with the option -html_version 3.2,math does something different. This causes it to only produce gifs for individual bits of equations that it cannot adequately represent with simple text.
- -no_resuse
- Prompt as to whether to resue previously generated images. Useful if the previous run failed to force it to do everything from scratch.
- -show_section_numbers
- To make it show the section numbering.
- -split
- Stop splitting sections into separate files at this depth. The default is 8.
All these can also be set using a personal latex2html configuration file called ~/.latex2html-init.
Thus the above option can be set with the lines
$ADDRESS = "Last changed $address_data[1].<BR><I>K.A. Gillow.</I><BR><A
HREF=mailto:gillow@maths.ox.ac.uk>gillow@maths.ox.ac.uk</A>";$DESTDIR = <dirname>;
$INFO = 0;
$NO_MATH = 1;
$HTML_VERSION = 3.2,math;
$REUSE = 0;
$SHOW_SECTION_NUMBERS = 1;
$MAX_SPLIT_DEPTH = <num>;
Other useful options that can be set this way are
$BODYTEXT = 'BGCOLOR=#ffffff'; -- this specifies the pages should have a background color #ffffff (i.e. white). This can also be set in the latex document itself by adding in the line
\usepackage{html}
after the documentclass line and the line\bodytext{BGCOLOR="\#ffffff"}
after the\begin{document}
line. $FIGURE_SCALE_FACTOR = 1.6; -- scale factor applied to all images of figure and other environments, when being made into an image.$MATH_SCALE_FACTOR = 1.6; -- scale factor applied to all images of mathematics, both inline and displayed.
$DISP_SCALE_FACTOR = 1; -- extra scale factor applied to images of displayed math environments. When set, this value multiplies $MATH_SCALE_FACTOR to give the total scaling. A value of `1.3' is a good choice to accompany $MATH_SCALE_FACTOR = 1.0;.