Closed RoyiAvital closed 7 years ago
Hi,
I am a bit reluctant to integrate MathJax parallel to KaTeX, because of performance, since every keystroke in markdown editor renders the whole document again and again.
I am open to be able to switch renderer s though. But first on my list is AsciiMath. Maybe I test integration possibilities of MathJax in future. Maybe also, you consider to help here .. ?
Thanks.
Hi,
Of course I meant choice between and not having them both at once. I can tell, based on my experience with StackEdit, that MathJaX can work very fast and much better then KaTeX which lack many features.
I wish I could assist. My programming knowledge is limited to MATLAB.
What about borrowing it from StackEdit?
@JohnTasto , I will give it a try. Though it seems an overkill for my needs.
All I need is mdmath
to have MathJaX support in addition to KaTeX and allow mode with spaces ($ ... $
and $$ ... $$
).
@RoyiAvital ,
just a hint ... once you integrated MathJax into https://github.com/goessner/markdown-it-texmath, having it in mdmath
also is a nobrainer.
I won't do it, as mdmath
serves my personal needs very well and other projects of mine have a lot higher priority.
thanks
@goessner ,
Had I known to to write Hello World
in JavaScript I'd would have done it.
You have many users and some of them are asking for this.
I'm a user and unfortunately not able to contribute in code.
If there was a place to contribute in PayPal money I'd contribute in that manner.
I understand KaTeX features are enough for you.
Yet many students like me need a little bit more and VS Code + mdmath
can be the perfect companion for Students doing research in the fields which require a lot of math.
Is there anything else I / Users can do to persuade you looking into it? MathJaX as opposed to KaTeX doens't need a parser. It can work on the HTML itself so integrating it might be easier?
Thank You.
@RoyiAvital:
Extensions using Mathjax: There is one referenced by @JohnTasto ... see above. Here is also a big resource where you might find something.
Parsing speed: As I already mentioned, the WebView in VSCode is rerendered on every keystroke. So the whole document has to be parsed by KaTeX/MathJax. I do not know, why you can say, that MathJax has comparable speed to KaTeX. Please go to this page and look carefully at the measured parsing time each!
Inline Math(no spaces): Please have a look at
$\pi$ and $\kappa$ cost 5$ and you get for $10 some $\psi$ and \$theta$.
versus
$ \pi $ and $ \kappa $ cost 5$ and you get for $10 some $ \psi $ and $ \theta $.
I cannot visually see in the second line, what are inline formulas and what are not. And I even cannot find reliable regular expressions, that are able to avoid interpreting ... 5$ and you get for $10 ...
as an inline formula. So I would really like to see those many already written Markdown documents without that 'no spaces' policy correctly parsed. Please read this big resource carefully to find some kind of programmers agreement, that it's best to avoid those ambiguities above by pragmatic 'no spaces' policy.
@goessner , I know the "Big Resource" page (If you see I edited it few months ago). Let me point few remarks:
$
delimiters and let it do the heavy lifting. It works perfectly for kramdown
(Used by nat GitHub Pages user), why won't it work for VS Code? It is also what's inside Jupyter Notebook used by millions. Namely in real world, this is not a real issue. $
are reserved for Math and user who wants the $
charterer will use escape - \$
. Make the LaTeX Mode
off by default and users who wants it on will change preferences. People live with in LaTeX, so for people coming from this world it will a logical and natural choice.Thank You.
@RoyiAvital: 3 last points here ... :
By rendering this page with MathJax in ~400 ms you have a very fast machine (processing about 2 keystrokes per second). My desktop computer needs ~3000 ms and my tablet computer 16000 ms for rendering this page.
Being curious about the rendering speed of StackEdit I gave it a longer Markdown document of mine. Its final output surprised me with lots of KaTeX errors ... hmmm. But you already know this.
"Let MathJaX heuristic engine make the difference. Don't try parsing it yourself, give MathJaX the HTML with the $ delimiters and let it do the heavy lifting." If you know how it should be done, why don't you do it by yourself? Hint: We don't have HTML in VSCode, but merely Markdown. Parser markdown-it
wants us to process the $'s before handing the final HTML back to the WebView of VSCode.
@goessner , As I wrote, MathJaX on StackEdit was on version v4. On v5 the developer moved to KaTeX.
I have no idea how to do integrate MathJaX into VS Code. I only know how to program in MATLAB / Python / Julia. I'm EE student (Image / Signal Processing, Machine Learning) in other field and unfortunately have no idea on the workings of VS Code.
I only managed to make MathJaX work in this project - https://github.com/mike-ward/Markdown-Edit/wiki/13.-Templates (Wiki I wrote on how to enable MathJaX). I thought VS Code would be similar (Just changing the HTML Header of the HTML Page Template).
I'm not sure the point here is to persuade you use MathJaX as clearly you're satisfied with KaTeX.
I'm just saying that for many users MathJaX will offer great advantage while the its disadvantage are something easy to live with.
So basically all I'm asking it adding:
$ ... $
(Mind the spaces) (Wrote option for \$
as in LaTeX above).Unfortunately, the only way I can support this is by testing and donation and not coding.
As written above, many engines (krmadown
/ Jupyer) chose MathJax and supporting the rendering as suggested. It seems their users (Which, profile wise, are like your extension) can handle the edge cases.
Thank You.
I'd also really appreciate having MathJax instead of (or along with) KaTeX. I can't use StackEdit anymore because of KaTeX, which doesn't support the MathJax features I need :-(
@RoyiAvital @goessner, hey guys, finally it is the day. Last time I checked, MathJax3 is now now 3-4 times faster then KaTex on my Safari according to this page mentioned by @goessner.
Can we reopen this issue? plz 🙏
Hello,
Any chance to add support for MathJax? Namely the user will be able to switch between KaTeX and MathJaX?
There are many features KaTeX lacks and MathJaX supports.
Thank You.