Support for LaTeX-like typesetting of mathematics in XDOC topics. (experimental)
Experimental. This whole thing is experimental. Jared reserves the right to decide it is a bad idea and remove support for it.
The Khan Academy has developed a very nice Javascript library, KaTeX, for rendering mathematical formulas in the web browser. We have now integrated KaTeX into XDOC's fancy web-based viewer, allowing you to typeset basic formulas.
To typeset block-style formulas, you can use the
@([ c = \pm\sqrt{a^2 + b^2} ])
Produces an indented block of mathematics:
You can also write inline math using
The product @($a \times b$) is even.
Produces text such as: the product
The KaTeX Preview page lets you interactively type in your formula and see how it will be typeset. It may be especially helpful since KaTeX only supports a particular subset of LaTeX.
Invalid formulas will display as an ugly error message. For instance, here
is an invalid
And here is an invalid
The preprocessor directives expand into
All of this is fundamentally limited to the web-based viewer. It seems very
unlikely that