如何使用 Memoir 隐藏目录中的章节编号,同时保留每章开头的编号

如何使用 Memoir 隐藏目录中的章节编号,同时保留每章开头的编号

我正在使用memoir并尝试仅在目录中隐藏章节编号。我希望保留它,\mainmatter
现在我正在使用\chapter[Chapter 1]{} 它将“第 1 章”文本隐藏在每章的开头,但保留 -1- 编号。并且“第 1 章”文本也在目录中。

我想保持原样,但隐藏目录中的 1 2 3 4。现在我有 1 章节 1 2 2 章节 2 5 3 章节 3 15 4 章节 4 23,这有点多余。因此,我想删除每行开头“章节”之前的章节编号。我正在使用的其他软件包是:

\usepackage{palatino}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{textcomp}
\usepackage{nextpage}

我听说这个软件包etoc可以做到这一点,但到目前为止,我还没能让它做我想做的事。我要么从目录中隐藏每一章,要么它从目录中和章节本身隐藏数字。

这是我的 MWE

\documentclass[statementpaper,11pt,openany,twoside,extrafontsizes,final]{memoir}
\usepackage{palatino}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{textcomp}
\usepackage{nextpage}
\chapterstyle{dash}
\pagestyle{plain}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\newpage\null\thispagestyle{empty}\newpage
\chapter[Chapter 1]{}
All characters in this publication are fictitious and any resemblance to real persons, living or dead, is purely coincidental.\par
\end{document}

答案1

最简单的方法是使用以下方法“gooble”删除章节编号

\def\cftchapterpresnum #1\@cftasnum{}

此外,我建议减少chapter indent0pt以及numwidth

\cftsetindents{chapter}{0pt}{0pt}

这是文件:

\documentclass[statementpaper,11pt,openany,twoside,extrafontsizes,final]{memoir}
\usepackage{palatino}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{textcomp}
\usepackage{nextpage}
\chapterstyle{dash}
\pagestyle{plain}
\makeatletter
\def\cftchapterpresnum #1\@cftasnum{}
\cftsetindents{chapter}{0pt}{0pt}
\makeatother

\begin{document}

\frontmatter

\tableofcontents
\mainmatter
\newpage\null\thispagestyle{empty}\newpage

\chapter{Chapter 1}
All characters in this publication are fictitious and any resemblance to real persons, living or dead, is purely coincidental.\par
\end{document}

在此处输入图片描述

相关内容