簡體   English   中英

在Rstudio 0.98.994上編織到Pdf時出現Inputenc / Pandoc錯誤

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM