Browse code

Add MathJax AsciiMath support

Robert Cranston authored on 12/06/2020 14:58:36
Showing 2 changed files

... ...
@@ -15,7 +15,19 @@ To make this the default HTML template, symlink (or rename)
15 15
 one you need to use [`--standalone`][].
16 16
 
17 17
 Options you probably want include [`--toc`][], and perhaps
18
-[`--toc-depth`][]`=6`. Another nice option is [`--mathjax`][].
18
+[`--toc-depth`][]`=6`. Another nice option is [`--mathjax`][], which can take a
19
+URL. The pandoc default is something like the TeX only
20
+
21
+```
22
+https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_CHTML-full
23
+```
24
+
25
+to also have AsciiMath available (with `%%` delimiters) use instead something
26
+like
27
+
28
+```
29
+https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML-full
30
+```
19 31
 
20 32
 [pandoc]: https://pandoc.org
21 33
 [template]: https://pandoc.org/MANUAL.html#templates
... ...
@@ -175,6 +175,9 @@ $endfor$
175 175
 </script>
176 176
 <script type="text/x-mathjax-config">
177 177
   MathJax.Hub.Config({
178
+    asciimath2jax: {
179
+      delimiters: [['%%', '%%']],
180
+    },
178 181
     TeX: {
179 182
       equationNumbers: {
180 183
         autoNumber: "AMS",