Closed ernestyao closed 10 years ago
Yep. See the R Markdown documentation. The ST package won't do syntax highlighting for LaTeX like that, but it should compile just fine with knitr.
Thanks for your reply.
But when I build the .Rmd
file, got the same latex code block in .md
file. Markdown Preview can't display it in equation form.
What else should I do? I'm using LatexTools. And I find the modification to LatexTools deals with .Rnw
file only.
Update:
I solved it myself. I misunderstood your meaning. It's the browser's job to render inline Latex instead of ST. I found a booklet here can do it: http://web.mit.edu/jcalz/Public/Reddit/mathbookmarklet.html. It works on my Mac with Safari 7.0.2.
Yeah, HTML can't handle LaTeX natively. You can use Pandoc to convert from markdown to HTML and use a template that includes MathJax or something so that it renders the LaTeX automatically when you open the file in a browser. It works natively in RStudio because that's what they do—include MathJax in the preview.
I love Rmarkdown. But sometimes I have to use latex in Rmd to write some formula. I tried like
It does not work. How can I get results like this? I don't use Rnw since I don't know latex a lot and formula are seldom in my paper. Thanks in advance.