问题
I had an R markdown document that was working perfectly until I added a caption with latex math. Now I get the error:
! Argument of \reserved@a has an extra }. \par l.75 \end{verbatim}}
pandoc: Error producing PDF from TeX source Error: pandoc document conversion failed with error 43 Execution halted
The code below produces the error in Rstudio, Version 0.99.896, using knitr with pdflatex. Thanks!!
---
title: Title goes here
author: Names go here
date: "\today"
output:
pdf_document:
fig_caption: yes
---
Some stuff goes here
```{r ex1, echo=FALSE, fig.height=3, fig.cap="The sampling distribution of $\\beta_1$."}
curve(dnorm(x))
```
Some more stuff goes here...
来源:https://stackoverflow.com/questions/37216390/r-markdown-error-resulting-from-math-in-figure-caption