Highlight LaTeX errors

When LaTeX code errors out (for example, say KaTeX doesn’t support a certain command), could we have the code be in red text or be otherwise visually distinguished somehow?

My gut feeling is that KaTeX doesn’t complain, it simply ignores stuff it doesn’t recognize. I may be wrong though.

Looks like it’s requested, but they need to work on it: https://github.com/Khan/KaTeX/issues/538

The only other decent alternative I’m aware of is MathJAX. It supports more commands but is slow and less flexible compared to KaTeX.

As I’ve mentioned, I bit the bullet and have been trying KaTeX, and I have to say: I’m definitely impressed by the speed. I thought it wouldn’t matter too much, but it makes Dynalist feel so much nicer.

But… KaTeX just doesn’t cut it for me.

Can I ask you to, in typical Dynalist fashion, let the user choose which engine to use?

To responsibly answer your question, we have to dig into the MathJAX documentation a bit and see. My gut feeling is no. If I remember correctly, MathJAX tries to take care of the entire rendering process for you, unlike KaTeX which nicely gives us the right HTML to use.

Currently, KaTeX does log errors to the console at least. I was wondering if you could catch them and make the appropriate LaTeX code red in color.

1 Like

Ah, that’s good to hear. If there’s an error it should be catchable. Thanks for “catching” it for us! :wink:

1 Like