2

When using the article document class, I can customise the title of the table of contents like so:

\documentclass{article}

\renewcommand{\contentsname}{Whatever}

\begin{document}

\tableofcontents

\section{Section}

\subsection{Subsection}

\end{document}

As expected, the title of the table of contents is now "Whatever". However, if I change the first line to use the scrartcl document class

\documentclass{scrartcl}

then I'm back to the default "Contents" as the title. I've looked through the KOMA-Script user guide, and it seems like this should still work. I read section 12.4, "Defining Language-Dependent Terms", but a) I didn't understand how to use it, and b) I'm not trying to do anything language-dependent.

Is there a different/better way to do this in document classes that use KOMA-Script?

I'm using xelatex, if it matters.

2
  • 1
    According to tex.stackexchange.com/questions/539972/… you should move \renewcommand{\contentsname}{Whatever} below \begin{document}.
    – Marijn
    Sep 9, 2022 at 20:25
  • 1
    It's scrartcl, by the way. You should do \AtBeginDocument{\renewcommand{\contentsname}{Whatever}}
    – egreg
    Sep 9, 2022 at 21:24

1 Answer 1

1

You can use the KOMA commands like this:

\documentclass{scrartcl}

\defcaptionname{\languagename}{\contentsname}{Whatever}

\begin{document}

\tableofcontents

\section{Section}

\subsection{Subsection}

\end{document}

enter image description here

You must log in to answer this question.

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