修改回忆录类中的部分样式以匹配 ell 章节样式

修改回忆录类中的部分样式以匹配 ell 章节样式

我选择了 ell chapterstyle,使用了 memoir 类。以下是我在回忆录类的部分风格回忆录中 \part 样式的修改并查看 memoir.cls 中的 ell 定义,我已经非常接近将部分样式与本章节样式相匹配:

\documentclass[openany]{memoir}

\chapterstyle{ell}

\renewcommand{\midpartskip}{\begingroup
 \vspace*{\beforechapskip}%
 \begin{adjustwidth}{}{-\chapindent}%
 \hrulefill
 \smash{\rule{0.4pt}{15mm}}
 \end{adjustwidth}\endgroup}

% numeric instead of roman numeral for the part num:
\renewcommand*{\thepart}{\arabic{part}}
% ell like Fonts: 
% 
% ragged left: from https://tex.stackexchange.com/questions/42489/a-modification-of-part-style-in-memoir
% (moves the text to the right)
\renewcommand*{\parttitlefont}{\normalfont\huge\sffamily\raggedleft}
\renewcommand*{\partnumfont}{\normalfont\HUGE\sffamily\raggedleft}
\renewcommand*{\partnamefont}{\normalfont\HUGE\sffamily\raggedleft}
% this (without the \beforepartskip of the same form) force the part text higher onto the page.
\renewcommand{\afterpartskip}{\vspace*{\fill}}

\begin{document}

\chapterstyle{ell}
\part{A lot of Foo}
\chapter{Foo}

Foo stuff.

\chapter{Bar}

Bar stuff.

\end{document}

这会更改字体以匹配,并从罗马数字切换,并放入 ell 形分隔符。但是,在 ell 形章节样式中,描述与 L 形图形是内联的,我不确定如何强制它们不脱节。这是我为 ell 形部分样式得到的

修改回忆录部分样式,尝试匹配 ell 章节样式

与 ell chapterstyle 格式相比

ell 章节风格

memoir.cls 中的 ell chapterstyle 为:

\makechapterstyle{ell}{%
  \chapterstyle{default}
  \renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily}
  \renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily}
  \settowidth{\chapindent}{\chapnumfont 111}
  \renewcommand*{\chapterheadstart}{\begingroup
    \vspace*{\beforechapskip}%
    \begin{adjustwidth}{}{-\chapindent}%
    \hrulefill
    \smash{\rule{0.4pt}{15mm}}
    \end{adjustwidth}\endgroup}
  \renewcommand*{\printchaptername}{}
  \renewcommand*{\chapternamenum}{}
  \renewcommand*{\printchapternum}{%
    \begin{adjustwidth}{}{-\chapindent}
    \hfill
    \raisebox{10mm}[0pt][0pt]{\chapnumfont \thechapter}%
                              \hspace*{1em}
    \end{adjustwidth}\vspace*{-3.0\onelineskip}}
  \renewcommand*{\printchaptertitle}[1]{%
    \vskip\onelineskip
    \raggedleft {\chaptitlefont ##1}\par\nobreak}}

请注意,我在修改的部分使用了 \chapterheadstart 的主体。我不确定这种样式的哪一部分会导致 \chapterheadstart 与章节号内联。

答案1

我的比 Harish 的稍微复杂一点,需要你稍微调整一下

\documentclass[openany,oneside]{memoir}

\chapterstyle{ell}

\renewcommand{\beforepartskip}{%
  \null
  \vspace*{\beforechapskip}
  \vspace*{\onelineskip}
  }
\renewcommand{\midpartskip}{\begingroup
  % \vspace*{\beforechapskip}%
  \begin{adjustwidth}{}{-\chapindent}%
  \hrulefill
  \smash{\rule{0.4pt}{15mm}}
  \end{adjustwidth}\endgroup}

% numeric instead of roman numeral for the part num:
\renewcommand*{\thepart}{\arabic{part}}
% ell like Fonts:
%
\renewcommand*{\parttitlefont}{\normalfont\huge\sffamily\raggedleft}
\renewcommand*{\partnumfont}{\normalfont\HUGE\sffamily\raggedleft}
\renewcommand*{\partnamefont}{\normalfont\HUGE\sffamily\raggedleft}
% this (without the \beforepartskip of the same form) force the part text higher onto the page.
\renewcommand{\afterpartskip}{\vspace*{\fill}}
\renewcommand\printpartnum{}
\renewcommand{\partnamenum}{}
\renewcommand\printpartname{%
  \begin{adjustwidth}{}{-\chapindent}
  \hfill
  \raisebox{11mm}[0pt][0pt]{\partnamefont\partname~\thepart}%
  \hspace*{1em}
  \end{adjustwidth}\vspace*{-3.0\onelineskip}}

\begin{document}

\chapterstyle{ell}
\part{A lot of Foo}
\chapter{Foo}

Foo stuff.

\chapter{Bar}

Bar stuff.

\end{document}

答案2

您可以调整fill距离,例如:

\renewcommand{\midpartskip}{\begingroup
 \vspace*{-.4\beforechapskip}
 \begin{adjustwidth}{}{-.5\chapindent}
 \hrulefill
 \smash{\rule{0.4pt}{15mm}}
 \end{adjustwidth}\endgroup}

完整代码如下

\documentclass[openany]{memoir}

\chapterstyle{ell}

\renewcommand{\midpartskip}{\begingroup
 \vspace*{-.4\beforechapskip}
 \begin{adjustwidth}{}{-.5\chapindent}
 \hrulefill
 \smash{\rule{0.4pt}{15mm}}
 \end{adjustwidth}\endgroup}

% numeric instead of roman numeral for the part num:
\renewcommand*{\thepart}{\arabic{part}}
% ell like Fonts:
%
% ragged left: from http://tex.stackexchange.com/questions/42489/a-modification-of-part-style-in-memoir
% (moves the text to the right)
\renewcommand*{\parttitlefont}{\normalfont\huge\sffamily\raggedleft}
\renewcommand*{\partnumfont}{\normalfont\HUGE\sffamily\raggedleft}
\renewcommand*{\partnamefont}{\normalfont\HUGE\sffamily\raggedleft}
% this (without the \beforepartskip of the same form) force the part text higher onto the page.
% \renewcommand{\afterpartskip}{\vspace*{\fill}}

\begin{document}

\chapterstyle{ell}
\part{A lot of Foo}
\chapter{Foo}

Foo stuff.

\chapter{Bar}

Bar stuff.

\end{document}

在此处输入图片描述

相关内容