Last active
April 29, 2018 21:46
-
-
Save tomhopper/3fed738972701b4b85d3648f881b971d to your computer and use it in GitHub Desktop.
Demonstration of creating automatically-numbered equations in RMarkdown documents.
This file contains 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