bookdown 章节标题不正确
bookdown chapter heading not correct
我正在使用bookdown
写一本书。我已将 documentclass
定义为书籍。一切似乎都在正常工作 - Table 目录、Table 列表和图表列表以及附录、参考书目和索引。然而,在我的 index.Rmd
文件中,我以一个没有编号的前言部分开始。因此,第一个 "Preface chapter" 被标记为一级标题 # Preface {-}
。 前言 在目录 Table 中作为未编号的章节正确列出。但是,在 "Preface chapter" 之后的页面上,页面顶部的标题仍然显示 "List of Figures"。因此,不知何故,章节标题被保留并从图表列表中重复,而不是用 "Preface chapter" 标题更新。这个 "List of Figures" 标题保持不变,直到我进入编号的下一章(技术上是第二章),然后其余页面标题对于本书的其余部分都是正确的。
我有点像 LaTeX 新手,所以我确定我缺少某些选项或设置。我是否需要添加一些特殊的 LaTeX 命令或 Pandoc 参数以确保页面标题与每一章对齐 - 无论是编号的还是未编号的?
非常感谢任何建议。下面列出了我的相关 YAML 设置和 TEX 命令。
_output.yml
bookdown::pdf_book:
includes:
in_header: preamble.tex
after_body: after_body.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
preamble.tex
\usepackage{booktabs}
\usepackage{makeidx}
\makeindex
\usepackage[nottoc]{tocbibind}
index.Rmd - YAML 的相关部分
documentclass: book
bibliography: [manual.bib, packages.bib]
biblio-style: apalike
link-citations: yes
lot: true
lof: true
由于 pandoc
通过您可以使用
传递 LaTeX 命令
# Preface {-}
\markboth{Preface}{}
(c.f.https://tex.stackexchange.com/questions/89914/chapter-name-in-the-header-with-chapter)
我正在使用bookdown
写一本书。我已将 documentclass
定义为书籍。一切似乎都在正常工作 - Table 目录、Table 列表和图表列表以及附录、参考书目和索引。然而,在我的 index.Rmd
文件中,我以一个没有编号的前言部分开始。因此,第一个 "Preface chapter" 被标记为一级标题 # Preface {-}
。 前言 在目录 Table 中作为未编号的章节正确列出。但是,在 "Preface chapter" 之后的页面上,页面顶部的标题仍然显示 "List of Figures"。因此,不知何故,章节标题被保留并从图表列表中重复,而不是用 "Preface chapter" 标题更新。这个 "List of Figures" 标题保持不变,直到我进入编号的下一章(技术上是第二章),然后其余页面标题对于本书的其余部分都是正确的。
我有点像 LaTeX 新手,所以我确定我缺少某些选项或设置。我是否需要添加一些特殊的 LaTeX 命令或 Pandoc 参数以确保页面标题与每一章对齐 - 无论是编号的还是未编号的?
非常感谢任何建议。下面列出了我的相关 YAML 设置和 TEX 命令。
_output.yml
bookdown::pdf_book:
includes:
in_header: preamble.tex
after_body: after_body.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
preamble.tex
\usepackage{booktabs}
\usepackage{makeidx}
\makeindex
\usepackage[nottoc]{tocbibind}
index.Rmd - YAML 的相关部分
documentclass: book
bibliography: [manual.bib, packages.bib]
biblio-style: apalike
link-citations: yes
lot: true
lof: true
由于 pandoc
通过您可以使用
# Preface {-}
\markboth{Preface}{}
(c.f.https://tex.stackexchange.com/questions/89914/chapter-name-in-the-header-with-chapter)