fred-wang / TeXZilla

LALR Javascript LaTeX-to-MathML converter compatible with Unicode
http://fred-wang.github.io/TeXZilla/
130 stars 21 forks source link

Tilde for a non-breaking space is not supported #56

Closed cshaa closed 6 years ago

cshaa commented 6 years ago

The tilde character ~ should be treated as a non-breaking space. See the LaTeX FAQ. Original issue: josdejong/mathjs#1299

Input

x~y~z

Expected output

<mi>x</mi>
<mspace linebreak="nobreak" width="mediummathspace" />
<mi>y</mi>
<mspace linebreak="nobreak" width="mediummathspace" />
<mi>z</mi>

Actual output

<mi>x</mi>
<mo stretchy="false">~</mo>
<mi>y</mi>
<mo stretchy="false">~</mo>
<mi>z</mi>
fred-wang commented 6 years ago

TeXZilla follows itex2MML's behavior.

cc' @distler

cshaa commented 6 years ago

That means it's a wontfix? Even if it's perfectly valid LaTeX?

I use TeXZilla to render the output of math.js which depends heavily on ~.

fred-wang commented 6 years ago

Yeah, sorry. Quoting https://github.com/fred-wang/TeXZilla/wiki/TeXZilla-Commands :

"However, note that the LaTeX language is not really a standard in the strict sense. There are many LaTeX commands, macros and packages and new ones are always invented to cover the need of different communities. TeXZilla is intended to remain small and will not support all the imaginable LaTeX commands, even less those used in non-math mode. For a LaTeX-to-XML converter with a very good coverage we recommend to check LaTeXML instead. The reference LaTeX support used by TeXZilla is the one provided by itex2MML, which should cover what the majority of people need to write mathematical formulas."

Of course, your are free to fork/tweak TeXZilla to cover your needs.