Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 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

 \renewcommand{\afterchaptertitle}{{%
   \par\offinterlineskip\hbox{\hspace*{-\marginparwidth}\rule{0.7\textwidth}{5pt}}}}
share|improve this answer
1  
Many thanks for your answer. I'm reading right now doc about the two TEX modes in order to understand it. Where can I see the definition of \rule? –  rogorido Apr 11 '12 at 17:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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