简体   繁体   English

为什么我不能将 R markdown 编织成 PDF?

[英]Why can't I knitting the R markdown to PDF?

When I try to knit to PDF I have this error: !当我尝试编织为 PDF 时出现此错误:! Package inputenc Error: Unicode char \\u8:。 not set up for use with LaTeX. Package inputenc Error: Unicode char \\u8:。未设置为与 LaTeX 一起使用。

See the inputenc package documentation for explanation.有关说明,请参阅 inputenc 包文档。 Type H for immediate help.输入 H 以获得即时帮助。 ... ...

l.387 explained by ``gdp''。 l.387由``gdp''解释。

Try running pandoc with --latex-engine=xelatex.尝试使用 --latex-engine=xelatex 运行 pandoc。 pandoc: Error producing PDF from TeX source Error: pandoc document conversion failed with error 43 Execution halted pandoc:从 TeX 源生成 PDF 时出错 错误:pandoc 文档转换失败,错误 43 执行停止

I did includes all files in the working directory but still don't know why.我确实包含了工作目录中的所有文件,但仍然不知道为什么。

I could not comment on the previous post by scoa, but the YAML header argument misses a space and should read:我无法对 scoa 的上一篇文章发表评论,但 YAML 标头参数缺少一个空格,应为:

output:
  pdf_document:
    latex_engine: xelatex

I had a similar problem once.我曾经遇到过类似的问题。 Try installing Pandoc on your machine, reboot and try again.尝试在您的机器上安装 Pandoc,重新启动并重试。 You can download Pandoc here .你可以在这里下载 Pandoc。

Also, you'd most likely need to install MiKTeX.此外,您很可能需要安装 MiKTeX。

I hope this helps.我希望这有帮助。

This is an encoding error.这是编码错误。 The easiest way to deal with it is to add the following line in the YAML preamble of your document.处理它的最简单方法是在文档的 YAML 序言中添加以下行。

---
output:
  pdf_document:
    latex_engine:xelatex
---

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用于编织HTML与PDF的R Markdown条件 - R Markdown conditionals for knitting HTML vs PDF 问题编织 R markdown 到 pdf 与心理 ZEFE90A8E604A7C840E88D03ADB87F6 - issues knitting R markdown to pdf with psych package 编织/渲染 R Markdown 输出:我可以阻止代码在 PDF 输出中显示但允许在 HTML 输出中折叠代码吗? - Knitting/Rendering R Markdown Output: Can I prevent code from showing in PDF output but allow code folding in HTML output? 从 r markdown 编织到 pdf 时的调试问题 - Debugging problem when knitting from r markdown to pdf 在Windows上的rStudio上编织标记为pdf时出错43 - Error 43 while knitting a r markdown to pdf on rStudio on Windows 将 R_markdown 编织为 PDF 时加载命名空间出错 - Error in loadnamespace when knitting R_markdown to PDF 将 R markdown(带有 plot() 函数)编织到 PDF 会出现错误 - Knitting R markdown (with plot() function) to PDF gives error R markdown:我可以将pdf作为图像插入到r markdown文件中吗? - R markdown: can I insert a pdf to the r markdown file as an image? 在 R Markdown 中更改 ggplot2 字体:编织为 PDF 时失败(但在编织为 HTML 时失败) - Change ggplot2 font in R Markdown: fails when knitting to PDF (but not when knitting to HTML) 为什么我不能从 R markdown 中的链接下载? - Why can't I download from a link in R markdown?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM