The l2h help pages   © Leon van Dommelen 
The latest version of this document is online at eng.famu.fsu.edu or at dommelen.net.

Using Your Own Document

Normally, the easiest is to use one of the template documents in l2h. But maybe you already have a LaTeX document on which you want to use some feature of l2h. This web page explains how you can adapt the document to work with l2h.

What you need to do depends on what you want to use l2h for. The next sections list the requirements depending on that.

Always needed, even for latex removal

When using l2h, your document must be called index.tex. For various reasons, that is build into the fundamentals of l2h.

The easiest is simply to rename your document. Right-click it to do so.

To use l2h, you also want to copy file "l2h_menu.bat" from inside the l2h "example" folder to the same folder with your document index.tex. (If you are a command line user, you can source init.bat in the l2h folder, and then use the command "menu.bat" to enter the menu. Then you do not need l2h_menu.bat).

To create a pdf of your document

If you want l2h to create a pdf document, it will normally try to use plain LaTeX to do so. If your document needs to be processed by pdfLaTeX, add a line

\newcommand{\pdfengine}{pdflatex}
inside the document. If it needs XeLaTeX, add instead
\newcommand{\pdfengine}{xelatex}

To create web pages of your document

If you want to create web pages of your document, it gets a bit more complicated. In case of trouble, carefully study the latex source of the appropriate l2h example.

First, you want to move any existing "index.css" and ".latex2html-init" file in the folder out of the way. Otherwise they will be overwritten. (After you have selected a theme during web page generation, you can transfer any needed customizations to the theme's "index.css" and "settings.pl" files that l2h put in the folder.)

Second, you will want to add a line:

\usepackage{html}
near the start of your document. Put it behind the hyperref package, if any. (If you need it, the corresponding file "html.sty" is in the "texinputs" folder of l2h.)

Third, if you use package inputenc or fontspec, enclose it between comment lines as in the following example:

%begin{latexonly}
% Start of the internationalization section:
\usepackage[...]{inputenc}
% End of the internationalization section.
%end{latexonly}
The two starting comment lines and the two final comment lines must be exactly as shown. If fonts must be loaded, these commands should also between the comment lines. Otherwise the proper international characters will not be available during web page image generation. (Which means that they will not be available in your figures, tables, and mathematical formulae.) (If you use a special inputenc instead of utf-8, you may also need to edit settings.pl, after the web page theme selection, and change $HTML_VERSION. See the "versions" folder of l2h for what is recognized by latex2html.) See also the internationalization web page.

Now if your latex document uses eps graphics and so can be processed using the plain latex dvi-ps-pdf route, you should be able to process it into web pages as is.

If your document uses other than eps graphics, you will need to create eps copies of the figures as described in the image conversion web page. Then follow say example 4 in defining a \putpicture command that selects the right picture format for web page generation. Or alternatively, convert the eps figures further to pdf ones, Then convert your document to use xelatex and use the created pdf images as in, say, \includegraphics{fig5.pdf}. If you do the latter, you need to put a line

\newcommand{\webengine}{xelatex}
somewhere in your index.tex file.

Fourth, the images (and maybe some \input or \include files) must be in the same folder with your file index.tex. (Or you must use completely specified paths.) Otherwise they will not be found during web page generation.

You may want to change web page headers, footers, and some other web page parameters. Set the values in your latex document following one of the examples, like say index1.txt. (Alternatively, edit settings.pl, after the web page theme selection. Do not edit .latex2html-init.)

The web page themes are optimized assuming a 12pt LaTeX font size. If your document uses a different font size, some tweaking of the web page font and/or mathematics sizes may be desired. That can be done from within the l2h menu. (Or you can edit settings.pl or index.css)

 Index   Examples