2

MWE

\documentclass[a4paper,11pt]{book}

\usepackage{multicol}
\usepackage{titletoc}

\makeatletter
\renewcommand{\tableofcontents}[1][\contentsname]{%
\section*{#1}
\begin{multicols}{2}
\@starttoc{toc}
\end{multicols}
}
\makeatother

\begin{document}

\part{ONE}
\tableofcontents
\chapter{One}
\section{1-One}

\part{TWO}
\tableofcontents % <--- empty page
\chapter{One}
\section{1-One}

\end{document}

How do I print the contents page on another page?

Özgür
  • 3,270

2 Answers2

2

Use etoc, since it allows you to use \tableofcontents multiple times.

enter image description here

\documentclass{book}

\usepackage{multicol}
\usepackage{titletoc,etoc}

\makeatletter
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{%
  \begin{multicols}{2}
    \let\chapter\section% Set the ToC as a \section (default is \chapter in book)
    \let\@mkboth\@gobbletwo% Remove any header addition
    \oldtableofcontents% Regular ToC
  \end{multicols}
}
\makeatother

\begin{document}

\part{ONE}
\tableofcontents
\chapter{One}
\section{1-One}

\part{TWO}
\tableofcontents % <--- Duplicate ToC
\chapter{One}
\section{1-One}

\end{document}
Werner
  • 603,163
  • It's working but in my actual file, I get an error like the following. Where do you suggest I look?
    \tf@toc=\write12
    \openout12 = `tmp.toc'.
    ! Missing number, treated as zero.
    <to be read again>
    \Etoc@level
    l.54 \tableofcontents
    ?
    ! Emergency stop.
    
    – Özgür Aug 31 '19 at 00:36
  • @Özgür: Don't know. Perhaps delete all the auxiliary files created by (La)TeX and try again. Otherwise, you'd have to supply some code that reproduces your problem in order for anyone to solve it. – Werner Aug 31 '19 at 15:52
  • I found the problem when adding the \usepackage{minitoc} was having trouble. But now this package is not working for me and I deleted. – Özgür Aug 31 '19 at 19:26
0

You are using the book class so try switching to the memoir class (which extends book) where you can use \tableofcontents, \listoffigures and \listoftables as many times as you want. The manual (> texdoc memoir) has examples of changing the style of the ToC et al and also how to have a short ToC and a long one.

Peter Wilson
  • 28,066