In R Markdown, I can get an inline r code chunk to run inside single $
math notation (only with a *
before), but not double $$
math notation:
* $H_o = `r 1 + 1`$
works, but:
$H_o = `r 1 + 1`$
doesn't work, and neither does:
$$H_o = `r 1 + 1`$$
The double $$
is more flexible being able to put math notation on multiple lines, but how can you add inline code chunks inside?
I ran your example and it worked fine for me! Here is a link to the pdf and github .md documents I generated. And here is a link to the rmarkdown document.
I'm using R 3.4.1, knitr 1.16, and rmarkdown 1.6.
Perhaps you should check your version of rmarkdown and knitr. I have noticed over the years that version updates, and sometimes even using the most recent dev version, can fix a litany of small issues that arise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With