将目录分成两半

将目录分成两半

我希望我的目录在同一页面上并排显示两半,我该怎么做?

答案1

带包装的一种方法multicol

\documentclass{article}
\usepackage{multicol}
\begin{document}
\begingroup% In order to make local the \columnsep change bellow
% As @Mico suggested you may handle the separation space of the columns
% by un-commenting the next line:
%\setlength\columnsep{20pt}
\begin{multicols}{2}
\tableofcontents
\end{multicols}
\endgroup
\part{part A}
\section{Test A}
Test
\section{Test B}

\subsection{Test BA}
\subsection{Test BB}
\section{Test C}
\section{Text D}
\part{part B}
\section{Test A}
Test
\section{Test B}

\subsection{Test BA}
\subsection{Test BB}
\section{Test C}
\section{Text D}
\part{part C}
\section{Test A}
Test
\section{Test B}

\subsection{Test BA}
\subsection{Test BB}
\section{Test C}
\section{Text D}
\part{part D}
\section{Test A}
Test
\section{Test B}

\subsection{Test BA}
\subsection{Test BB}
\section{Test C}
\section{Text D}
\end{document}

输出:

在此处输入图片描述

答案2

tocloftmulticol对此有所帮助。

\documentclass{...}
\usepackage{tocloft}
\usepackage{multicol}
% twocolumn ToC
\renewcommand{\cfttocprehook{\begin{multicols}{2}}
\renewcommand{\cfttocposthook}{\end{multicols}}
% twocolumn LoF (if required)
 \renewcommand{\cftlofprehook{\begin{multicols}{2}}
 \renewcommand{\cftlofposthook}{\end{multicols}}
% twocolumn LoT (if required)
 \renewcommand{\cftlotprehook{\begin{multicols}{2}}
 \renewcommand{\cftlotposthook}{\end{multicols}}

\begin{document}
\tableofcontents % in twocolumn
\listoffigures   % in twocolumn if \cftlofp... renewed 
\listoftables    % in twocolumn if \cftlotp... renewed
% etc
\end{document}

相关内容