zenorogue / l2u

commandline Latex to Unicode converter
GNU General Public License v3.0
5 stars 0 forks source link

Subscript brackets get ignored #2

Open hickman-santini opened 1 year ago

hickman-santini commented 1 year ago

When you want to subscript e.g. $O{i,T}$ the bracketed expression doesn't stay together: `$O{i,T}$` yields: 𝑂ᵢ,T

Also, \frac doesn't work (e.g. $\frac{\alpha}{\beta}$).

hickman-santini commented 1 year ago

Curious if you plan to support these! I may try to contribute myself. Thanks for making this tool. :)

zenorogue commented 1 year ago

Thanks for your comment!

As far as I know Unicode does not have a way to render the symbols you want. So complex symbols such as $\frac{\alpha}{\beta}$ are rendered by MathJax (which is used by GitHub and many other sites to render LaTeX math) as an image, not converted to Unicode.

Subscript brackets are not ignored, but again, Unicode does not seem to contain subscript capital T -- your line would work with $O_{i,t}$ for example. You can see the line mapping{"_", ...} to see what subscripts are known by l2u to exist in Unicode. So no plans to support things not supported by Unicode.

Unicode does contain some specific fraction symbols like ½. In general, there are lots of very useful symbols which are in Unicode but not yet supported (and should be very easy to add by editing the source code; the current version contains mostly the symbols which I thought about when writing it). So contributions here are welcome :)