Forum How do I...?

What are the "best practices" (lousy phrase) for math, code formatting, charting, etc?

chrisryland
I have scanned a lot of the history in these fora and get the impression that things like MathJax "sort of" work for math?

How about for code formatting? It sounds like Prism.js does work for people?

What about charting libraries?

It does sound like all these need to be run with Javascript enabled, but do they all require double passes?

Any advice gratefully received.
mikeday
It's difficult to answer this as JavaScript libraries are moving targets, regularly depending on new browsers features that we have to scurry to implement. Prince 16 supports more es6 features, but there are still limits on DOM support and reflow that can break charting libraries trying to size their content.

I don't think any of these libraries will use Prince multipass conversion out of the box, but it might be something that can be applied manually with wrapper scripts in some cases?

Mostly it requires trying each library and seeing what happens: if there is a clear error message then that gives us something to go on, but if it just mysteriously fails to render then more work is required.
chrisryland
Thanks, Mike, for that.

What you say makes perfect sense, but I thought maybe enough people had tackled each of these library issues in the past that there might be a consensus...
mikeday
We have just updated the compatibility script for MathJax 3.1.4 and tested it with Prince 16:

https://github.com/yeslogic/prince-scripts/tree/master/compatibility/MathJax
chrisryland
Wow, fantastic -- thanks, Mike!
yyang
Hello Mike, could you check if there's any improvement to this issue? From what I see, Prince works almost perfectly with KaTeX v0.16.9. The only major issue is that all spacing is moved to the left (as noted by @ldbeth). As a result, an inconvenient two-pass processing is still required.