General ⇒ Adding 'normal' text in TOC
Adding 'normal' text in TOC
I've got the following issue... I really need to add some text (a citation) in the Table of Contents in my LaTeX document.
It is possible to add text in the 'List of Figures' and 'List of Tables', but so far I have not yet succeded to do this in the TOC.
Is there anyway to do this? I'm using parts of the 'Classic Thesis' template.... I've searched the web for this, but I couldnt find it.
Greets,
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Adding 'normal' text in TOC
Code: Select all
\documentclass{article}
\usepackage{fullpage}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\Blinddocument
\addtocontents{toc}{This is the text we'd like to add
to the table of contents.\par}
\addcontentsline{toc}{section}{This is an entry formatted like
unnumbered sections}
\addcontentsline{toc}{subsection}{This is an entry formatted like
unnumbered subsections}
\Blinddocument
\addtocontents{toc}{\smallskip\blindtext\par}
\Blinddocument
\addtocontents{toc}{%
\smallskip\protect\parbox[t]{0.8\textwidth}{\blindtext}\par}
\Blinddocument
\addtocontents{toc}{\protect\begin{center} \blindtext \protect\end{center}\par}
\Blinddocument
\addtocontents{toc}{\smallskip\textit{\blindtext}\par\textsc{\blindtext}\par}
\end{document}
The \addtocontents command is somewhat tricky. Some commands should be \protect'ed if they are used in the argument of \addtocontents. In the above example you can see how to include a simple line (which causes no problem), a paragraph (look at the indentation), text in a box, text centered...
Re: Adding 'normal' text in TOC
Just out of curiosity, would it be possible to place the text above the title ('Contents'), or a way to force the text outside the TOC text borders?
Thanks for the help, got me going again...