Is it safe to redefine \@starttoc?
Needs at least two LaTeX runs.
\documentclass{scrbook}
\usepackage{multicol}
\AfterTOCHead[toc]{\begin{multicols}{2}}
\AtEndDocument{\addtocontents{toc}{\protect\end{multicols}}}
\begin{document}
\tableofcontents
\part{part}
[...]
Or for the star version of multicols
(no balanced columns)
\AfterTOCHead[toc]{\raggedcolumns\begin{multicols}{2}}
Each of the KOMA-Script classes scrartcl
, scrreprt
and scrbook
load and use package tocbasic
for the ToC and the Lists. tocbasic
uses \tocbasic@starttoc
based on \@starttoc
. \tocbasic@starttoc
and \@starttoc
both are internal commands and should not be redefined by users. But tocbasic
provides two hooks to execute code before (\BeforeStartingTOC
) and after (\AfterStartingTOC
) @starttoc
.
Note that \BeforeStartingTOC
and \AfterStartingTOC
are at the same group level (inside the same group), so you can use:
\BeforeStartingTOC[toc]{\begin{multicols}{2}}
\AfterStartingTOC[toc]{\end{multicols}}
Code:
\documentclass{scrbook}
\usepackage{multicol}
\BeforeStartingTOC[toc]{\begin{multicols}{2}}
\AfterStartingTOC[toc]{\end{multicols}}
\begin{document}
\tableofcontents
\part{part}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\part{part}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\chapter{chapter}
\section{section}
\section{section}
\end{document}
Or with the starred version of multicols
:
\BeforeStartingTOC[toc]{\begin{multicols*}{2}}
\AfterStartingTOC[toc]{\end{multicols*}}