I am trying to use pandoc to convert a large thesis from latex to html. I want my latex internal references (\ref) to sections (\label), equations, tables,figures etc. to appear as links in the resulting html. As the source is quite large (~350 pages) I would appreciate if anybody knew of an automatic way to do it.
Asked
Active
Viewed 1,391 times
0
-
Here's a reference start: [How do I make a reference to a figure in markdown using pandoc?](http://stackoverflow.com/q/9434536/914686) – Werner Sep 16 '15 at 22:24
-
I 've seen such references, but my source is in latex not markdown – Panagiotis Grontas Sep 18 '15 at 07:34
1 Answers
0
I am trying to use pandoc to convert a large thesis from latex to html.
Pandoc has a good support to convert from LaTeX to HTML but you need to avoid many packages. You probably want to try LaTeXML if you use many packages.
I want my latex internal references (\ref) to sections (\label), equations, tables,figures etc. to appear as links in the resulting html.
When converting from LaTeX to HTML, Pandoc doesn't add number to sections
$ pandoc -f latex <<EOF
\section{foo}\label{s:foo}
EOF
<h1 id="s:foo">foo</h1>
because this is normally done with CSS and in consequence cross-reference is converted only to links
$ pandoc -f latex <<EOF
bla \ref{s:foo} bla
EOF
<p>bla [s:foo] bla</p>
For more information you should take a look at
- https://github.com/jgm/pandoc/pull/509
- https://github.com/jgm/pandoc/issues/813
- https://github.com/jgm/pandoc/issues/1015
As the source is quite large (~350 pages) I would appreciate if anybody knew of an automatic way to do it.
My suggestion is to use LaTeXML.

Raniere Silva
- 2,527
- 1
- 18
- 34
-
I am using pandoc since it can convert latex equations to images using webtex. MathML is not an option due to incompatibilities. Can I do this with latexml – Panagiotis Grontas Sep 18 '15 at 07:36
-
LaTeXML can convert LaTeX equations to images (PNG, `--mathimage`, or SVG, `--mathsvg`). I think that it does not support MathJax. – Raniere Silva Sep 18 '15 at 12:18
-