【问题标题】:Error: pandoc document conversion failed with error 43 Windows 7 R studio错误:pandoc 文档转换失败,错误 43 Windows 7 R studio
【发布时间】:2015-01-14 11:33:45
【问题描述】:

我已经在论坛中搜索了答案,但它们似乎不起作用。

我正在使用 knitr 包在 Rstudio 中编织 pdf 文档。我正在使用 Windows 7 和 Rstudio。

pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" PA1_template.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output PA1_template.pdf --template "C:\R\Library\rmarkdown\rmd\latex\default.tex" --highlight-style tango --latex-engine pdflatex --variable "geometry:margin=1in"' had status 43 
Execution halted

谢谢,

路易斯

【问题讨论】:

  • 这对我来说仍然是坏事,包括当我尝试编织到 pdf 一个简单的 Rmd 时,它只包括 output: pdf_document 标题(前后一行有三个连字符),并且在一个新行上,单词test。
  • 在 Mac OS X Mavericks 和 rmarkdown 0.5.1 上出现同样的问题

标签: r pdf rstudio knitr


【解决方案1】:

我遇到了同样的问题,但在 Linux 上使用了最新的 rmarkdown 包和 pandoc 1.13。从本质上讲,pdflatex 似乎不适用于 pandoc 生成的输出 - 您需要用 xelatex 替换乳胶引擎 pdflatex(TeXLive 的一部分)

对于 rmarkdown,我的解决方案是编辑文件

rmarkdown/templates/tufte_handout/resources/tufte-common.def

并替换该行

\typeoutbool{pdfatex}{@tufte@pdf}

与

\typeoutbool{xelatex}{@tufte@pdf}

然后将使用 xelatex 代替 pdflatex 生成带有 rmarkdown 的 pdf

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,以下是我解决问题的步骤:

    • 在 Rstudio 中安装 devtools (install.packages(devtools))
    • 安装 rmarkdown (devtools::install_github("rstudio/rmarkdown"))
    • 修复~/R/x86_64-pc-linux-gnu-library/3.2/rmarkdown/rmarkdown/templates/tufte_handout/resources/ 中的文件 tufte-common.def 和 tufte-handout.tex

    如果 rmarkdown 安装不顺利,那么就这样做 (devtools::install_github("git://github.com/rstudio/rmarkdown"))

    在 tufte-common.def 中执行以下操作:

    • 添加这一行 \typeoutbool{xelatex}{@tufte@pdf}

    • 取消注释此行 \typeoutbool{xelatex}{@tufte@xetex}remember % 用于取消注释乳胶

    在 tufte-handout.tex 中添加以下行:

    % UTF encoding \usepackage[utf8]{inputenc}

    当我尝试编译文档时,我仍然收到以下错误(! Font \XeTeXLink@font=pzdr at 0.00002pt not loadable: Metric (TFM) file or ins talled font not found.),我通过安装texlive-fonts-recommended 解决了它:

    sudo apt-get install texlive-fonts-recommended

    【讨论】:

      【解决方案3】:

      我遇到了类似的问题。告诉 knitr 在哪里可以找到 pdf 引擎是必要的,即使我在 windows 路径上有它。这是 knitr.Rmd-document 的标题,它为我解决了这个问题:

      ---
      title: "XXX"
      author: "XXX"
      date: '2016-11-28'
      output:
        pdf_document:
          keep_tex: yes
          pandoc_args:
          - --latex-engine
          - C:/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex.exe
          toc: yes
      ---
      

      【讨论】:

        猜你喜欢
        • 2018-02-23
        • 2015-09-02
        • 1970-01-01
        • 2017-07-14
        • 2016-04-13
        • 2015-12-12
        • 2019-10-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多