添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

For those interested why is this the case: in a normal LaTeX environment, align also enables the math environment inside, so you do not have to enclose it in $$ . However, Pandoc (which is responsible for Markdown -> Latex translation in RMarkdown) does not do that. If we surround the align environment with $$ , you will get errors like these: Package amsmath Error: Erroneous nesting of equation structures; . To get around that, you have to use aligned , which does not create another math environment inside.

Closing notes

This pretty much covers basic LaTeX usage that you may need when working in RMarkdown. Please let me know what you think and if you had any issues using LaTeX in RMarkdown in the comments!

Get new content delivered to your mailbox:

All of a sudden my Latex equations don’t appear in my Rmarkdown doc. They’ve been problem-free since I started using them years ago, but literally this morning I get nothing but a blank space where normally the eqn would appear. I shut down R and started again and it worked for maybe a second or two, then the equations disappeared again and I can’t retrieve them. Nothing else has been changed except that I tried to install both \usepackage{amsmath} (which seemed to do nothing but screw up e everything) and tinytex, also to no avail (so I removed it). Any ideas? Many thanks.

Reply

leave a comment
never mind