有人好心地帮助我设计了这一章节的风格:
\documentclass[openany]{memoir} % redefine numbering
\newcommand{\numtoword}[1]{\ifcase\value{chapter}?\or first \or
second\else ?\fi}
% c&p from memoir.cls's brotherton style \usepackage{xpatch}
\makechapterstyle{matheson}{% \xpatchcmd{\@makechapterhead}
{\printchaptername \chapternamenum \printchapternum}
{\printchapternum \chapternamenum \printchaptername}
{}
{} \chapterstyle{default} \renewcommand*{\printchapternum}{\chapnumfont
\renewcommand{\chapnamefont}{\centering\large\MakeUppercase}
\ifanappendix \thechapter \else
\large\MakeUppercase{\numtoword{\value{chapter}}}\fi}
\setlength{\beforechapskip}{\baselineskip}
\setlength{\afterchapskip}{-10pt} } \chapterstyle{matheson}
\begin{document} \chapter{} This looks as it should.
\chapter*{Chapter with name} This certainly does not.
\chapter{Chapter with another name} This is not too snappy either.
\end{document}
当我刚刚这样做时,它看起来很酷\chapter{}
:
当我\chapter*{Chapter with name}
这样做的时候,情况就不同了:
同样的事情\chapter{Chapter with another name}
:
现在,我如何才能获得带星号章节的“第一章”样式的“带名称的章节”?我如何才能获得不带星号的版本的“第二章:带另一个名称的章节”?我现在不需要它,但为了完成,我认为最好有它。
最后,你可以看到,章节标题下方的间距处理得不太好。正确的做法是什么?