0

I have structured my thesis in a way that by reading some selected sections, one can have a complete and fast(er) review of it. I have my normal table of contents (example 1) but I would like to add an additional "Table of contents fast track" so to say (example 2), showing only the sections which need to be read for the review.

I know how to show only one ToC with selected sections by using \chapter*{} or \section*{} in the chapters or sections I don't want to show. Is there an (uncomplicated) way to have both ToCs?

In addition, in the ToC "fast track" I would like to show the "real" section numbers, those that each section has in example 1.

Example 1: Normal table of contents

\documentclass[11pt, a4paper, oneside]{report}

\begin{document}

\tableofcontents

\chapter{Chapter1} 
\section{Section1.1} % Fast track
\section{Section1.2} % Fast track
\section{Section1.3} % Fast track

\chapter{Chapter2}
\section{Section2.1}
\section{Section2.2}
\section{Section2.3} % Fast track

\chapter{Chapter3}
\section{Section3.1}
\section{Section3.2} % Fast track
\section{Section3.3}

\end{document}

Table of contents "fast track"

\documentclass[11pt, a4paper, oneside]{report}

\begin{document}

\renewcommand*\contentsname{Fast track contents}
\tableofcontents 

\chapter*{Chapter1}  
\section{Section1.1} % Fast track 
\section{Section1.2} % Fast track 
\section{Section1.3} % Fast track

\chapter*{Chapter2} 
\section*{Section2.1} 
\section*{Section2.2} 
\section{Section2.3} % Fast track

\chapter*{Chapter3} 
\section*{Section3.1} 
\section{Section3.2} % Fast track 
\section*{Section3.3}

\end{document}

I would like the ToC "fast track" showing "real" section numbers

Thanks.

Edit: here I asked a further question about how to format the "fast track ToC".

2

You can use the tocloft package to define a new list of contents.

\documentclass[11pt, a4paper, oneside]{report}

\usepackage{tocloft}
\newlistof[chapter]{fasttrack}{ftk}{Fast track contents} % Define the list of fast... 

\newcommand{\fasttracksection}[1]{% This is the special section 
  \section{#1}
  \addcontentsline{ftk}{fasttrack}{\protect\numberline{\thefasttrack}#1}}
\renewcommand{\thefasttrack}{} % No section numbers 

\begin{document}

  \tableofcontents

  \listoffasttrack

  \chapter{Chapter1} 
    \fasttracksection{Section1.1} % Fast track
    \fasttracksection{Section1.2} % Fast track
    \fasttracksection{Section1.3} % Fast track

  \chapter{Chapter2}
    \section{Section2.1}
    \section{Section2.2}
    \fasttracksection{Section2.3} % Fast track

  \chapter{Chapter3}
    \section{Section3.1}
    \fasttracksection{Section3.2} % Fast track
    \section{Section3.3}

\end{document}
| improve this answer | |
  • Awesome! Thank you! Would it be easy that the "fast track" ToC has the actual section numbers (2.3, etc)? (it it is not easy, don't spend any time in this!) I don't really understand the code yet, but I tried adding 'stuff' inside the {} of \renewcommand{\thefasttrack}{} to see what it does and I suspect that if I introduce the "table of contents counter" there, I would get what I want. Is it so? What is the name of this counter? I tried \refstepcounter and other things and didn't work... – Miquel May 24 at 13:07
  • Oh, I found the name! XD \thesection! However, the numbers are very close to the section names. I tried placing \quad in different places but I don't manage to separate the section numbers from the section names. How should I do it? – Miquel May 24 at 16:34
  • I found it, sorry. The \quad has to be placed before #1: \addcontentsline{ftk}{fasttrack}{\protect\numberline{\thefasttrack}\quad #1}}. Should I delete the comments or leave them for others to know how to tweak this? – Miquel May 24 at 16:48
  • As you like. But add comments to your code is always a good idea. – Robert Fuster May 25 at 10:32
1

I have made a slight edit to your MWE

% quicktocprob.tex  SE 544913
\documentclass[11pt, a4paper, oneside]{report}

\begin{document}
\setcounter{secnumdepth}{0}  % PW added

\renewcommand*\contentsname{Fast track contents}
\tableofcontents 

\chapter*{Chapter1}  
\section{Section1.1} % Fast track 
\section{Section1.2} % Fast track 
\section{Section1.3} % Fast track

\chapter*{Chapter2} 
\section*{Section2.1} 
\section*{Section2.2} 
\section{Section2.3} % Fast track

\chapter*{Chapter3} 
\section*{Section3.1} 
\section{Section3.2} % Fast track 
\section*{Section3.3}

\end{document}

The \setcounter{secnumdepth}{0} only numbers chapters and above, so sections are unnumbered which is what you wanted in your Fast Track Contents. It may not be what you want in the body, though.

But now you ask for both ToCs within the code for one document. Here is a revision of your main MWE that does that.

% twotocprob.tex SE 544913
\documentclass[11pt, a4paper, oneside]{report}

\begin{document}

\tableofcontents

\renewcommand{\contentsname}{Fast track contents}
\tableofcontents
\input{quicktocprob.toc}

\chapter{Chapter1} 
\section{Section1.1} % Fast track
\section{Section1.2} % Fast track
\section{Section1.3} % Fast track

\chapter{Chapter2}
\section{Section2.1}
\section{Section2.2}
\section{Section2.3} % Fast track

\chapter{Chapter3}
\section{Section3.1}
\section{Section3.2} % Fast track
\section{Section3.3}

\end{document}

You first have to run the quicktocprob code then the twotocprob code. I do not know how you want your final document to look like.

| improve this answer | |
  • Thank. And how can I have both ToC at the same time? – Miquel May 23 at 18:22
  • To restore the deeper listing, increase the value of the secnumdepth counter and repeat the \tableofcontents. – barbara beeton May 23 at 20:45
  • Apologies, Peter! I really meant \setcounter{tocdepth}; same values apply as for as secnumdepth. – barbara beeton May 24 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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