-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
I had an issue in Rmarkdown which I ultimately tracked down to Pandoc.
To reproduce
- Construct the following Markdown file, e.g.,
testfile.md
:Text before equations. \begin{subequations} \begin{align} a\\ b \end{align} \end{subequations} Text after equations. Text before equations. \begin{align} a\\ b \end{align} Text after equations.
- Run
pandoc testfile.md -o testfile.tex
.
Expected result
The following LaTeX file:
Text before equations. \begin{subequations}
\begin{align}
a\\
b
\end{align}
\end{subequations} Text after equations.
Text before equations. \begin{align}
a\\
b
\end{align} Text after equations.
Actual result
Text before equations.
\begin{subequations}
\begin{align}
a\\
b
\end{align}
\end{subequations}
Text after equations.
Text before equations. \begin{align}
a\\
b
\end{align} Text after equations.
Thus, spurious paragraph breaks are created before \begin{subequations}
and after \end{subequations}
but not so with the align
environment.
Workaround
For now, this can be worked around by replacing \begin{subequations}
and \end{subequations}
with LaTeX macros:
\def\bse{\begin{subequations}}
\def\ese{\end{subequations}}
Notes
From keyword searching through the source code, I suspect that at least a part of the fix would be to add "subequations"
to the list below. However, I know neither Haskell nor Pandoc's internals, so I don't know what else is involved.
pandoc/src/Text/Pandoc/Writers/HTML.hs
Lines 1652 to 1679 in a6fa3df
where envName = T.takeWhile (/= '}') (T.drop 7 s) | |
mathmlenvs = [ "align" | |
, "align*" | |
, "alignat" | |
, "alignat*" | |
, "aligned" | |
, "alignedat" | |
, "array" | |
, "Bmatrix" | |
, "bmatrix" | |
, "cases" | |
, "CD" | |
, "eqnarray" | |
, "eqnarray*" | |
, "equation" | |
, "equation*" | |
, "gather" | |
, "gather*" | |
, "gathered" | |
, "matrix" | |
, "multline" | |
, "multline*" | |
, "pmatrix" | |
, "smallmatrix" | |
, "split" | |
, "subarray" | |
, "Vmatrix" | |
, "vmatrix" ] |
Metadata
Metadata
Assignees
Labels
No labels