-
Notifications
You must be signed in to change notification settings - Fork 0
/
mathjax.qmd
25 lines (21 loc) · 1.24 KB
/
mathjax.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# MathJax
[MathJax](https://www.mathjax.org/) is the javascript library that turns your LaTeX code into pretty html. It knows AMS math but it doesn't turn on numbering by default (weirdly). You need to set some config to do that. The way you set configuration is totally different for MathJax 2+ and MathJax 3+. MathJax 2.7 is ancient but it's all over the place where developers have hard-coded in a MathJax library. The `mathjax.hmtl` file below will set the config for both MathJax 2.7 and MathJax 3+ numbering. It doesn't seem to break things to set both so might be more robust to set configs for both versions.
*Always check what MathJax version is being used if you are having html issues. Look at the page source and search for mathjax.*
Put this in your `mathjax.html` file that you include in your `_quarto.yaml` file.
```
<!-- This is what works with MathJax 2.7 (which is ancient but all over the place) -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: {autoNumber: "AMS"} },
tex2jax: {inlineMath: [ ['$','$'], ["\\(","\\)"] ]}
});
</script>
<!-- This is what works with Quarto and MathJax 3+ -->
<script>
MathJax = {
tex: {
tags: 'ams' // should be 'ams', 'none', or 'all'
}
};
</script>
```