1

I want to align chapter*-title with chapter-title in memoir, as show in the following

+---------------------------------+---------------------------------+
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |  Chapter 1                      |
|  -----------------------------  |  -----------------------------  |
|  Test One                       |  Test Two                       |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
|                                 |                                 |
+---------------------------------+---------------------------------+

I know I should use the \makechapterstyle but I don't know how:

\documentclass[oneside]{memoir}

\makechapterstyle{stack}
{
  \renewcommand{\afterchapternum}{}
  \def\chapterheadstart{\vspace*{\beforechapskip}}
  \renewcommand{\printchaptertitle}{\hrule\vspace{0.6\midchapskip}\chaptitlefont}
  \renewcommand{\printchapternonum}{\par\vspace{\midchapskip}}
}
\chapterstyle{stack}

\begin{document}

\chapter*{Test One}

\chapter{Test Two}

\end{document}
0

Best would be to place a \strut in places where you have no text (specifically \printchapternonum). For completeness, it's actually easiest to add this - a \strut - to all definitions of \chapnamefont and \chaptitlefont:

\documentclass[oneside]{memoir}

\makechapterstyle{stack}
{
  \renewcommand{\afterchapternum}{}
  \def\chapterheadstart{\vspace*{\beforechapskip}}
  \addtodef{\chapnamefont}{}{\strut}
  \addtodef{\chaptitlefont}{}{\strut}
  \renewcommand{\printchaptertitle}[1]{\hrule \par\chaptitlefont ##1\par}
  \renewcommand{\printchapternonum}{\chapnamefont\par}
}
\chapterstyle{stack}

\begin{document}

\chapter*{Test One}

\chapter{Test Two}

\end{document}

\addtodef{<macro>}{<before>}{<after>} is provided by memoir as an extension of the regular kernel \g@addto@macro.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy