我已经遇到这个问题好几次了,但是每当我尝试在 Rmd 文件中包含内联 LaTeX 和内联 R 代码时,我都会收到 Pandoc 错误 43。除了手动添加内容之外,从来没有找到解决方法R 代码本来就是。
---
title: "HW4"
date: "2/23/2018"
header-includes:
- \usepackage{amsmath}
- \usepackage{amsthm}
output:
pdf_document
---
```{r}
x_bar <- 4
```
The blue line above is the true $\lambda = 4$, and the red line is our
$\hat{\lambda}_{MLE} = \bar{x} = $ `r x_bar`.
Error:
l.192 \$ \hat{\lambda}
pandoc: Error producing PDF
Error: pandoc document conversion failed with error 43
Execution halted
将内联 R 表达式移至$
符号:
```{r}
x_bar <- 4
```
$\hat{\lambda}_{MLE} = \bar{x} = `r x_bar`$.
Rmd 输出:
Source: https://github.com/rstudio/rmarkdown/issues/385#issuecomment-77309571 https://github.com/rstudio/rmarkdown/issues/385#issuecomment-77309571
或者,将内联 R 代码保留在外面,但删除第二个代码之前的尾随空格$
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)