I thought of a reason to use
@latex nodes. You could use them to help work out the details of getting the latex for your equations right. You could do this with using
..math directives with ReStructuredText also, but RsT might be adding some macro you didn't want.
With that in mind, I've got working code for Viewrendered3. The features go beyond what ViewRendered offers, but before I make a PR I'd like to get comments on them, including if I have missed something I should include:
1. Only a single node will be processed as an @latex node; the rest of a subtree will not be processed.
2. Some special characters, mainly "&", are replaced by their
HTML entities (e.g., "&") inside math blocks, but not outside. This lets you write arbitrary HTML outside math blocks. It solves the problem of not being able to format your non-math text readably;
3. The rendering can be exported to the system browser using VR3's Export toolbar button;
4. The Mathjax URL is taken from your VR3 settings, or defaults to
https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js;5. VR3 uses the text and background colors from VR3's RsT stylesheet if it can find them. This prevents unexpected changes in the appearance of the rendered pane when you switch from a non-
@latex node to an
@latex one.
Note that you should not use @language latex directives within other, non-@latex, nodes. The results are not defined, and I have not written any code to handle that situation. The limitation to a single node in Point 1 could be removed if there is enough interest.