4

Is it possible to place a footnote on the Contents heading that is generated at the head of a table of contents? (Not on an individual item in the table of contents, as discussed here.)

I thought perhaps titletoc would permit this, but I see nothing about footnotes in the docs for that package.


Edit: I am using document class scrbook (needed for \multiplefootmarker, since the author's notes use numbers, while the editor's notes use * and other symbols). It is the editor who needs to annotate the Contents title.

1
  • What document class are you using?
    – egreg
    Dec 28, 2012 at 20:33

2 Answers 2

5

1. book class

Method 1 — Define a new command

The \ftableofcontents command wants as argument the text of the footnote.

\documentclass{book}
\usepackage{xpatch}

\newcommand\ftableofcontents{\renewcommand\ftableofcontents[1]}
\expandafter\ftableofcontents\expandafter{\tableofcontents}
\xpatchcmd\ftableofcontents
  {\contentsname}
  {\contentsname\footnote{#1}\fi}{}{}
% Omit the following lines if you want the footnote with an arabic number
\xpretocmd\ftableofcontents{\begingroup\renewcommand\thefootnote{\fnsymbol{footnote}}}{}{}
\xapptocmd\ftableofcontents{\endgroup}{}{}

\begin{document}
\frontmatter
\ftableofcontents{This is the footnote}

\mainmatter
\chapter{A chapter}
\section{A section}
Here is a footnote\footnote{A}
\end{document}

Method 2 — Overload \tableofcontents

In this case we redefine \tableofcontents to accept as optional argument the text of the footnote; nothing happens if no optional argument is specified.

\documentclass{book}
\usepackage{xpatch}

\newcommand\temp{\renewcommand\tableofcontents[1][]}
\expandafter\temp\expandafter{\tableofcontents}
\xpatchcmd\tableofcontents
  {\contentsname}
  {\contentsname\if\relax\detokenize{#1}\relax\else\footnote{#1}\fi}{}{}
% Omit the following lines if you want the footnote with an arabic number
\xpretocmd\tableofcontents{\begingroup\renewcommand\thefootnote{\fnsymbol{footnote}}}{}{}
\xapptocmd\tableofcontents{\endgroup}{}{}

\begin{document}
\frontmatter
\tableofcontents[This is the footnote]

\mainmatter
\chapter{A chapter}
\section{A section}
Here is a footnote\footnote{A}
\end{document}

enter image description here

2. scrbook class

The previous methods don't work with the scrbook class and it would be very difficult to patch the commands that produce the table of contents, so a hack seems the best thing to try (apart avoiding putting a footnote to a chapter title to begin with).

\documentclass{scrbook}

\begin{document}

\frontmatter

\begingroup
\makeatletter
\protected@edef\contentsname{\contentsname\unexpanded{\footnote{%
  %%%% ADD HERE THE FOOTNOTE TEXT
  This is a footnote%
  %%%% DON'T FORGET THE FINAL %
  }}%
  \gdef\noexpand\contentsname{\contentsname}}

% Omit the following line if you want a number
\renewcommand\thefootnote{\fnsymbol{footnote}}

\tableofcontents
\endgroup

\mainmatter

3. Alternative method (all classes)

Instead of a footnote you can add some text just after the header.

\documentclass{scrbook}

\begin{document}
\frontmatter

\addtocontents{toc}{\unexpanded{\unexpanded{{%
  \itshape\footnotesize
  This is a note for the table of contents
  \par\bigskip
}}}}

\tableofcontents

\mainmatter
\chapter{A chapter}
\section{A section}

\end{document}

enter image description here

2

You could try something like this (updated (thrice) to take into account egreg remarks)

\documentclass{article}

\pagestyle{headings}

\begin{document}

\let\oldcontentsname\contentsname
\let\myif\iftrue
\def\myfootnotemark{\global\let\myif\iffalse\footnotemark}

\renewcommand\contentsname{\oldcontentsname\myif\myfootnotemark\fi}

\tableofcontents

\addtocontents{toc}{\protect\footnotetext{this is my footnote}}


\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}

\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}

\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}

\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}

\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}

\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}

\section{First}

\subsection{A}

\subsection{B}

\section{Two}

\subsection{C}



\end{document}

first page of output

7
  • If the TOC has more than one page ...
    – egreg
    Dec 28, 2012 at 21:25
  • @egreg thanks for making me address this possibility. See the updated answer.
    – user4686
    Dec 28, 2012 at 21:31
  • The footnote mark will be added also to the headers.
    – egreg
    Dec 28, 2012 at 21:35
  • @egreg see updated updated answer.
    – user4686
    Dec 28, 2012 at 21:48
  • it could be that in the code above \global\let\myif\iffalse would be better than \let\myif\iffalse, but as TeX is an experimental science for me and as it worked in my test file, I am leaving things like this ... until someone points out some flaw arising in more complicated situations.
    – user4686
    Dec 28, 2012 at 21:59

You must log in to answer this question.

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