刚刚升级到 2019 版 LaTeX。升级之前,此命令没有问题:
\printcontents{l}{0}{\setcounter{tocdepth}{1}}
升级后,此命令不会打印二级目录。如果我删除{l}
:
\printcontents{ }{0}{\setcounter{tocdepth}{1}}
然后它将打印,但正如预期的那样,它使用chapter
、section
等设置而不是命令定义的、等设置lchapter
,例如:lsection
\titlecontents
\titlecontents{chapter}
[1.25cm]
{\addvspace{12pt}\large\bfseries}
{\color{blue!60}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{blue}}
{\color{blue}}
{\color{blue!60}\normalsize\;\titlerule*[.5pc]{.}\;\thecontentspage}
\titlecontents{lchapter}
[0em]
{\addvspace{15pt}\large\bfseries}
{\color{black}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{black}}
{}
{\color{black}\normalsize\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage}
梅威瑟:
\documentclass[12pt,fleqn,twoside]{book}
\RequirePackage{titletoc}
\titlecontents{chapter}
[1.25cm]
{\large\bfseries}
{\contentslabel[\Large\thecontentslabel]{1.25cm}}
{}
{\normalsize\thecontentspage}
\titlecontents{lchapter}
[0em]
{\large\bfseries}
{\contentslabel[\Large\thecontentslabel]{1.25cm}}
{}
{\normalsize\bfseries\thecontentspage}
\begin{document}
\startcontents%
\chapter{Chapter 1}
some text
\chapter{Chapter 2}
some text
\printcontents{l}{0}{\setcounter{tocdepth}{1}}
\end{document}
这不会打印目录。替换{l}
为{ }
将打印目录,如上所述。