10

I'm preparing my lab-report. I need to customize my ToC for this. To be specific, I need to add two extra columns to the table of contents page, viz., Date and Evaluator's signature. These columns can be entry, but i need to add them to the ToC. Can somebody help me?

doncherry
  • 54,637
Dibu John
  • 145

2 Answers2

6

It's possible with tocloft:

\documentclass[a4paper]{article}

\usepackage{tocloft}
\renewcommand{\cftsecafterpnum}{\quad\rule{1cm}{0.4pt}\quad\rule{2cm}{0.4pt}}

\begin{document}
\tableofcontents

\section{This is one}

\section{This is two}

\end{document}

enter image description here

egreg
  • 1,121,712
0

Here is a quick hack:

\documentclass[10pt,letterpaper]{article}

\usepackage{lipsum,titletoc}

\titlecontents{section}
[0em]
{}
{}
{}
{\titlerule*[0.5em]{.}\contentspage}

%\setlength{\overfullrule}{5pt}

\begin{document}

\noindent\begin{minipage}[c]{0.5\textwidth}
\tableofcontents
\end{minipage}
%
\hspace{0.05\textwidth}
%
\begin{minipage}[c]{0.2\textwidth}
\begin{tabular}{ll}
Date & Signature \\[1em]
\ldots & \ldots \\
\ldots & \ldots \\[12pt]
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\end{tabular}
\vspace{1in}
\end{minipage}
%
\begin{minipage}[c]{0.2\textwidth}
\vspace{1in}
\begin{tabular}{ll}
Date & Signature \\[1em]
\ldots & \ldots \\
\ldots & \ldots \\[12pt]
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\ldots & \ldots \\
\end{tabular}
\end{minipage}


\section{Joe}

\lipsum[2]

\section{Blow}

\lipsum[3]

\section{A longer section title intended to take more than one line}

\lipsum[2]

\section{Blow}

\lipsum[3]

\section{Joe}

\lipsum[2]

\section{Blow}

\lipsum[3]

\section{Joe}

\lipsum[2]

\section{Blow}

\lipsum[3]

\end{document}    

It seems that loading package titletoc allows you to put the TOC into a minipage. You would still have to manually align the content of the second minipage with the entries in the TOC. In the updated example, I have used two minipages to illustrate how to vertically shift their content.

As I said, it's just a hack; there should be a better way.

enter image description here

  • that almost did it. But, how do i lift date and sign to the bottom of my page to align with my contents? Now, date and sign lie almost at the middle of the page, to the right – Dibu John Jan 16 '12 at 16:55
  • Insert vertical space manually using \vspace, see updated example. – Michael Palmer Jan 16 '12 at 17:30
  • @MichaelPalmer What if the ToC spans more than a page, then minipage just hides the remaining entries. Any solution for that case? – Paras Khosla Jul 04 '22 at 16:51