Implements Latex-Math Support through use of MathJax.
Changes (for detailed changes see the diff):
updated dependencies:
pulldown_cmark to get Event::InlineMath and Event::DisplayMath
local-ip-adress was updated because why not
Enabled all features of pulldown_cmark
Only ENABLE_MATH is really needed but the others won't hurt
Special Handling for the Event::InlineMath and Event::DisplayMath case.
Wrapping in <span class="math math-<?>"> (where <?> is the displaystyle) to get a more consistent styling with other supporting-latex-math versions I have done. (Those will soon-ish turn into pull requests too)
The HTML pulls MathJax as a dependency, and configures it to use $ as inline delimiters
Codegen:
only one codegen unit. This is a small project, compile times don't suffer that much but there might be a bit of optimisation to be found that way
Why this approach?
MathJax is one of the more versatile solutions. For how easy it is to integrate, it can do a lot of things, e.g. Copy Latex or MathML Code from your browser.
In Addition it can also do some other (not necessarily math) commands like \LaTeX.
It also does not rely on MathML which might not be supported by the browser.
Reasons against this:
Client side processing of the formulas. You might not want that, especially if you're downloading raw html.
Since $ is a math delimiter, some text might appear funky. See here.
If you are doing a lot of raw html inside your markdown, the MathJax Formulas might appear weird, since they can float atop of sticky-headers etc.
Implements Latex-Math Support through use of MathJax.
Changes (for detailed changes see the diff):
pulldown_cmark
to getEvent::InlineMath
andEvent::DisplayMath
local-ip-adress
was updated because why notpulldown_cmark
ENABLE_MATH
is really needed but the others won't hurtEvent::InlineMath
andEvent::DisplayMath
case.<span class="math math-<?>">
(where <?> is the displaystyle) to get a more consistent styling with other supporting-latex-math versions I have done. (Those will soon-ish turn into pull requests too)$
as inline delimitersWhy this approach? MathJax is one of the more versatile solutions. For how easy it is to integrate, it can do a lot of things, e.g. Copy Latex or MathML Code from your browser. In Addition it can also do some other (not necessarily math) commands like
\LaTeX
. It also does not rely on MathML which might not be supported by the browser.Reasons against this:
$
is a math delimiter, some text might appear funky. See here.