J.P. Le Cavalier
J.P. Le Cavalier

Reputation: 1345

Mathjax and markdown syntax conflicts in xaringan

I'm using xaringan for my presentations for a while now and I never had any issue including math equations using MathJax, but I'm currently running into a problem. Let say I want to create those simple two equations in a xaringan presentation.

---
output: xaringan::moon_reader
---

$$
a^{*}
$$

$$
a^{*} + b^{*}
$$

enter image description here

As one can see, the first one will be rendered properly by MathJax, but not the second one. I suspect this is due to some interaction between the markdown syntax and the MathJax equation (we can see that the * are gone and that the b is in italic). However, both equations render with no problem in a regular html_document.

Someone could help me render both equations in a xaringan presentation?

Upvotes: 3

Views: 531

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30184

You can write the math expressions right after $$ on the same lines, e.g.,

---
output: xaringan::moon_reader
---

$$a^{*}$$

$$a^{*} + b^{*}$$

Upvotes: 3

Related Questions