Here is a
that you can use to see how MiniLaTeX works. Many thanks to the
MathJax team for getting me over some rough spots.
MiniLaTeX is a subset of LaTeX that can be rendered in the browser
or in the usual way with tools like pdflatex.
The MiniLaTeX processor renders MiniLaTeX source text into HTML;
then hands the HTML to MathJax to render mathematical text
of the form $ ... $ and $$ ... $$.
There are several parts to the MiniLaTeX processor -- a parser, a renderer,
technical details on this setup. The parser, which is written in Elm, is the
key element. Just over 300 lines long, it is built on the notion of a LaTeX expression
type LatexExpression
= LXString String
| Comment String
| Item Int LatexExpression
| InlineMath String
| DisplayMath String
| Macro String (List LatexExpression)
| Environment String LatexExpression
| LatexList (List LatexExpression)
MiniLaTeX is still under development -- I would very much appreciate any feedback so
as to get it in good shape for a 1.0 release. That said, it is in good enough shape to handle
.