我正在试着写一本书,有9章。为此,我使用了包含在index.Rmd的YAML头文件中的bookdown::bookdown_site包。但是,当我使用bookdown::tufte_book2编织这本书时,pdf文件在块中生成具有不同字体颜色的文本。
当我尝试使用"tufte_handout“单独运行每个章节时,结果与预期一致。正文和内部块文本是单色和TimesNewRoman。在编写这本书之前,我在rStudio中尝试过使用两个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
---我希望所有的文件都有相同的字体和单色。
发布于 2019-05-28 16:57:09
由于您的主YAML头中没有指定bookdown::tufte_book2,因此我假设您有一个定义输出格式的_output.yml文件。在这种情况下,您必须在那里添加highlicht: monochrome,即:
bookdown::tufte_book2:
highlight: monochrome
[other options]https://stackoverflow.com/questions/56297474
复制相似问题