Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Math in LaTex became Inline Math in HTML/MathML #1719

Closed
rgaiacs opened this issue Oct 25, 2014 · 2 comments
Closed

Display Math in LaTex became Inline Math in HTML/MathML #1719

rgaiacs opened this issue Oct 25, 2014 · 2 comments

Comments

@rgaiacs
Copy link
Contributor

rgaiacs commented Oct 25, 2014

From W3C MathML Specification:

(The display attribute) specifies whether the enclosed MathML expression should be rendered as a separate vertical block (in display style) or inline, aligned with adjacent text.

The display="block" attribute isn't include in any LaTeX math environment.

TeX shorthand

Steps to reproduce

$ pandoc --version
pandoc 1.13.2
$ cat sample.tex 
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$x$$
\end{document}
$ pandoc -f latex -t html5 --mathml -o sample.html sample.tex 

Actual Results

$ cat sample.html
<p><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

Expected Results

$ cat sample.html
<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

LaTeX shorthand

Steps to reproduce

$ cat sample.tex 
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[x\]
\end{document}
$ pandoc -f latex -t html5 --mathml -o sample.html sample.tex

Actual Results

$ cat sample.html
<p><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

Expected Results

$ cat sample.html
<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

Equation Environment

Steps to reproduce

$ cat sample.tex 
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  x
\end{equation}
\end{document}
$ pandoc -f latex -t html5 --mathml -o sample.html sample.tex

Actual Results

$ cat sample.html                                            
<p><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

Expected Results

$ cat sample.html                                            
<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

Align Environment

Steps to reproduce

$ cat sample.tex                                                                                                
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
  x
\end{align}
\end{document}
[raniere@pupunha] /tmp/tex
$ pandoc -f latex -t html5 --mathml -o sample.html sample.tex

Actual Results

$ cat sample.html                                                                                               
<p><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mtable><mtr><mtd columnalign="right"><mi>x</mi></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
  x\end{aligned}</annotation></semantics></math></p>

Expected Results

$ cat sample.html                                                                                               
<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable><mtr><mtd columnalign="right"><mi>x</mi></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
  x\end{aligned}</annotation></semantics></math></p>
@mpickering
Copy link
Collaborator

This is my fault, I will look to fix it tomorrow.

@mpickering
Copy link
Collaborator

> .cabal-sandbox/bin/pandoc -f latex -t html --mathml 
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$x$$
\end{document}
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>x</mi><annotation encoding="application/x-tex">x</annotation></semantics></math></p>

Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants