diff options
author | Josh Dzielak <dzello@users.noreply.github.com> | 2020-04-12 05:26:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-12 05:26:32 +0300 |
commit | 86eace86b31e0e2725a9e6bc3c2c635fbd1969a0 (patch) | |
tree | 26dd8df49e008ee7e4a9d8828c3e55859e8f5eef | |
parent | a54265ad7d72123931b16f92b07c2fcffb5a3474 (diff) | |
parent | f86d9378fd585959a147ac992fc0c5a0098b674f (diff) |
Merge pull request #83 from dzello/dzello-patch-1
Document MathJax support
-rw-r--r-- | README.md | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -271,6 +271,39 @@ Markdown surrounded by the markdown shortcode will not be rendered by Hugo but b {{% /markdown %}} ``` +### MathJax support + +Add the following to `layouts/partials/reveal-hugo/body.html`: + +``` +<script> +MathJax = { + tex: { + inlineMath: [['$', '$'], ['\\(', '\\)']] + }, + svg: { + fontCache: 'global' + } +}; +</script> + +<script type="text/javascript" id="MathJax-script" async + src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"> +</script> +``` + +Then you can do this in a slide: + +``` +## Cool equations + +Displayed equations are wrapped in double-\$ + +$$\frac{n!}{k!(n-k)!} = \binom{n}{k}$$ + +Inline equations like $E=mc^2$ are wrapped in single-\$ +``` + ### HTML slides If you need to create fancier HTML for a slide than you can do with markdown, just add `data-noprocess` to the <section> element. |