R bookdown:如何更改目录标题以呈现PDF书籍

问题描述 投票:0回答:1

[我正在使用bookdown使用来自ko​​ma脚本的文档类“ scrreprt”呈现PDF图书。到目前为止,该方法仍然有效,但是该书是德语的目录中的标题为“目录”,而不是德语的“ Inhaltsverzeichnis”。

我的index.rmd的“标题”:

---
title: "Mein Buchtitel"
author: "Jens Laufer"
date: "`r Sys.Date()`"
documentclass: scrreprt
---

目录的输出看起来像这样:

enter image description here我也尝试在index.Rmd:

中添加一个preamble.tex。
---
title: "Mein Buchtitel"
author: "Jens Laufer"
date: "`r Sys.Date()`"
documentclass: scrreprt
output:
  bookdown::pdf_book:
    includes:
      in_header: preamble.tex
---

preamble.tex

\renewcommand{\contentsname}{Inhaltsverzeichnis}

但是这无济于事。

有什么想法吗?谢谢!

r r-markdown pandoc bookdown
1个回答
0
投票

您可以在YAML元数据中设置变量toc-title,例如

toc-title: "Table of Contents"

有关详细信息,请参见Pandoc手册:https://pandoc.org/MANUAL.html

© www.soinside.com 2019 - 2024. All rights reserved.