如何关闭memoir类中\part命令自动生成的Part页面?
取消memoir类中\part命令自动生成的单独页面
要解决这个问题,你可以通过重新定义\part命令,保留其更新计数器和添加目录条目的功能,同时移除自动生成单独标题页的逻辑,具体实现如下:
修改后的最小工作示例(MWE)
\documentclass[12pt]{memoir} \usepackage{fmtcount} \let\ordinal\relax \makeatletter \renewcommand{\printtoctitle}[1]{\centering\HUGE\textit{Contents}} \renewcommand{\cftpartleader}{} \renewcommand*{\cftpartfont}{} \renewcommand\partnumberline[1]{\centering\huge\scshape Part #1: } \renewcommand*{\cftpartformatpnum}[1]{} \renewcommand{\thepart}{\Numberstring{part}} \patchcmd\l@part{% {\cftpartfont {#1}}\cftpartfillnum{#2}% }{% #1\cftpartfillnum{#2}% }{\typeout{patched}% }{} % 重新定义\part命令,仅保留计数器更新与目录条目添加 \renewcommand{\part}[1]{% \refstepcounter{part}% \addcontentsline{toc}{part}{\partnumberline{\thepart}#1}% } \begin{document} \tableofcontents* % 自定义Part One页面示例 \newpage \begin{center} \HUGE\scshape Part \thepart: The Theory \end{center} \section{Introduction} 这是第一部分的正文内容。 \part{The Foundation} % 自定义Part Two页面示例 \newpage \begin{center} \HUGE\scshape Part \thepart: The Foundation \end{center} \section{Basic Concepts} 这是第二部分的正文内容。 \end{document}
关键说明
- 重新定义的
\part命令仅负责更新part计数器和向目录添加条目,完全跳过了默认的标题页生成流程。 - 你可以根据需求自由设计自定义Part页面的格式,比如调整字体、排版、添加装饰元素等。
- 由于
memoir类本身具备强大的标题自定义能力,示例中移除了未用到的titlesec包,避免潜在的兼容性问题。
内容的提问来源于stack exchange,提问作者buttonsrtoys
相关产品推荐
相关产品推荐

