Introduction
I would like to create the source code in latex in order to create a pdf via pdflatex and an html page through pandoc. I use the following source
\documentclass[12pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[magyar]{babel} \usepackage{hyperref} \begin{document} \begin{enumerate} \item \label{itm:thefirst} First example point \end{enumerate} This is an example to demonstrate how \textbackslash label\{\} and \textbackslash ref\{\} are not working with pandoc. Here should be a reference to the first example: \ref{itm:thefirst} \end{document}
This can be compiled using pdflatex without any errors or warnings.
Problem
I am creating an html page through pandoc using the following code:
pandoc -f latex sample.tex -t html5 -o sample.html -S --toc -s
but it creates unsatisfactory results around the label and link:
<body> <ol> <li><p>[itm:thefirst] First example point</p></li> </ol> <p>This is an example to demonstrate how \label{} and \ref{} are not working with pandoc. Here should be a reference to the first example: [itm:thefirst]</p> </body>
Question
What should I change in the latex source code to get something like this:
<body> <ol> <li><p id="itm:thefirst">First example point</p></li> </ol> <p>This is an example to demonstrate how \label{} and \ref{} are not working with pandoc. Here should be a reference to the first example: <a href="#itm:thefirst">(1)</a></p> </body>
html latex cross-reference pandoc
DanielTuzes Mar 16 '15 at 21:02 2015-03-16 21:02
source share