Vertical spacing issue on box

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:

\documentclass[letterpaper,10pt]{article}
\setlength{\voffset}{0.1in}
\setlength{\paperwidth}{8.5in}
\setlength{\paperheight}{11in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textheight}{10.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\textwidth}{7in}
\setlength{\topskip}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\definecolor{shadecolor}{gray}{0.85}  % Background color of title bars

\newcommand{\resheading}[1]{
\parbox{\textwidth}{
\begin{shaded}
\textbf{\sffamily{\mbox{~}{\large #1} \vphantom{p\^{E}}}}
\end{shaded}
}
}

-

2 Answers

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

\documentclass[letterpaper,10pt]{article}
\usepackage[svgnames]{xcolor}
\usepackage{mdframed}
\usepackage{lipsum}

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

\newmdenv[backgroundcolor=shadecolor,topline=false,rightline=false,bottomline=false,
leftline=false]{infobox}

\newcommand{\resheading}[1]{%
\begin{infobox}
\noindent\sffamily\bfseries\large #1
\end{infobox}
}

\begin{document}
\lipsum[1]\resheading{\lipsum[1]}\lipsum[1]
\end{document}


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

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

This ended up doing the trick:

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


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

-