79

I need to change default title of ToC. Is it possible with titlesec package? Here is my MWE:

\documentclass{book}

\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\Large\scshape}{\thechapter}{1em}{} \vspace{6pt}]

\usepackage{lipsum}


%-------------------------------------------------------------------------

\begin{document}


\newpage
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\newpage
\thispagestyle{empty}

\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont\normalfont{Author1} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author1} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author1}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}



\end{document}
  • 1
    That is not a MWE because it's far from minimal. Also you don't have to sign with your name since it automatically appears in the lower right corner of your post. – N.N. Sep 15 '11 at 8:57
  • @N.N. is it MWE now? I think I have to use {titlesec} in my preamble to show you. – kotsport Sep 15 '11 at 9:11
  • I think it's can be more minimal. Please read the link I supplied carefully. – N.N. Sep 15 '11 at 9:17
131

How you change the title of the table of contents depends on if you're using the babel package or not.

Without babel or polyglossia

You can change the name of the table of contents by redefining \contentsname as the following illustrates:

\documentclass{article}

\renewcommand{\contentsname}{Whatever}

\begin{document}

\tableofcontents

\section{Section}

\subsection{Subsection}

\end{document}

With babel or polyglossia

If you use either the babel or polyglossia package you'll have to change the name for the particular language you use with babel or polyglossia. Say that you load babel or polyglossia with english, then you do the following:

\documentclass{article}

\usepackage[english]{babel}

\addto\captionsenglish{% Replace "english" with the language you use
  \renewcommand{\contentsname}%
    {Whatever}%
}

\begin{document}

\tableofcontents

\section{Section}

\subsection{Subsection}

\end{document}

Either way you'll end up with the following result:

Title of table of contents changed to "Whatever"

  • 2
    My babel language was USEnglish; I had to change the command to \captionsUSenglish. – Jason Sep 26 '13 at 7:22
2

An alternative to N.N's solution that some might prefer if they're using the Memoir class is to redefine \printtoctitle instead of changing \contentsname directly. The reason for this is that often (and apparently by default) the ToC will list a reference to its own page within itself, and it will use \contentsname for both the ToC title and the reference, which can produce a jarring discontinuity of style with other chapter listings within the ToC.

With printtoctitle you can avoid this problem, since as described on page 147 of the Memoir manual, it's used to call \contentsname during ToC title creation, so you can shift all the formatting there instead.

Here's an example:

\documentclass[openany]{memoir}
\usepackage{memsty}

% This works well.
\renewcommand{\printtoctitle}[1]{\Huge\sffamily #1}

% This won't work well.
%\renewcommand{\contentsname}{\Huge\sffamily Contents}

\begin{document}
\tableofcontents

\chapter{Foo}

\end{document}

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.