Knitr前同步码错误导致"pandoc文档转换失败,出现错误43". [英] Knitr preamble error results in "pandoc document conversion failed with error 43"

查看:119
本文介绍了Knitr前同步码错误导致"pandoc文档转换失败,出现错误43".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Rstudio 0.99.441版; Windows 7企业版;针织衫1.10.5; MiKTex 0.4.5 r.1280(2.9 64位)

Rstudio Version 0.99.441; Windows 7 enterprise; knitr 1.10.5; MiKTex 0.4.5 r.1280 (2.9 64-bit)

在Rstudio中尝试编织PDF时,我的办公室计算机上出现错误,编织为HTML或word时没有问题.该问题可能与更新有关,因为编织过去可以正常工作,并且我的家用计算机可以毫无问题地编织为pdf,但是我将计算机带回家进行更新,问题仍然存在.

I have a an error on my office computer when trying to knit PDF's in Rstudio, there are no problems knitting to HTML or word. The problem may be related to updates because knitting used to work fine and my home computer can knit to pdf without issue, however I took my computer home to update and the problem is still there.

我的错误消息如下 "pandoc.exe:从TeX源生成PDF时出错 错误:pandoc文档转换失败,错误43"

My error message was as follows "pandoc.exe: Error producing PDF from TeX source Error: pandoc document conversion failed with error 43"

我使用Rstudio中的模板示例创建了一个新文件,尝试进行编织,然后检查了TEX输出.我将错误追溯到序言的最后一段.

I created a new file using the template example in Rstudio attempted to knit, then inspected the TEX output. I traced the error to the last paragraph of the preamble.

\setlength{\droptitle}{-2em}
 \title{Untitled}
 \pretitle{\vspace{\droptitle}\centering\huge}
 \posttitle{\par}
 \author{user name}
 \preauthor{\centering\large\emph}
 \postauthor{\par}
 \predate{\centering\large\emph}
 \postdate{\par}
 \date{\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{14}
\itemsep1pt\parskip0pt\parsep0pt
\item
  juni 2015
\end{enumerate}}

通过删除与枚举和日期有关的最后7行,然后运行TEX代码,将文档打印为PDF.为什么会发生这种情况,我该怎么办,以便在单击Rstudio时首先编织文档?

by removing the last 7 lines to do with enumerate and the date then running the TEX code the document prints as a PDF. Why is this happening and what can I do about it so the document knits at first click from Rstudio?

推荐答案

您应该显示R Markdown文档的YAML前题.根据我的经验猜测,该错误是由

You should show the YAML frontmatter of the R Markdown document. Guessing from my experience, the error was caused by

---
date: "14. Juni 2015"
---

任何数字后跟一个句点(例如14.)将被视为编号列表中的一项.您需要在date字段中删除或转义句点.(按\\.). 相同的问题之前已经有报道.

Any number followed by a period (e.g. 14.) will be treated as an item in a numbered list. You need to either remove or escape the period . (by \\.) in the date field. The same issue has been reported before.

这篇关于Knitr前同步码错误导致"pandoc文档转换失败,出现错误43".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆