0

In the tableofcontents chapters and sections in the backmatter are pointing to chapters and sections in the mainmatter. Interestingly this is not the case with the book class. Do I have a misconception on backmatter and tableofcontents?

.tex

\documentclass{scrbook}
\usepackage{hyperref}
\begin{document}

\frontmatter
\tableofcontents
\chapter{Chapter}

\mainmatter
\chapter{Chapter}
\section{Section}
\subsection{Subsection}

\backmatter
\chapter{Backmatter Chapter}
\section{Backmatter Section}
\subsection{Backmatter Subsection}

\end{document}

.toc

\contentsline {chapter}{\nonumberline Chapter}{iii}{chapter*.2}%
\contentsline {chapter}{\numberline {1}Chapter}{1}{chapter.1}%
\contentsline {section}{\numberline {1.1}Section}{1}{section.1.1}%
\contentsline {subsection}{\numberline {1.1.1}Subsection}{1}{subsection.1.1.1}%
\contentsline {chapter}{\nonumberline Backmatter Chapter}{3}{chapter*.3}%
\contentsline {section}{\numberline {1}Backmatter Section}{3}{section.1.1}%
\contentsline {subsection}{\numberline {1.1}Backmatter Subsection}{3}{subsection.1.1.1}%
\providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file 

1 Answer 1

2

You get warnings about duplicated destination names in the log. You need to make them unique, e.g.

\documentclass{scrbook}
\usepackage{hyperref}
\begin{document}

\frontmatter
\tableofcontents
\chapter{Chapter}

\mainmatter
\chapter{Chapter}
\section{Section}
\subsection{Subsection}

\backmatter\renewcommand\theHsection{backmatter.\thesection}
\chapter{Backmatter Chapter}
\section{Backmatter Section}
\subsection{Backmatter Subsection}

\end{document}
2
  • Thanks @ulrike-fischer . Having to make things like \backmatter\renewcommand\theHsection{backmatter.\thesection} made me think, that I have a misconception about the backmatter. It seemed unlikely, that Markus Kohm implemented it in a way, that I have to add this line. And if that is the way to do it makes me wonder why he implemented it this way. Any ideas about that? Jan 19, 2021 at 23:00
  • 2
    I wondered about it too, but I can't see anything adapting the hyperref numbering. On the other side: if is rather unusual to have numbered sections below an (unnumbered) chapter in the backmatter. Normally one use \appendix and for this the link works fine. Jan 19, 2021 at 23:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .