回忆录 southall chapterstyle 中的章节编号和章节标题不一致

回忆录 southall chapterstyle 中的章节编号和章节标题不一致

我在回忆录类的 southall chapterstyle 中看到编号和章节标题未垂直对齐。如何修复?

答案1

southall样式使用两个minipage顶部对齐的 s 来排版章节号和章节标题,因此章节号将与标题的第一行(上)垂直对齐,如下面的简单示例所示:

\documentclass{memoir}
\chapterstyle{southall}

\begin{document}

\chapter{Test Chapter with a Long Title Spanning Several Lines, just to Illustrate the Vertical Alignment}

\end{document}

在此处输入图片描述

如果要更改此默认对齐方式,则需要更改主题的对齐方式miniboxes;主题的原始定义southall类似于

\makechapterstyle{southall}{%
\setlength{\afterchapskip}{5\baselineskip}
\setlength{\beforechapskip}{36pt}
\setlength{\midchapskip}{\textwidth}
\addtolength{\midchapskip}{-\beforechapskip}
\renewcommand*{\chapterheadstart}{\vspace*{2\baselineskip}}
\renewcommand*{\chaptitlefont}{\huge\rmfamily\raggedright}
\renewcommand*{\chapnumfont}{\chaptitlefont}
\renewcommand*{\printchaptername}{}
\renewcommand*{\chapternamenum}{}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchapternum}{%
\begin{minipage}[t][\baselineskip][b]{\beforechapskip}
{\vspace{0pt}\chapnumfont%%%\figureversion{lining}
\thechapter}
\end{minipage}}
\renewcommand*{\printchaptertitle}[1]{%
\hfill\begin{minipage}[t]{\midchapskip}
{\vspace{0pt}\chaptitlefont ##1\par}\end{minipage}}
\renewcommand*{\afterchaptertitle}{%
\par\vspace{\baselineskip}%
\hrulefill \par\nobreak\noindent \vskip\afterchapskip}}

你需要更改的行是

\begin{minipage}[t][\baselineskip][b]{\beforechapskip}

\begin{minipage}[t]{\midchapskip}

例如,为了使章节号与标题的最后一行(下面)垂直对齐,您需要使用b说明符:

\begin{minipage}[b]{\beforechapskip}

\begin{minipage}[b]{\midchapskip}

这是一个完整的例子:

\documentclass{memoir}

\makechapterstyle{mysouthall}{%
\setlength{\afterchapskip}{5\baselineskip}
\setlength{\beforechapskip}{36pt}
\setlength{\midchapskip}{\textwidth}
\addtolength{\midchapskip}{-\beforechapskip}
\renewcommand*{\chapterheadstart}{\vspace*{2\baselineskip}}
\renewcommand*{\chaptitlefont}{\huge\rmfamily\raggedright}
\renewcommand*{\chapnumfont}{\chaptitlefont}
\renewcommand*{\printchaptername}{}
\renewcommand*{\chapternamenum}{}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchapternum}{%
\begin{minipage}[b]{\beforechapskip}
{\vspace{0pt}\chapnumfont%%%\figureversion{lining}
\thechapter}
\end{minipage}}
\renewcommand*{\printchaptertitle}[1]{%
\hfill\begin{minipage}[b]{\midchapskip}
{\vspace{0pt}\chaptitlefont ##1\par}\end{minipage}}
\renewcommand*{\afterchaptertitle}{%
\par\vspace{\baselineskip}%
\hrulefill \par\nobreak\noindent \vskip\afterchapskip}}
\chapterstyle{mysouthall}

\begin{document}

\chapter{Test Chapter with a Long Title Spanning Several Lines, just to Illustrate the Vertical Alignment}

\end{document}

现在对齐是在底部:

在此处输入图片描述

将两个 s 的对齐说明符更改b为,将导致章节号相对于标题垂直对齐于中心。cminipage

相关内容