Latex to HTML (Or, How I stopped worrying and learnt to love Hevea)

Filed under: computers, latex by tamber
4 January 2012 @ 14:03

I write my CV in LaTex and generate all the different versions I need (PDF, plain text, MSOffice, etc.) from that one file; it makes my life so much easier.

Recently, I decided I really should generate HTML output, too; and went for the first solution I thought of: "look for something named 'latex2html' in Portage". Simple.

Except it doesn't work.

I run the source LaTeX through a filter or two to mangle little things before generating the output document, which means the LaTeX-to-whatever program needs to be able to accept input on STDIN. latex2html does not. It also will not work with /dev/stdin; trying to do so will just get it to look for /dev/stdin.tex.

I thought I was going to settle for stupid workarounds like creating temporary files, or using a wrapper that generates temporary files, etc. Blech.

However, I stumbled upon Hevea from a comment link somewhere in the bowels of my search for a better program. It does things The Right Way™: Accepts input on STDIN, can output on STDOUT.

Hopefully, this saves someone else from being stuck with yet another tool that should fit into a pipeline but doesn't.