-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Description
Although the fix in #9711 has been implemented, not all math environments appear to be handled correctly.
Consider the following MWE:
# handled as expected
$$\begin{eqnarray}
S &\rightarrow& a A \nonumber \\
A &\rightarrow& d B \ | \ b A \ | \ c A \nonumber \\
B &\rightarrow& a c \ | \ b C \ | \ c A \nonumber \\
C &\rightarrow& \epsilon \nonumber
\end{eqnarray}$$
# will emit additional math environment
$$
\begin{eqnarray}
S &\rightarrow& a A \nonumber \\
A &\rightarrow& d B \ | \ b A \ | \ c A \nonumber \\
B &\rightarrow& a c \ | \ b C \ | \ c A \nonumber \\
C &\rightarrow& \epsilon \nonumber
\end{eqnarray}
$$Compiling this with Pandoc 3.8.2.1 to LaTeX (pandoc mwe.md -t latex) the first case is recognised correctly, while in the second case an additional math environment is incorrectly wrapped around the eqnarray.
Output:
\section{handled as expected}\label{handled-as-expected}
\begin{eqnarray}
S &\rightarrow& a A \nonumber \\
A &\rightarrow& d B \ | \ b A \ | \ c A \nonumber \\
B &\rightarrow& a c \ | \ b C \ | \ c A \nonumber \\
C &\rightarrow& \epsilon \nonumber
\end{eqnarray}
\section{will emit additional math
environment}\label{will-emit-additional-math-environment}
\[
\begin{eqnarray}
S &\rightarrow& a A \nonumber \\
A &\rightarrow& d B \ | \ b A \ | \ c A \nonumber \\
B &\rightarrow& a c \ | \ b C \ | \ c A \nonumber \\
C &\rightarrow& \epsilon \nonumber
\end{eqnarray}
\]
Now, I could just drop the $$ when writing my Markdown files, but unfortunately they are needed for generating Github Markdown (gfm). If I drop the $$ and compile the example with pandoc mwe.md -t gfm, the eqnarray are simply ignored completely – whereas with $$ they are compiled as expected.