[英]Inputenc/Pandoc error when knit to Pdf on Rstudio Version 0.98.994
将Rmd文档编织为pdf时出现错误。 这是导致错误的代码部分。
```{r chunk5 ,echo=F}
hypoconf<-function(z){if(z=="dose"){
cat(paste(as.character(1),"\b. If there is no difference in
tooth growth for" ,z, "of",as.character(20),"and"
as.character(10),"the probability of seeing the
observed or more extreme outcome is", as.character(30),"percent."))
cat("\n\n")
}
hypoconf("dose")
```
编织为pdf时会引发以下错误。
output file: report2.knit.md
pandoc: Error producing PDF from TeX source.
! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `utf8'.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.260 \end{verbatim}
Try running pandoc with --latex-engine=xelatex.
Error: pandoc document conversion failed with error 43
Execution halted
当我编织到html时,我没有得到相同的错误。 另外,我发现错误源是代码中的退格\\b
和换行\\n
字符。 但是我找不到解决这个问题的方法。
在r代码块中使用tidy =F
选项似乎为我消除了错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.