Last active
April 29, 2018 21:46
Demonstration of creating automatically-numbered equations in RMarkdown documents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At the top of your R markdown, beneath the yaml title block, add the following `<script>` section | |
--- | |
<script type="text/x-mathjax-config"> | |
MathJax.Hub.Config({ | |
TeX: { | |
equationNumbers: { | |
autoNumber: "all", | |
formatNumber: function (n) {return n} | |
} | |
} | |
}); | |
</script> | |
Then insert your displaymath equations normally: | |
$$g(x) = \int f(x) \mathrm{d}x$$ | |
To prevent numbering, use the `\nonumber` switch | |
$$g(x) = \int f(x) \mathrm{d}x\nonumber$$ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment