Skip to content

Commit

Permalink
no longer need to configure MathJax due to yihui/hugo-lithium@2838faa
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Jul 13, 2017
1 parent 5e3ead4 commit 8530964
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
8 changes: 0 additions & 8 deletions exampleSite/content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ There are two layout files under `layouts/partials/` that you may want to overri

```html
<script src="//yihui.name/js/math-code.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
}
});
</script>
<script async src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/post/2016-02-14-hello-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are many differences in syntax between Blackfriday's Markdown and Pandoc's
- [ ] ...
- [ ] Profit!

Similarly, Blackfriday does not support LaTeX math and Pandoc does. I have added the MathJax support to this theme ([hugo-xmin](https://github.com/yihui/hugo-xmin)) but there is a caveat for plain Markdown posts: you have to include math expressions in a pair of backticks (inline: `` `$ $` ``; display style: `` `$$ $$` ``), e.g., `$S_n = \sum_{i=1}^n X_i$`.^[This is because we have to protect the math expressions from being interpreted as Markdown. You may not need the backticks if your math expression does not contain any special Markdown syntax such as underscores or asterisks, but it is always a safer choice to use backticks. When you happen to have a pair of literal dollar signs inside the same element, you can escape one dollar sign, e.g., `\$50 and $100` renders "\$50 and $100".] For R Markdown posts, you do not need the backticks, because Pandoc can identify and process math expressions.
Similarly, Blackfriday does not support LaTeX math and Pandoc does. I have added the MathJax support to this theme ([hugo-xmin](https://github.com/yihui/hugo-xmin)) but there is a caveat for plain Markdown posts: you have to include math expressions in a pair of backticks (inline: `` `$ $` ``; display style: `` `$$ $$` ``), e.g., `$S_n = \sum_{i=1}^n X_i$`.^[This is because we have to protect the math expressions from being interpreted as Markdown.] For R Markdown posts, you do not need the backticks, because Pandoc can identify and process math expressions.

When creating a new post, you have to decide whether the post format is Markdown or R Markdown, and this can be done via the `rmd` argument of the function `blogdown::new_post()`, e.g.

Expand Down
8 changes: 0 additions & 8 deletions exampleSite/layouts/partials/foot_custom.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<script src="//yihui.name/js/math-code.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
}
});
</script>
<script async src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>

<script async src="//yihui.name/js/center-img.js"></script>

0 comments on commit 8530964

Please sign in to comment.