TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried latex code for generating toc suggested by stack exchange in response to my previous query . Still I need small modifications. In the first page of toc, At top middle “TABLE OF CONTENTS” is required and then in the second line 3 column names such as “CHAPTER NO.”, “TITLE” and “PAGE NO.” are required. In subsequent pages only the said second line particulars are required. The same applies to List of tables and List of figures. enter image description here

share|improve this question
Related question: Table of Contents with headings on every page – Werner Sep 22 '12 at 16:52
@Kurt please refer to my previous query "Table of Contents with headings on every page" and I received two solutions. Both of the two solutions works well and gives same type of output,but still small modifications are required as asked in the query " Table of Contents modifications required". I followed Werners suggestion and included the same in the class file. – vivek Sep 22 '12 at 17:21
Where do you want the titles to appear? below the title heading? – Harish Kumar Sep 22 '12 at 23:29
@HarishKumar Below the title heading.Please follow question titled "Indenting in Table of contents in new style required" as i added it with MWE. – vivek Sep 24 '12 at 15:26
up vote 6 down vote accepted

Here is a modification to Table of Contents with headings on every page that adapts the solution to the three contents elements of a report:

enter image description here

\usepackage[paperheight=30\baselineskip]{geometry}% http://ctan.org/pkg/geometry
\usepackage{tocloft}% http://ctan.org/pkg/tocloft
\usepackage{atbegshi}% http://ctan.org/pkg/atbegshi
  \begin{table}[ht]\caption{A first table}\end{table}\begin{figure}[ht]\caption{A first figure}\end{figure}
  \begin{table}[ht]\caption{A second table}\end{table}\begin{figure}[ht]\caption{A second figure}\end{figure}
  \begin{table}[ht]\caption{A last table}\end{table}\begin{figure}[ht]\caption{A last figure}\end{figure}
  \bfseries% Font selection
  %\hspace*{\cftchapindent}% Chapter indent
  \makebox[\cftchapnumwidth][l]{Chapter no}% Chapter number heading
  Title% Title heading
  \makebox[\@pnumwidth][r]{Page}% Page heading
  \par\kern.5\baselineskip% After heading
\renewcommand{\cftsecdotsep}{\cftnodots}% No dots for \section in ToC
\setlength{\cftbeforetoctitleskip}{0pt}% No skip before ToC title
\setlength{\cftaftertoctitleskip}{0pt}% No skip after ToC title
\setlength{\cftchapindent}{20pt}% Chapter indent in ToC is 20pt
\begin{lrbox}{\@tempboxa}\bfseries Chapter no\end{lrbox}
\setlength{\cftchapnumwidth}{\dimexpr\wd\@tempboxa-\cftchapindent}% Chapter num width in ToC
\setlength{\cftsecindent}{\wd\@tempboxa}% Section indent in ToC




The following modifications may still be required:

  • If you're using hyperref or bookmark, one should add the relevant information to the contents macros (\tableofcontents, \listoftables and \listoffigures). Currently they're not set as \chapter* the way they're used to.
  • Depending on where your last floats are, it may be required to use atveryend to finalize processing of floats and obtain an accurate ToC/LoT/LoF.
  • Adding the ToC/LoF/LoT to the ToC.
  • Modifying the page styles (which includes the page numbering) surrounding the ToC/LoF/LoT. Easily done using fancyhdr, if need be.
  • Additional indentation of sectional units beyond \subsection to line up properly. However, a base has been established up to \subsection which is easily extendible.
share|improve this answer
thank you very much Werner. Your solution works well and new problem arose in the indent numbering of Chapter, section ,subsection and subsubsection. Can you please refer the instructions of the university at page no.44 of 47[ANNEXURE 40] and the link is given below annauniv.edu/research1/PhDRegulations_2010.pdf The solution suggested by you gives same level of indenting for all chapters, sections, subsections and subsubsections. Also, dotted lines are not required. Please suggest. – vivek Sep 23 '12 at 4:51
@vivek: This is going to take a little while to incorporate. For future reference, include these details from the start. – Werner Sep 23 '12 at 17:14
Thanks and expecting the solution. – vivek Sep 23 '12 at 17:20
@vivek: I've added some changes. It's still not clear to me how the LoT/LoF (that doesn't have chapters) has to look with a Chapter no reference. As such, I've left it as-is. – Werner Sep 25 '12 at 6:23
Thanks Werner. The Solution works fine. i will manipulate those Chapter no. in LoT/LoF as Table no. and Figure no.Thanks. – vivek Sep 25 '12 at 10:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.