I'm trying to reproduce this chapter heading (Styling my section/chapter) in memoir
. This is more or less working with the following code:
\documentclass[11pt,oneside]{memoir}
\usepackage{blindtext}
\makechapterstyle{uno}{%
\setlength{\midchapskip}{5pt}
\renewcommand{\chapnumfont}{\Huge\bfseries}
\renewcommand{\printchaptername}{}%
\renewcommand*{\chapternamenum}{}
\renewcommand{\printchapternum}{}%
\renewcommand{\chaptitlefont}{\Huge\bfseries\scshape}
\renewcommand{\printchaptertitle}[1]{%
\hspace*{-0.1\textwidth}\chaptitlefont ##1}
\renewcommand{\afterchaptertitle}{%
\vskip -2pt \hspace*{-\marginparwidth}\rule{0.7\textwidth}{5pt}}
}
\chapterstyle{uno}
\begin{document}
\chapter{Es war einmal ein Mann}
\blindtext[1]
\end{document}
But my question: Why does the following code:
\renewcommand{\afterchaptertitle}{%
\vskip\midchapskip\hspace*{-\marginparwidth}\rule{0.7\textwidth}{5pt}}
}
leave such a large separation to the rule? As far as I understand, \vskip
is creating a new paragraph. But if I use
\renewcommand{\afterchaptertitle}{%
\vskip\midchapskip\hrule}
}
there is no separation at all (only the 5pt
of \midchapskip
). \rule
and \hrule
are behaving differently, but I can not understand why and I did not see a good explanation for this.
Best Answer
\hrule
is a vertical mode command so in vertical mode stacks directly under the previous thing.The LaTeX
\rule
starts with\leavevmode
and so is a horizontal mode command and so if used in vertical mode you will get a vertical\parskip
space and a horizontal\parindent
.You will see the same behaviour if you compare
\hbox{hello}
with\mbox[hello}
(Also in your example you have
\hspace*
in the\rule
example which similarly is a horizontal command.)Perhaps this is closer to your needs