Thursday, November 10, 2011

The Winner is --- htlatex!

I have finally run into the right choices for using htlatex to produce a good file for the Kindle.  It turns out that Eitan Gurari (developer of tex4ht) took care of my needs after all.  You can supply the name of a configuration file on the command line for htlatex:

    htlatex asm64.tex asm64

In my case the latex file is "asm64.tex" and the configuration file is "asm64.cfg", which contains

    \Preamble{pic-tabular}

    \begin{document}

    \EndPreamble

The first line contains the magic incantation "pic-tabular" which transforms all latex tabular sections (tables) into pictures automatically.  There are also "pic-tabbing",  "pic-array", "pic-eqnarray",  "pic-fbox" and "pic-m" options which I may eventually need.

After changing all my \includegraphics commands to refer to .jpg files, I had a nice asm64.html file which looked fine with firefox.  I tried using kindlegen which did a poor job of generating a .mobi file.  Then I used calibre to create a .mobi and this was nearly perfect.  I have a few images made from xfig which have lines above and below them which I would prefer to eliminate and I need to include a cover image.

This is quite a good solution.  All the equations and tables looked great.  I would have liked larger rendering which I can probably arrange for, but overall this is better than my hand-written html code with very little additional effort after producing the original version.

Thanks to Eitan Gurari for his excellent work!

No comments: