You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In LaTeX, a empty line marks the end of one paragraph and the begin of another. This rule also apply for math environments like equation, align, ...
Steps to Reproduce
$ cat sample.tex
begin of paragraph
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
end of paragraph.
$ pandoc --version | head -n 1
pandoc 1.13.2
$ pandoc -f latex -t html --mathml sample.tex
Actual Results
Three paragraphs were created:
<p>begin of paragraph</p>
<p><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">a^2 + b^2 = c^2</annotation></semantics></math></p>
<p>end of paragraph.</p>
Expected Results
Only one paragraph was created:
<p>begin of paragraph <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">a^2 + b^2 = c^2</annotation></semantics></math> end of paragraph.</p>
Aditional information
When I use $$ I get the correct behavior.
$ cat sample.tex
begin of paragraph
$$a^2 + b^2 = c^2$$
end of paragraph.
$ pandoc --version | head -n 1
pandoc 1.13.2
$ pandoc -f latex -t html --mathml sample.tex
<p>begin of paragraph <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">a^2 + b^2 = c^2</annotation></semantics></math> end of paragraph.</p>
The text was updated successfully, but these errors were encountered:
In pandoc all environments which start with \begin{...} are parsed as block level elements. Math is an inline element so has to be lifted to the block level and this is done using the extra Para element.
I think I came up with a fairly simple fix, which will cause \begin{equation}...\end{equation} and the like to be
included in a display math inline inside a paragraph when
possible, rather than creating a new paragraph.
+++ Matthew Pickering [Dec 16 14 11:18 ]:
In pandoc all environments which start with \begin{...} are parsed as
block level elements. Math is an inline element so has to be lifted to
the block level and this is done using the extra Para element.
—
Reply to this email directly or [1]view it on GitHub.
Summary
In LaTeX, a empty line marks the end of one paragraph and the begin of another. This rule also apply for math environments like
equation
,align
, ...Steps to Reproduce
Actual Results
Three paragraphs were created:
Expected Results
Only one paragraph was created:
Aditional information
When I use
$$
I get the correct behavior.The text was updated successfully, but these errors were encountered: