1

I am using a custom chapter style for my thesis, but I am struggling to get consistent chapter heading gaps between chapters without a number (chapter*{}) and chapters with a number (chapter{}). See examples below: enter image description here enter image description here enter image description here

MWE:

\documentclass[openany]{memoir}

\usepackage{lipsum}

% chapter style
\makechapterstyle{mit}{%
  \renewcommand{\printchaptername}{\chaptername\ }
  \renewcommand{\chapternamenum}{}
  \renewcommand{\printchapternum}{%
   \thechapter
  }%
  \renewcommand{\afterchapternum}{\par}%
  \renewcommand{\printchaptertitle}[1]{%
    {\raggedright\large\setSpacing{1.5}\textbf{##1}\\\rule{\linewidth}{0.2pt}}
  }
  \renewcommand{\afterchaptertitle}{\par\nobreak\vskip0.5\baselineskip}%
}

\begin{document}
    \chapterstyle{mit}

    \chapter*{Acknowledgements}
    \lipsum[1]

    \clearpage
    \tableofcontents*

    \chapter{Introduction}
    \lipsum[1]

    \chapter{Background}
    \lipsum[1]

    \chapter{Conclusion}
    \lipsum[1]

\end{document}

Any idea how to get those gaps between the rule and the start of the text consistent between different chapters and table of contents?

0

This was a problem with the printchaptertitle command.

The updated chapterstyle:

\makechapterstyle{mit}{%
  \renewcommand{\printchaptername}{\chaptername\ }
  \renewcommand{\chapternamenum}{}
  \renewcommand{\printchapternum}{%
   \thechapter
  }%
  \renewcommand{\afterchapternum}{\par}%
  \renewcommand{\printchaptertitle}[1]{%
    {\raggedright\large\setSpacing{1.5}\textbf{##1}}
  }
  \renewcommand{\afterchaptertitle}{\\\rule{\linewidth}{0.2pt}\par\nobreak\vskip0.5\baselineskip}%
}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.