LaTeX2HTML: Publish Science to the Web

Tailoring math-intensive documents to fit the Internet.
Write for the Web

LaTeX2HTML is powerful in converting existing documents into web format. LaTeX2HTML offers a set of custom LaTeX commands and environments that allow you to include your own HTML markups in the text. You can take full advantage of normal HTML: you can add web forms, clickable image maps, external links/graphics or even Java applet/script to your document. For example, if you want to include a link to an outside web page in your generated HTML pages, you can just insert the following to mydoc.tex:

\htmladdnormallink{link title}{http://yourlink}

or more generically,

<A HREF="http://yourlink">link title</a>
If you want to print out a paper version of that HTML-enhanced document, you can include style file html.sty and then process it with normal LaTeX. Most of those LaTeX2HTML-specific commands/environments are ignored by LaTeX.

On the Server Side

LaTeX2HTML also can be used at the server side to facilitate web-based mathematical communications. Listing 1 demonstrates a Perl function that takes in a math-mode LaTeX string and returns an HTML markup for an image that displays the formula. There are other ways to do it more efficiently, but this is just an illustration of what LaTeX2HTML can do. It can be used in chat rooms or bulletin boards to allow the user to input and broadcast complex math formulae.

Listing 1. Perl Function Converting a LaTeX String to an HTML Markup



Michael Yuan is a PhD candidate in Astrophysics at University of Texas at Austin. He studies remote quasars (20-plus billion light years away) to understand the history and evolution of our universe. When he is not observing quasars, he enjoys developing useful software using earthly languages such as Java and Perl.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: LaTeX2HTML: Publish Science to the Web

Anonymous's picture

HyperLaTeX is a very good one way to do it. Much pretty one for me.

The problem are the locales , but you can use LyX to do the frame and then build a skeletton to use HyperLaTeX. Ximo