christianp / asciimath2tex

JavaScript library to convert AsciiMath to TeX
Apache License 2.0
70 stars 16 forks source link

Differences in symbols between asciimath2tex and asciimathml #32

Open GiovanniSalmeri opened 1 month ago

GiovanniSalmeri commented 1 month ago

After making a complete PHP port of both asciimathml and asciimath2tex (I have used them in an extension for the CSM Yellow) I did a thorough comparison of the symbols supported by the latest version of each one. Just in case you find it useful, here are the results. I list also some symbols that I plan to add to both ports (they come almost all from the issues of asciimathml).

In AsciiMathML but not in AsciiMath2TeX ("undocumented" means "missing in page http://asciimath.org/", which anyway seems to use an old version of the script):

mlt TeX: ll
mgt TeX: gg
~ TeX: sim (undocumented)
-+ TeX: mp (undocumented)
TeX: left( (undocumented, = ()
TeX: right) (undocumented, = )) TeX: left[ (undocumented, = [) TeX: right] (undocumented, = ]) overarc TeX: overparen

In AsciiMath2TeX but not in AsciiMathML:

boxempty (= square)
lceil (= lceiling)
rceil (= rceiling)
lbrace (= {) rbrace (= }) Sqrt TeX: Sqrt (\Sqrt seems not to exist in TeX...)

Symbols that I plan to add:

!sub TeX: notsubset
!sup TeX: notsupset
!sube TeX: notsubseteq
!supe TeX: notsupseteq
!-= TeX: notequiv
'' TeX: dprime
''' TeX: trprime
hbar TeX: hbar
underarc TeX: underparen
rm TeX: mathrm
h TeX: h (function, like f and g)
P TeX: P (function, like f and g)

christianp commented 1 month ago

Thanks for this. My intention is to stick as close to the documented syntax and commands of asciimathml as possible.

I think Sqrt is a bug.

If asciimathml accept your additions, I'll take them too.