Converting LaTeX publications to HTML
Here is a quick recipe to get started:
- Get pandoc, to convert LaTeX to HTML. Run this command:
pandoc article.tex -o article.html --bibliography article.bib --mathjax
- Add
<html>,<head>and<body>elements. - Restore the title of the article (use
<title>and<h1>) and the author names. - Restore figures. PDF figures can be converted into SVG images with Inkscape.
- Restore figure captions (you can use
<figcaption>). - Restore
\ref -> \labellinks (use<a href="#label">and<h2 id="label">). - Add a link to MathJax:
<script src="mathjax/MathJax.js?config=TeX-AMS_HTML"></script>
- Include a CSS stylesheet. You can start with this file.
Not that macros declared with \newcommand and the \input command are not supported by pandoc.
Optional changes
- Change the level of the headings (e.g.,
<h1> -> <h2>) - HTML5: Add
<section>elements, use<header>for the title of the article and the author list and<footer>for the bibliography and the footnotes. - You can change the citation style by supplying a file in CSL format to pandoc.
Future work
- Add links from references in the article to full references in the bibliography.
- In an ideal world, you could write your article directly in Markdown and use pandoc to produce both a LaTeX and an HTML version of it.