1

我正在尝试编写一本书,共有 9 章。我为此使用了 bookdown::bookdown_site 包,我已将其包含在 index.Rmd 的 YAML 标头中。但是当我使用 bookdown::tufte_book2 编织这本书时,pdf 文件会在块内生成具有不同字体颜色的文本。

当我尝试使用“tufte_handout”单独运行每一章时,结果符合预期。正文和内部块文本是单色和 TimesNewRoman。在 rStudio 中,在构建本书之前,我尝试在 Sweave/Program 默认中同时使用 Latex 引擎“xeLaTex”和“pdfLaTex”

index.Rmd 中的 YAML 标头

---
title: "Operations Research Using R<br />"
author: "Timothy R. Anderson"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
monofont: Times New Roman
highlight: monochrome
documentclass: book
bibliography: ["Master4Bookdowns.bib"]
---

每个单独的 ChapterX.Rmd 文件中的 YAML 标头:

---
title: 'Chapter 3: More LP Models'
header-includes:
- \usepackage{longtable}
- \usepackage{caption}
monofont: Times New Roman
output:
  tufte::tufte_handout:
    citation_package: natbib
    latex_engine: xelatex
    toc: TRUE
    number_sections: true
    highlight: monochrome
  tufte::tufte_html: default
  tufte::tufte_book:
    citation_package: natbib
    latex_engine: xelatex
    highlight: monochrome
---

我希望所有文档都具有相同的字体类型和单色。

4

1 回答 1

0

由于bookdown::tufte_book2未在您的主 YAML 标头中指定,我假设您有一个_output.yml定义输出格式的文件。在这种情况下,您必须在此处添加highlicht: monochrome,即:

bookdown::tufte_book2:
  highlight: monochrome
  [other options]
于 2019-05-28T08:57:08.690 回答