My first question is how to add the chapter or appendix prefix in the table of contents of scrbook class instead of the its default appearance.

For example, in the figure below, I want to change the chapter entry in TOC to Chapter 1. Introduction.

and the same goes for the appendix entry in TOC, which means typesetting Appendix A. Electro... instead of the figure below.

Additionally, I have used \appendix before starting my appendices, so it treats all the subsequent chapters as chapters A, B, etc. However, I want to treat them as appendices to appear correctly in the page headings as "Appendix A. Electro..." instead of "Chapter A. Electro..." in the page heading as shown below.

enter image description here

Thanks in advance


Your first question can be solved by using the tocstyle-package included in the KOMAscript-bundle. Try

 texdoc tocstyle

at an command prompt to see the documentation.

By redefining some internal variables, if I understand your question correctly, you will have the answer to your first question. Put this commands in your preamble:

  \addtocentrydefault{chapter}{\chapapp\nobreakspace #1}{#2}%

Your second question was:

However, I want to treat them as appendices to appear correctly in the page headings as "Appendix A. Electro..."

This be solved by using the class-option chapterprefix=true or appendixprefix=true, if I understand your question correctly.

A complete MWE, which (hopefully) solve all questions:

  \addtocentrydefault{chapter}{\chapapp\nobreakspace #1}{#2}%





If you are using \chapter in \fronmatter, remember to use the starred version to avoid a Chapter . with empty number in your Table of Contents. Also, if you are using the command \addchapin you document, use the starred version (\addchap*}.

For further reading, see page 80 in the English manual, and this discussion at the KOMAscript homepage.

NB! This code needs a recent version of komascript.

  • Thanks for help, but the MWE doesnt work and I got this "! LaTeX Error: \addchaptertocentry undefined." – Diaa Jul 7 '12 at 1:32
  • Strange, The MWE works on my system (updated MikTeX on Win 7). What is your version of koma-script? – Sveinung Jul 7 '12 at 7:44
  • After updating the Miktex 2.9 packages, the same error appears. Regarding the Koma version, here is the line from log file: Document Class: scrbook 2010/09/17 v3.07 KOMA-Script document class (book – Diaa Jul 7 '12 at 18:12
  • @Diaa Current version of komascript is 3.11a. My scrbook reports: scrbook 2012/05/15 v3.11 KOMA-Script document class (book). If your miktex that does not update your packages correctly, or maybe you have a copy of scrbook in your texmf-local (or whatever you have named your private TeX directory). The code need a recent version of komascript. – Sveinung Jul 7 '12 at 20:22
  • 1
    I fixed it by removing the option "bibliography=totoc" and inserting "\addcontentsline{toc}{chapter}{References}" after \bibliography{<bibfile.bib>}. If available, can you tell me why does this awkward entry appear in case of using the class option ? – Diaa Jul 9 '12 at 0:36

Thanks to the answer of the question \chaptername is used even for appendix chapters in ToC

the syntax of


has a successful result in prefixing the chapters entries in TOC with the word "Chapter" (same for appendices).

For the running headings in the in the appendices environment, the following syntax changes

Chapter to Appendix


\renewcommand{\chaptermark}[1]{\markboth{Appendix\ \thechapter.\ #1}{}}
\chapter{Appendix A}
\chapter{Appendix B}


Here is a suggestion that also works if you use chapters in frontmatter or options like listof=totoc, listof=chapterentry or if you use \addchap.



      {\addtocentrydefault{chapter}{#1}{#2}}%<- unnumbered chapters in TOC
      {\addtocentrydefault{chapter}{\chapapp{} #1}{#2}}%<- numbered chapters in TOC


\chapter{This is a chapter in frontmatter}
  \Huge X
\caption{A table}
\addchap{This is an unnumbered chapter}
\addsec{This is an unnumbered section}


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.