In the "normal" classes one can remove the TOC title (the "Content" heading) with
\renewcommand\tableofcontents{\@starttoc{toc}}
But when I do this on KOMAScript classes (e.g. scrartcl
) this also changes some other settings (e.g. vertical spaces) of KOMAscript which I don't want to change.
How can I remove only the table of contents' headline without changing anything else?
Note: I don't want the line to be empty (so, not an empty string ""
, like \renewcommand{\contentsname}{}
would do), but so that the headline is not there at all and the space gets "freed".
Best Answer
Using the
\phantom
command provides help here: It acts and uses the box for the\contentsname
content, as if it would be present, but outputs an empty box with the correct dimensions.However, the original
\contentsname
content has to be stored via a\let
command to some other macro, before it can be redefined.The 'same' code without
\renewcommand
provides the\contentsname
above, without vertical shift.After some misunderstandings the solution seems to be the
\deftocheading{toc}{}
approach, a somewhat hidden command in the manual ;-)