Skip to content

How to Change Table of Contents Placement in Quarto Book #9839

Answered by TomBener
TomBener asked this question in Q&A
Discussion options

You must be logged in to vote

I came up with an easy method to adjust the order of TOC in LaTeX:

  1. set toc: false in _quarto.yml for the PDF format.
  2. In index.qmd, write the raw LaTeX code for printing TOC after the preface. For example:
# Praface {-}

# Acknowledgements {-}

# Abstract {-}

```{=latex}
\clearpage
{
\hypersetup{linkcolor=blue}
\setcounter{tocdepth}{3}
\tableofcontents
}
```

The generated LaTeX code would be:

\bookmarksetup{startatroot}

\chapter*{Praface}\label{praface}
\addcontentsline{toc}{chapter}{Praface}

\markboth{Praface}{Praface}

\bookmarksetup{startatroot}

\chapter*{Acknowledgements}\label{acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}

\markboth{Acknowledgements}{Acknowl…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@TomBener
Comment options

@mcanouil
Comment options

mcanouil Jun 1, 2024
Collaborator

@TomBener
Comment options

@mcanouil
Comment options

mcanouil Jun 1, 2024
Collaborator

@TomBener
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by TomBener
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
latex LaTeX engines related libraries and technologies
2 participants