排版一本书,其中大部分章节未命名,但有编号。有人帮我做了下面的排版,但错误是我自己添加的。这是基于 Memoir 的“brotherton”风格:
\documentclass[oneside]{memoir}
\newcommand{\numtodanishword}[1]{\ifcase\value{chapter}?\or first\or second\else ?\fi}
\usepackage{xpatch}
\makechapterstyle{matheson}{%
\xpatchcmd{\@makechapterhead}
{\printchaptername \chapternamenum \printchapternum}
{\printchapternum \chapternamenum \printchaptername}
{}
{}
\chapterstyle{default}
\renewcommand*{\printchapternum}{\chapnumfont
\ifanappendix \thechapter \else \large\MakeUppercase{\numtodanishword{\value{chapter}}}\fi}
\renewcommand*{\printchaptername}{\centering\chapnamefont\large\MakeUppercase{chapter}}
\renewcommand*{\printchaptertitle}[1]{%
\chapnamefont\centering\large\MakeUppercase{##1}}
\setlength{\beforechapskip}{\baselineskip}
\setlength{\afterchapskip}{-10pt} % I think I done goofed here
}
\chapterstyle{matheson}
\begin{document}
\chapter{}
A numbered chapter.
\chapter*{test}
A starred chapter.
\end{document}
如您所见,“常规”章节后的垂直间距是可以的:
...但是请看一下带星号的章节:
我认为错误出在这\afterchapskip
行,正如我在代码中指出的那样。更糟糕的是,我已经排版了很多页面——所以我希望获得与当前代码相同的间距——但我希望带星号的章节也能如此!
怎么修?
答案1
改变
\setlength{\afterchapskip}{-10pt} % I think I done goofed here
这将解决问题
\setlength{\afterchapskip}{0pt} % I think I done goofed here