# pandoc loses references when converting equation environment into markdown

Simple example latex, with an equation and a reference to it:

\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}

$$\label{eq:somelabel} e=mc^2$$

The equation \ref{eq:somelabel} is a typical formula.

\end{document}


compiled it looks like this:

The problem is that this both the numbering and the reference is lost when I convert to md since I get something like this:

$$\label{eq:somelabel} e=mc^2$$

The equation [$eq:somelabel$](#eq:somelabel){reference-type="ref"
reference="eq:somelabel"}


which is a problem because it makes the conversion later to html very ugly. Am I missing something obvious? Tried using the cross-ref filter but no to avail. Yet I know bookdown in R can deal with equation environment no problem.

• Converting the equation env into the unnumbered $$...$$ is obviously wrong. But this is not really latex related, you'll probably need to figure out how to configure pandoc correctly (I have no idea) – daleif Aug 25 '20 at 6:19