[英]Unable to knit RMarkdown document to pdf due to Latex equation error
[英]RMarkdown / pandoc fails to knit Pdf with latex color commands
当乳胶命令(例如)时,RMarkdown无法编织PDF:
\textcolor{blue}{Character String}
在.rmd文件中。 错误输出为:
/ usr / local / bin / pandoc + RTS -K512m -RTS test.utf8.md --to乳胶--from markdown + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash --output test.pdf --template〜/ R / 3.3 / library / rmarkdown / rmd / latex / default-1.17.0.2.tex --highlight-style探戈--latex-engine / Library / TeX / texbin / pdflatex --variable graphics = yes --variable'geometry:margin = 1in'! 未定义的控制顺序。 l.105 \\ textcolor
pandoc:生成PDF时出错
错误:pandoc文档转换失败,错误43
执行停止
包含带有echo = TRUE的r代码块,例如:
```{r, echo = TRUE}
# I am a glitch
```
.rmd文件中的允许成功创建PDF文档。
如果.rmd文件中的所有r代码块均设置为echo = FALSE或等效语句,则如果存在诸如/ textcolor之类的乳胶命令,则无论使用的乳胶引擎如何,PDF文件都不会编织。 如果只有胶乳命令如\\ {开始片状}, 许多等...被使用的错误不存在。
如下所示,在YAML标头中添加了“标头包括:\\ usepackage {color}” ,解决了该问题。 但是,不清楚为什么插入“ echo = TRUE” R代码块也可以解决该问题。
---
title: "test"
output: pdf_document
header-includes: \usepackage{color}
---
有趣的是,与以前版本的R-Studio套件的,如下面看到的,列入“报头包括:\\ usepackage {颜色}”中的YAML头,并未使用的命令之前需要诸如“\\文本颜色{ .rmd文件中的“ blue} {Character String}” 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.