![](/img/trans.png)
[英]Error 43 while knitting a r markdown to pdf on rStudio on Windows
[英]Error in creating PDF file from R Markdown (Failed with error 43)
我正在尝试使用R Markdown创建PDF文件。 我在运行时收到错误43。 我尝试使用R Markdown创建Word文件和HTML,效果很好。 仅PDF文件不起作用。
processing file: Test_New.Rmd
|...................... | 33%
ordinary text without R code
|........................................... | 67%
label: unnamed-chunk-1 (with options)
List of 1
$ tidy: logi TRUE
|.................................................................| 100%
ordinary text without R code
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS
Test_New.utf8.md --to latex --from
markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --
output Test_New.pdf --template/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --latex-engine /usr/local/bin/pdflatex --variable graphics=yes --variable 'geometry:margin=1in'
output file: Test_New.knit.md
dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
Referenced from: /usr/local/bin/pdflatex
Reason: image not found
pandoc: Error producing PDF
Error: pandoc document conversion failed with error 43
Execution halted
我在R Markdown上的代码如下。
---
title: "Test R Markdown"
author: "Sam Ng"
date: "September 1, 2017"
output:
pdf_document: default
html_document: default
word_document: default
---
# 1. R commands
Testing R commands
```{r,tidy=TRUE}
vector=c(1,2,3) # Create a new vector with three entries
max(vector) # Returns the maximum of a vector
min(vector) # Returns the minimum of a vector
```
我花了几个小时试图解决这个问题。 我安装了Miktex,但是由于正坐在防火墙后面而无法直接从软件包管理器中获取软件包。 我终于能够使用以下步骤解决此问题:
-fancyvrb
-framed
-microtype
-miktex-zzdb1-2.9
-miktex-zzdb2-2.9
-mptopdf
-titling
-upquote
-url
设置软件包以从本地存储库下载:“ C:\\ miktex_pkgs”。 为此,请转到:
转到“ Miktex软件包管理器”应用程序,然后通过右键单击安装以下软件包:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.