roniemartinez / latex2mathml

Pure Python library for LaTeX to MathML conversion
MIT License
183 stars 25 forks source link

bad presentation of \sum #288

Closed retsyo closed 2 years ago

retsyo commented 2 years ago

when the result of

s = r"\sum_{i=1}^{10}\frac{ \large \sigma_{zp,i}}{E_i} kN"

convert_to_mathml(s)

is copied into MS Word, we can find that there is an extra dotted-line block after the \sum symbol

is it a bug?

mathml

retsyo commented 2 years ago

my bad, it should be

r"\sum_{i=1}^{10}{\frac{\sigma_{zp,i}}{E_i} kN"
retsyo commented 2 years ago

sorry to re-open should \sum_{i=1}^{10}\frac{\sigma_{zp,i}} {E_i} kN mean mathml

now it is mathml

retsyo commented 2 years ago

the same thing happens on

\int_{1}^{5}x\mathrm{d}x
\prod_{j=1}^{3} y_{j}
\lim\limits_{x \to 0} \frac{a^x}{b+c}
roniemartinez commented 2 years ago

Closing this for now as I cannot see any difference between latex2mathml output and MathJax.

the same thing happens on

I wrote a separate ticket in https://github.com/roniemartinez/latex2mathml/issues/301

image

retsyo commented 2 years ago

the problem can be solved easily: use {} to embrace every item, for example, we do not use

\int_{1}^{5}x\mathrm{d}x   

\prod_{j=1}^{3} y_{j}   

\lim\limits_{x \to 0} \frac{a^x}{b+c}  

but use

\int_{1}^{5}{x}\mathrm{d}x
\prod_{j=1}^{3} {y_{j}}
\lim\limits_{x \to 0} {\frac{a^x}{b+c}}

CodeCogsEqn