TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get the resheading box to be shorter in vertical space. Right now it appears that I have about 2 cm vertical space on the top and bottom of the text. How can I fix this?

Everything I think to be relevant:

\definecolor{shadecolor}{gray}{0.85}  % Background color of title bars

        \textbf{\sffamily{\mbox{~}{\large #1} \vphantom{p\^{E}}}}
share|improve this question
up vote 3 down vote accepted

I would suggest you to use the features provided by the mdframed package:


\definecolor{shadecolor}{gray}{0.85}  % Background color


        \noindent\sffamily\bfseries\large #1


enter image description here

Using aboveskip=<value>, belowskip=<value>, and/or the other options, you can highly (and easily) customize your shaded environment.

share|improve this answer
I must insert a font key to the package ;-) – Marco Daniel Sep 22 '11 at 19:05

This ended up doing the trick:

    \vspace{-0.1in} % this line
    \textbf{\sffamily{\mbox{~}{\large #1} \vphantom{p\^{E}}}}
    \vspace{-0.1in} % and this line

I didn't realize that \vspace is position sensitive.

share|improve this answer

Your Answer


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.