5 Short version of the recipe
In this section we present a condensed version of the previous recipe, without all the
gory details. Assuming that LATEX, TEX4ht, ImageMagick and GhostScript are
installed, you may download a file package from [6] containing the other essentials.
These include:
- A precompiled binary for dvi2bitmap.
- The cscript.sh script.
- A version of tex4ht.env adapted to use cscript.sh.
- The customlinks.tex macros for customized HTML links.
If you have skipped directly to this section without reading about the background for
these components, you will not necessarily understand what they do or what they are
needed for. Consult the other sections if you are bewildered.
Now for the recipe for converting your LATEX document into HTML:
- Download the file package tex4ht-files.tar.gz and decompress it into
your working directory. (That is, the directory from where you run the
latex-commands.)
- Modify your source code:
- Add \usepackage[html,png]{tex4ht} to your preamble, that is
before the \begin{document} command.
- Move all macro definitions (for example \newcommand and
\newenvironment definitions) to after the \begin{document}
command.
- Compile your document:
- You may run ht latex document , where document is the file name
of your LATEX document without extension.
- You may also run your own set of commands if the above does not seem to
cope with all your tables or similar:
latex document
latex document
latex document
tex4ht document
t4ht document
|
This is the sequence actually run with ht latex document. Run
additional latex commands, bibtex commands or whatever before the
tex4ht and t4ht commands.
- If compilation succeeded, your HTML version is stored in document*.html and
the graphic content is stored in document*.png. Additional cascading style
sheet-specifications recides in document*.css. All these files must be published
in the same directory on the web for the document to be displayed
correctly.