Support TeX and LaTeX math delimiters (#243)

This commit is contained in:
Cotes Chung 2021-03-09 15:50:08 +08:00
parent 6688e27787
commit d162167580
2 changed files with 20 additions and 3 deletions

View File

@ -23,8 +23,25 @@
{% if page.math %}
<!-- MathJax -->
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script defer src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>
// see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options>
MathJax = {
tex: {
inlineMath: [ // start/end delimiter pairs for in-line math
['$','$'],
['\\(','\\)']
],
displayMath: [ // start/end delimiter pairs for display math
['$$', '$$'],
['\\[', '\\]']
]
}
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
{% endif %}
{% if jekyll.environment == 'production' %}

View File

@ -147,7 +147,7 @@ The mathematics powered by [**MathJax**](https://www.mathjax.org/):
$$ \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} $$
When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$