在章节编号后直接添加章节标题文字

在章节编号后直接添加章节标题文字

我正在使用 Memoir 文档类编写文档,并article启用了使用 选项\documentclass[a4paper,12pt,article,oneside]{memoir}。如何在章节编号之后、章节编号和标题之间的跳转之前添加文本“chap.”?最好目录中的章节条目也应受到影响。

\afterchapternumMemoir 的文档中描述了和宏\midchapskip,但我无法让它工作。我尝试重新定义\afterchapternum(但没有成功):

\renewcommand{\afterchapternum}[0]{chap. \midchapskip}

例子:

LaTeX 文档

\documentclass[article]{memoir}

\begin{document}
    \chapter{Lorem Ipsum}
\end{document}

目前结果在章节标题中

1  Lorem Ipsum

但我希望结果是

1 chap.  Lorem Ipsum

答案1

评论太长了。article 选项使章节使用 article 章节样式进行排版。以下是代码

\makechapterstyle{article}{%
\chapterstyle{default}
\setlength{\beforechapskip}{3.5ex \@plus 1ex \@minus .2ex}
\renewcommand*{\chapterheadstart}{\vspace{\beforechapskip}}
\setlength{\afterchapskip}{2.3ex \@plus .2ex}
\renewcommand{\printchaptername}{}
\renewcommand{\chapternamenum}{}
\renewcommand{\chaptitlefont}{\normalfont\Large\bfseries}
\renewcommand{\chapnumfont}{\chaptitlefont}
\renewcommand{\printchapternum}{\chapnumfont \thechapter\quad}
\renewcommand{\afterchapternum}{}}

因此您只需复制并更改\printchapternum

相关内容