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.

Here is the code I am using to place a heading with a line above and below the text, from this post.

\newcommand{\rheading}[1]
{
    \par
    \bigskip
    \hrule height 1pt
    \kern 5pt
    \hbox to \textwidth{\textbf{\mediumletterspace{#1}}\hfil}
    \kern 5pt
    \hrule height 0.2pt
    \kern\smallskipamount
}

However, with the \par at the beginning, there is \parskip vertical space followed by a \bigskip vertical space. I want to make this skip the same, regardless of the length of \parskip. How do I accomplish this? Also, if I get rid of the \par, there is no vertical skip at all and not even a line break. Why?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

you can use \addvspace\bigskipamount (or with braces around \bigskipamount if this is just a single token; it doesn't make any difference). it's always prudent to insert \par.

the reason there is no vertical space -- or even a line break -- if you don't include \par is that the \vspace doesn't take effect until there is actually a transition to vertical mode, which will actually happen at the next "normal" line break. this is sometimes used as a method for spacing down a bit before the next line when you're not sure exactly where the line will end. similarly, placing \newpage in the middle of a text line will start a new page as soon as the current line ends normally.

share|improve this answer
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.