LaTeX2HTML: Publish Science to the Web
Ironically, 20 years after the advent of the World Wide Web, it is still a struggle to publish math-intensive scientific documents on the Web. New standards like MathML have been out, but before the popular web browsers support them, the best way to reach a maximum audience is still to put math formulae as in-line graphics in HTML documents.
In the off-line world, TeX/LaTeX packages are known to produce the best formatted scientific documents. LaTeX is, in fact, a standard format for many academic journals. For scientists and researchers, the best of two worlds is to write in LaTeX and then publish on the Web. LaTeX2HTML is the perfect tool for that.
LaTeX2HTML originally was written by Nikos Drakos in 1993 as an open-source project. It was improved and enhanced by many members of the Open Source community. LaTeX2HTML converts LaTeX documents to standard HTML format. Since HTML is a text format, it converts all the nontext elements into in-line graphics. It is a Perl application and runs on many platforms including most flavors of UNIX/Linux and Windows.
In this article, I first give an example of how to convert a simple LaTeX document to HTML and discuss how the program handles in-line graphics and style files. I then explain the LaTeX2HTML-specific LaTeX commands/environments. Finally, I discuss a more creative use of LaTeX2HTML—using it on the server side. For simplicity, the term formula refers to anything that is in LaTeX's math mode. That includes simple in-text math symbols, “displaymath” formulae and numbered equations.
The usage of the command is very straightforward. If you want to publish your LaTeX document, mydoc.tex, to the Web, you run
latex2html -local_icons mydoc.tex
LaTeX2HTML creates a new subdirectory (mydoc/) and puts all HTML files and image files in it. You can now copy mydoc/ under the document tree of your web server, and your document is available at http://yourserver/path/mydoc/index.html.
The title, headings and emphasized text are marked up properly with HTML tags. All the formulae/tables/figures and anything that normal HTML cannot display are converted into in-line graphics.
If mydoc.tex has several sections/subsections, LaTeX2HTML generates an HTML file for each section and a table of contents with links to each section. Each page has a navigation bar with links to next/prev sections and the table of contents. If you want only one big HTML file, use the -split 0 command-line switch.
LaTeX2HTML needs to know where to find the icon images on the navigation bar. The simplest solution is to use the -local_icons command-line switch, which instructs LaTeX2HTML to copy the navigation icons into the directory mydoc/. You also can use custom navigation icons by replacing mydoc/*motif*.gif files with your own.
I use math formulae as an example to explain how LaTeX2HTML handles in-line graphics. It does the same thing for floating objects such as figures and tables.
LaTeX2HTML scans through mydoc.tex and extracts all math formulae into a file called images.tex. In images.tex, each formula is on a separate page. It then calls latex images.tex and dvips -S 1 -i to generate a one-page PostScript file for each formula. Ghostscript is used to convert and resize PostScript files into GIF or PNG images. LaTeX2HTML will remember the image names and insert the links back to HTML files generated from mydoc.tex.
There are several command-line switches to control the image generation process. For example, switch ps_images instructs LaTeX2HTML to use links to external PostScript files rather than in-line graphics.
LaTeX2HTML handles style files differently for text and in-line graphics. LaTeX2HTML ignores any style file when it generates main text HTML files from mydoc.tex. However, style files often define new commands and environments that cannot be ignored. As a workaround, LaTeX2HTML allows users to rewrite the style file in Perl format. When LaTeX2HTML encounters a style file, it searches for the Perl translation and incorporates it into the main script. Fortunately, many popular style files already have been translated into Perl. To write such translations requires a working knowledge of the LaTeX2HTML internal structure. It is a difficult task, but you have the source code.
We want formulae, figures and tables to look exactly the same as they would print out on paper, with all the custom symbols, fonts and spacing. So, images.tex includes all the style files used by mydoc.tex. Since images.tex is processed by LaTeX, the style files are handled correctly.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Linux Systems Administrator
- Validate an E-Mail Address with PHP, the Right Way
- Introduction to MapReduce with Hadoop on Linux
- RSS Feeds
- Weechat, Irssi's Little Brother
- New Products
- Developer Poll
- Reply to comment | Linux Journal
6 min 8 sec ago - Reply to comment | Linux Journal
51 min 23 sec ago - Didn't read
1 hour 1 min ago - Reply to comment | Linux Journal
1 hour 6 min ago - Poul-Henning Kamp: welcome to
3 hours 16 min ago - This has already been done
3 hours 17 min ago - Reply to comment | Linux Journal
4 hours 3 min ago - Welcome to 1998
4 hours 51 min ago - notifier shortcomings
5 hours 15 min ago - heroku?
6 hours 52 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Re: LaTeX2HTML: Publish Science to the Web
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