# How to use unnumbered chapters with KOMA-script?

I am having some issues with the hyperref package. I would like to create a Introduction chapter without a number so I use \chapter*{Introduction} and \addcontentsline{toc}{chapter}{Introduction} because I want it in the table of contents (see example).

But then the link in my PDF viewer gets it wrong and also the automatically created header is no longer correct (see picture). The table of contents shows the right page number (p.1) but the link is also wrong.

What is my mistake here?

\documentclass{scrbook}

\usepackage{hyperref}
\usepackage{blindtext}
\usepackage{glossaries}
\makeglossaries

\newacronym{eg}{e.g.}{%
for example
}

\begin{document}

\frontmatter

\chapter*{Abstract}
\blindtext

\tableofcontents

% chapter with acronyms
\cleardoublepage \phantomsection
\printglossary[type=\acronymtype]

\cleardoublepage
\mainmatter

\phantomsection
% \chapter{Introduction} % with this everything is correct but I don't want the number
\chapter*{Introduction}

\blindtext

\pagebreak

\blindtext

% first chapter
\chapter{Chapter1}

\gls{eg}
\blindtext

\pagebreak

\blindtext

\end{document}


• Looking for addchap? – Johannes_B Jul 29 '14 at 14:08
• See also One chapter without numeration – Johannes_B Jul 29 '14 at 14:14
• Seems like I do ;). Thanks a lot. Should \addcontentsline not be used in the KOMA-Scripts or what is the problem here? – Lukas Jul 29 '14 at 15:13
• You can use \addcontentsline but you have to take care of all the rest yourself. KOMA takes care of it with \addchap so it is reallly useful. – Johannes_B Jul 29 '14 at 15:15
• It should be noted that \hyperref redefines the \contentsline macro to use 4 args instead of 3. – John Kormylo Jul 29 '14 at 15:36

KOMA-Script provides very powerful commands for almost every possible situation. As you noticed, the headers were showing the previous chapter and hyperlinks didn't work properly when using \chapter* along with addcontentsline.

The command \addchap takes care of this. It adds the unnumbered chapter to the table of contents, it sets \markboth accordingly. Additionally it makes sure that hyperlinks are set the right way, it even ensures, that there is the small chapter gap in the list of figures and list of tables.

If, for some reason, you want a different toc-entry, just use the optional command like you are used to.

If you want the unnumbered chapters to be indented as if there were a number, use the documentclass option toc=indentunnumbered. This will have an effect on every chapter that has been set with the documented addxcontentsline (or any higher-level) command. Of course, using \addchap is the way to go.

There is a starred variant as well which does not create a toc-entry and clears the head. This way, the header of the previous chapter is gone.

Commands to be used for unnumbered sections are provided as well, those are \addsec (with its optional argument) and \addsec*.

\documentclass{scrbook}
\usepackage{blindtext}
\usepackage{hyperref}
\newcommand{\filler}{\blindtext[7]}
\begin{document}
\tableofcontents
\filler
\filler
\chapter{Chapter}
\filler
\filler
\end{document}


The standard classes do not provide those commands, but one can easily implement the basic funtionality as is described in How to deal with unnumbered chapters?

As pointed out by Johannes_B in the comments using

\addchap{Introduction}


\chapter*{Introduction}