【问题标题】:How do I stop rstudio bookdown from trying to generate pdf如何阻止 rstudio bookdown 尝试生成 pdf
【发布时间】:2018-09-05 17:51:42
【问题描述】:

我正在使用 Rstudio 生成带有 bookdown 的文档。不幸的是,我必须使用 Windows 并且没有 xelatex。

如何阻止 bookdown 尝试生成 compile_main.tex?

我只想要 HTML

我只想知道在 index.Rmd 文件的 YAML 标头中放入什么以仅选择 HTML 作为输出格式。似乎 list this 应该在 output: part 中,但我没有在 Yihui 的书中找到这个问题。

Error: Failed to compile _main.tex.
In addition: Warning message:
running command '"xelatex" -halt-on-error -interaction=batchmode "_main.tex"' had status 127 
Please delete _main.Rmd after you finish debugging the error.
Execution halted

Exited with status 1.

【问题讨论】:

  • 除了下面的正确答案:您可以使用 tinytex 包轻松安装包含 xetex 的 TeX 安装。
  • 我尝试了 install.packages('tinytex') tinytex::install_tinytex() 但安装尝试从我的管理员限制的站点下载。我要求打开网站。我刚刚又试了一次。它似乎奏效了。 tinytex:::is_inytex() > TRUE 。这是一个奇迹!

标签: r yaml rstudio bookdown


【解决方案1】:

虽然我不确定你指的是哪一本书,但one of his works确实详细解释了如何设置YAML以获取.html的输出。

我也放了我的例子,JFYI。

---
title: "Your title"
author: "Your name"
date: "The date when you wrote the document"
output: 
  bookdown::html_document2:
    toc: yes #if you want to get the table of contents
    fig_caption: true
bibliography: Your-bibliography.bib # Specify if you have any bib format, such as `.bib`, `.enl`, .etc.
always_allow_html: yes
editor_options:
  chunk_output_type: console
---

【讨论】:

  • 简单地说:bookdown 不会产生 PDF 输出,如果没有在 YAML 标头的 output 部分指定 PDF 输出,这可能在 _output.yml 文件中。
猜你喜欢
  • 1970-01-01
  • 2019-10-25
  • 1970-01-01
  • 2018-10-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-25
相关资源
最近更新 更多