2
votes

I am using the bookdown to write a book. I've defined the documentclass as book. Everything seems to be working correctly - the Table of Contents, List of Tables and List of Figures along with an Appendix, Bibliography and Index. However, in my index.Rmd file I lead off with a Preface section that is not numbered. So, this first "Preface chapter" is marked with a level-1 heading # Preface {-}. The Preface is listed correctly in the Table of Contents as an unnumbered Chapter. However, on the page following the "Preface chapter" the heading at the top of the page still says "List of Figures". So, somehow the chapter heading is being held over and repeated from the List of Figures and not being updated with the "Preface chapter" heading. This "List of Figures" heading stays the same until I get to the next chapter (technically the second chapter) which is numbered, then the rest of the page headings are correct for the rest of the book.

I'm a bit of a LaTeX newbie, so I'm sure there is some option or setting I'm missing. Do I need to add some special LaTeX command or Pandoc argument to make sure that the page headings are aligned with every chapter - both numbered and unnumbered?

Any suggestions are much appreciated. My relevant YAML settings and TEX commands are listed below.

_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 - relevant section of YAML

documentclass: book
bibliography: [manual.bib, packages.bib]
biblio-style: apalike
link-citations: yes
lot: true
lof: true
1
Have you seen these answers?RLesur

1 Answers

1
votes

Since pandoc passes LaTeX commands through you could use

# Preface {-}
\markboth{Preface}{}

(c.f. https://tex.stackexchange.com/questions/89914/chapter-name-in-the-header-with-chapter)