'Sup,
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,
General ⇒ Adding 'normal' text in TOC
NEW: TikZ book now 40% off at Amazon.com for a short time.
Adding 'normal' text in TOC
You may use the \addcontentsline and \addtocontents commands to include text in the ToC. You have many choices, depending on the format you want to give to the text. See the following example:
The fullpage package sets the page layout. You may safely remove it once fixed your own layout. The blindtext package provides the \Blinddocument and \blindtext commands, used to automatically generate text. You should replace then by your text and the corresponding commands (\section, \subsection... )
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...
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
Ah, great thanks I got it working using that method... Now the citation on the bottom half of the TOC page...
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...
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...