Mathics3 / mathics-django

Django front-end to Mathics
Other
102 stars 10 forks source link

Consider moving to Katex #141

Open Techcable opened 3 years ago

Techcable commented 3 years ago

Hi! Have you considered moving to Katex for your math rendering?

It's faster than MathJax and much more lightweight.

I'd be willing to help port this if you're interested :smile:

mmatera commented 3 years ago

I think it worth a try. Do you think this would requiere many changes?

TiagoCavalcante commented 3 years ago

@mmatera @Techcable currently the "interface" uses XML a lot. MathJax is XML and in the middle of MathJax there are SVGs, images and 3d graphics. But except for these exceptions, it [probably] won't be hard. Katex uses LaTeX, and Mathics produces LaTeX.

Also, I love the idea of using Katex instead of MathJax, Mathics Django formulas take too much to render and don't look good on every screen (a thing that Katex does).

Techcable commented 3 years ago

Yeah I figured it might be a good way to start contributing to the code base. I wanna help make this run faster :)

TiagoCavalcante commented 3 years ago

Here MathMLForm needs to be replaced with TeXForm. We also need to add a tag around the LaTeX commands (I suggest latex) and add 2 more ifs to mathics.js (here and here).

rocky commented 3 years ago

I think it worth a try too.

rocky commented 3 years ago

I should mention something when working with TeXForm. There is a bit of unfinished and incomplete work here. If you look at the mathics scanner project , you will find a in the character tables a number of symbols that have been marked with their AMSLaTeX symbols, for example this one for alpha.

We haven't done a complete job in adding all of the translations in that YAML file yet. Worse, we are not currently using any of this when going to TeXForm.

Not a big deal or conceptually difficult, just a lot of details that haven't been filled in yet.