Use MathJax in Jekyll
Two things need to be done.
info
This page is rendered by Docusaurus; however, the syntax is for Jekyll.
Config inline mode, so we can use
$$
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [ ['$','$'], ["\\(","\\)"] ],processEscapes: true}});</script>Import MathJax: make sure use
https
<script type="text/javascript"src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>Two ways to put the latex code
User latex delimiters
\\(...\\)
or$ ... $
for inline and\\[...\\]
or$$ ... $$
for blockPut the code in
{% raw %}{%{% endraw %} raw {% raw %}%}{% endraw %}{% raw %}{%{% endraw %} endraw {% raw %}%}{% endraw %}
{% raw %}{%{% endraw %} raw {% raw %}%}{% endraw %}$$ put MathJax here $${% raw %}{%{% endraw %} endraw {% raw %}%}{% endraw %}
Style Examples
Inline
--> note that all equations between these tags will not need escaping!
$a^2 + b^2 = c^2$ --> note that all equations between these tags will not need escaping!Block
Correct way:
some text before
some text after.
some text before$$a^2 + b^2 = c^2$$some text after.Wrong way 1:
some text before some text after.
some text before $$a^2 + b^2 = c^2$$ some text after.Wrong way 2:
some text before some text after.
some text before$$a^2 + b^2 = c^2$$some text after.
Examples:
Special symbols
- $\\\{\\\}$
- $\|\|$
Indent (did not work with Docusaurus)
Must contain 0:
- How about , it was counted three times.
- : is who does not contain .
Must contain 0 and 1:
Must contain 0:
- How about , it was counted three times.
- : is who does not contain .
Must contain 0 and 1: