在开展一个相当长期的项目时,我创建了一个目录。
问题是:目前,我的目录末尾分为每列。但我想先完成左侧部分,然后再开始右侧部分。
举例说明:
分数维:
\documentclass[12pt,twoside]{book}
\usepackage[paperheight=240mm,paperwidth=160mm, left=22mm, right = 20mm, top = 20mm, bottom = 22mm]{geometry}
\usepackage[cam,width=17.5truecm,height=25.54truecm,center,dvips,noinfo]{crop}
\usepackage[french]{babel}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage[newparttoc]{titlesec}%
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage[toc]{multitoc}
\renewcommand*{\multicolumntoc}{2}
\makeatletter
\addto\captionsfrench{\renewcommand\contentsname{}}
\makeatother
\begin{document}
\chapter{Test}
\section{Test}
\subsection{Test}
\subsubsection{Test}
\chapter{Test}
\newpage
\tableofcontents
\end{document}
感谢大家的帮助 !
答案1
可能你的解决方案不是最优雅的,但你可以重新定义\@starttoc
使用multicols*
而不是multicols
:
\documentclass[12pt,twoside]{book}
\usepackage[paperheight=240mm,paperwidth=160mm, left=22mm, right = 20mm, top = 20mm, bottom = 22mm]{geometry}
\usepackage[cam,width=17.5truecm,height=25.54truecm,center,dvips,noinfo]{crop}
\usepackage[french]{babel}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage[newparttoc]{titlesec}%
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage[toc]{multitoc}
\renewcommand*{\multicolumntoc}{2}
\makeatletter
\addto\captionsfrench{\renewcommand\contentsname{}}
\makeatother
\makeatletter
\renewcommand*{\@starttoc}[1]{%
\ifthenelse{\boolean{@multitoc@toc}\and\equal{#1}{toc}}{%
\begin{multicols*}{\multicolumntoc}%
\@multitoc@starttoc{#1}%
\end{multicols*}%
}{}%
}
\makeatother
\begin{document}
\chapter{Test}
\section{Test}
\subsection{Test}
\subsubsection{Test}
\chapter{Test}
\newpage
\tableofcontents
\end{document}
答案2
尝试一下这个修改过的 MWE 版本
% multitocprob.tex SE 545715
\documentclass[12pt,twoside]{book}
\usepackage[paperheight=240mm,paperwidth=160mm, left=22mm, right = 20mm, top = 20mm, bottom = 22mm]{geometry}
\usepackage[cam,width=17.5truecm,height=25.54truecm,center,dvips,noinfo]{crop}
\usepackage[french]{babel}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage[newparttoc]{titlesec}%
\usepackage{titletoc}
\usepackage{tocloft}
% PW changes
\makeatletter
\renewcommand{\@cfttocstart}{\twocolumn}
\renewcommand{\@cfttocfinish}{\onecolumn}
\makeatother
%\usepackage[toc]{multitoc}
%\renewcommand*{\multicolumntoc}{2}
% end PW changes
\makeatletter
\addto\captionsfrench{\renewcommand\contentsname{}}
\makeatother
\begin{document}
\chapter{Test}
\section{Test}
\subsection{Test}
\subsubsection{Test}
\chapter{Test}
\newpage
%\twocolumn
\tableofcontents
\chapter{Another}
\lipsum[1-4]
%\onecolumn
\end{document}
基本上,我改变了几个tocloft
内部宏,使目录分为两列,最后恢复为一列模式。