Skip to content

Rhaptos Software Development

Personal tools
You are here: Home » Developer Blog » Brian's Sooth » tex4ht notes

tex4ht notes tex4ht notes

Document Actions
Submitted by bnwest. on 2007-07-09 13:09. Documentation
tex4ht notes ... the horror

Installing tex4ht on Windows

I first installed MikTeX, since tex4tk is package therein.  See http://www.cse.ohio-state.edu/~gurari/TeX4ht/.

For tex4ht to work within MikTeX, MikTeX must be installed in a path without embedded spaces like the default install path: C:\Program Files\MikTeX 2.5\

Ran a simple latex command from a DOS command line and verified that the latex system was properly installed.

Next I ran a tex4ht command 'htlatex cdc06.tex'. This triggered MikTeX package installer to dynamically download and install the tex4ht package.  For whatever reason, this JIT tex4ht install failed to download. I kept getting a FTP error, no matter which FTP site I hit. 

Next I reinstalled MikTeX such that all of its package were loaded at install time. (This was actually a two step process: 1. download all of the packages. 2. install MikTeX with all of its packages.) I reverified that a simple latex command worked.

This time when I tried a tex4ht command 'htlatex cdc06.tex' I got a .html file back.  There were multiple ? prompts requiring I hit return, before tex4ht finished successfully.  The.html filed contained all of its math as images.  The .html file did correctly display in Firefox.

I next tried tried to create XHTML+Presntation-MathML via 'mzlatex'.  A .xml file was created with XHTML +Presntation-MathML inside.  This .xml file would not display in Firefox.  I changed its file extension to .htm and was then successful in loading to Firefox.  The XHTML is an eysore but fairly regular which could lead to an OK XSL transform into CNXML.  This will need further investigation.  The images failed to load.

I next tried to create a OpenOffice.org 2.0 format file (n .odt file) via 'oolatex'.  This command did not successfully complete. This is likely a tex4ht Windows only bug. We might want to see if 'oolatex' has better luck on a linux system.

The images failing to load was a user error ;) I needed to throw a new DOS window after installing ImageMagick, which also has to install in a spaceless path.  After getting this right, neither 'htlatex' nor 'mzlatex' continue to work. :(

Installing tex4ht on Linux

It is a Debian package => dead simple.

htlatex is installed to /usr/bin.  mzlatex and oolatex is installed to /usr/share/tex4ht/ and not in my PATH.

htlatex genrates a HTML file with the math as image files. For Ray's paper, the math got translated into images, but the EPS images did not get translated into PNG images. Translated tables were ugly and would require extensive post translation editing.

mzlatex generates a HTML file containing the XHTML+Presentation-MathML. For Ray's paper, the math got translated into Presentation-MathML. The EPS images did not get translated into PNG images. Translated tables were ugly and would require extensive post translation editing.

oolatex generates a .odt file. For Ray's paper, content after a figure with four tables was not visible in OpenOffice, i.e. some content got truncated. (I would need to examine the .odt file to see if the truncation occured in the.odt file versus OO haivng problems with display.) OO cored while convert the .dft into a .sxw file, which would mean that the OO server in our process would likely crash as well with the same input. Image files were not displayed and tables were ugly.


Re: tex4ht notes

Posted by rwagner at 2007-08-28 10:47
presentation MathML generated by tex4ht wasn't of a very good quality in elchin's experiments - he had to do LOTS of hand cleanup afterwards.