LaTeX to HTML via Pandoc

Further along a path to avoid all Microsoft products in any workflow ... A post mainly to remind myself of how to do this in the future, maybe of use to others.

So I write pretty much everything in LaTeX now - it gracefully handles everything (maths, figures, bibliographies).  And using pandoc, a lot of between format conversions are easy.  Specifically, I want to convert relatively vanilla LaTeX documents (with a bibliography and inline citations) for blog posts to HTML.

Here's how.  Assume I've written something "myTexFile.tex" with an accompanying bibliography "myTexBiblio.bib" file.  On the command line:

pandoc myTexFile.tex -f latex -t html -s -o myHtmlFile.html
--bibliography myTexBiblio.bib

The options:

  • -f specifies the source format, LaTeX

  • -t specifies the target format (HTML)

  • -s tells pandoc to produce a 'standalone' HTML file

  • -o specifies the output filename

  • --bibliography gives pandoc the .bib file for the citations in myTexFile.tex

Bingo.

Collaborating on Documents Avoiding MSoft Word