[英]Why "Knit to pdf" in RMarkdown throws error?
我已經在 R 中安裝了 tinytex package。 在使用 R Markdown 時,我無法編織到 pdf,即使我可以編織到 ZFC335FDC70D2FCZA76D。
我已經嘗試編織到 html,這很有效。 但是編織到 pdf 顯示錯誤。
我收到以下錯誤消息:
錯誤:無法編譯 New_Rmamrkdown.tex。 調試提示見https://yihui.name/tinytex/r/#debugging 。 有關詳細信息,請參閱 New_Rmamrkdown.log。
此外:警告消息:package 'tidyverse' 是在 R 版本 3.5.3 下構建的
執行停止
它需要一個附加的第三方軟件(乳膠),可以使用各種軟件來完成任務。 試試這個miktex 。 我在帶有RStudio的Ubuntu OS中進行了嘗試,效果很好。 安裝此軟件包,請注明它是否對您有用!
第 1 步:要解決此問題,go 到Tools
---> Global Options
---> R Studio 中的Sweave
。
Typeset LaTex into PDF using
下。LaTex Editing and Compilation
下,勾選“編譯.tex文件時使用tinytex。Apply
和Ok
。第 2 步:在 R Markdown 中,在 R 塊中安裝 tinytex
```{r}
tinytex::install_tinytex(force = TRUE)
library(tinytex)
第 3 步:在 header 塊中,鍵入 output 為:
output:
pdf_document:
latex_engine: xelatex
Select Knit to PDF
並且您的文檔應該正確編織。
如果其中任何一項有幫助,請點贊,以便更多人可以看到有效的解決方案。 干杯!!!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.