Sie sind hier

chapterhead style tableofcontents fails


I'm writing a thesis and made my own chapterhead style by modifying
\@@makechapterhead, \@@makeschapterhead and \chapterformat (see below) with KOMA-Script "scrbook" documentclass v2.9r .

% ------------------------------------------------------------------------------
\linespread{1.10} % I know I should use setspace but... well,
  %\vspace*{-.19\baselineskip} % dirty hack for alignment
      \@tempa{\ifnum \c@secnumdepth >\m@ne%
      {\hfill\raggedleft \interlinepenalty \@M
  {\parindent \z@ \setlength{\parfillskip}{\fill}\raggedleft
    \sectfont\size@chapter \MakeUppercase{#1}\par
 {\MakeUppercase{\Large\chapappifchapterprefix{\ }}
% ------------------------------------------------------------------------------

I have 2 problems:

  1. The \tableofcontents fails:

    ! Missing control sequence inserted.
    l.6 \tableofcontents

    I assume it is using \addchap and that my modifications brake something but I don't see how to resolve this. When trying this preamble with an empty document, the error is different (uh ?) and says that TeX stack exceeded... so it seems there is an infinite loop induced by my redefinitions.

  2. I would prefer if the titles made by \chapter ans those made by \addchap could be equally distant from the top of the sheet (\addchap titles should go down a bit). I tried a dirty \vspace but I don't find it a good generic solution since I'm also modifying interline spacing. Note that the misalignment is due to my huge \chapterformat , but I presume I can't simply fake a huge box in front of \addchap titles since it could break commands relying on it (as for \tableofcontents).

Thanks for your time!
Julien Thewys


  1. <latex></latex> tags added several times (see textformat information)
  2. Moved to “Anfänger braucht Hilfe”

In scrbook.cls (and other classes), the definition of \tableofcontents should contain


instead of


as bibliography and index are treated that way. This solves my first and important problem.

Could someone help me with the second ?

Bild von Markus Kohm

I'm writing a thesis and made my own chapterhead style by
modifying \@@makechapterhead, \@@makeschapterhead

This is not a good idea, because nobody ever declared, that these macros will be used in future. So you should never redefine internal macros of a class or package if you can avoid it. Packages like titlesec are existing.

And if you are changing internal macros you should know, what you are doing. But the error message shows that you don't. Nobody ever declared, that the argument of \chapter has to be something, which may be used as argument of \MakeUppercase.

BTW: \MakeUppercase gives very ugly results. Upper case words have to be letterspaced for typographical reasons. So \MakeUppercase is almost unusable.

Bild von Markus Kohm

The main point: “You should never redefine internal macros …” is still valid. But you also should not use titlesec with more or less current KOMA-Script releases. You should use the available configuration interfaces of KOMA-Script, i.e. \RedeclareSectionCommand and redefinition of \chapterlinesformat etc.

Comments for "chapterhead style tableofcontents fails" abonnieren