LaTeX 目录双栏
发布时间
阅读量:
阅读量
by Heiko Oberdiek 选自Centering contents name with [twocolumn] contents
Example for article:
\documentclass[twocolumn]{article}
\makeatletter
\renewcommand*{\tableofcontents}{%
\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\twocolumn[\section*{\centering\contentsname}]%
\@mkboth{\MakeUppercase\contentsname}%
{\MakeUppercase\contentsname}%
\thispagestyle{plain}%
\@starttoc{toc}%
\if@restonecol
\onecolumn
\else
\clearpage
\fi
}
\makeatother
\begin{document}
\tableofcontents
\section{Foobar}
\subsection{Hello World}
\subsubsection{Subsubsection}
\addtocontents{toc}{\protect\newpage}
\section{Last section}
\subsection{Last subsection}
\end{document}
Example for report:
\documentclass[twocolumn]{report}
\makeatletter
\renewcommand*{\tableofcontents}{%
\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\twocolumn[\@makeschapterhead{\centering\contentsname}]%
\@mkboth{\MakeUppercase\contentsname}%
{\MakeUppercase\contentsname}%
\thispagestyle{plain}%
\@starttoc{toc}%
\if@restonecol
\onecolumn
\else
\clearpage
\fi
}
\makeatother
\begin{document}
\tableofcontents
\chapter{Foobar}
\section{Hello World}
\subsection{Subsection}
\addtocontents{toc}{\protect\newpage}
\chapter{Last chapter}
\section{Last section}
\end{document}

by user31729 选自Table of contents in two column, without multicol
\documentclass{book}
\usepackage{pgffor}
\makeatletter
\newcommand{\twocolumntoc}{%
\chapter*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
}
\makeatother
\setcounter{tocdepth}{4}
\begin{document}
\twocolumn
\twocolumntoc
\onecolumn
\foreach \x in {1,...,50}{%
\chapter{Chap \x}
\section{Foo section}
\subsection{Foo subsec}
\subsubsection{Foo subsecsec}
}
\end{document}

全部评论 (0)
还没有任何评论哟~

