Grey box code and lists
Using \colorbox
from the color
package instead would be better than a plain TeX macro:
\usepackage{color}
\definecolor{lightgray}{gray}{0.75}
\newcommand\greybox[1]{%
\vskip\baselineskip%
\par\noindent\colorbox{lightgray}{%
\begin{minipage}{\textwidth}#1\end{minipage}%
}%
\vskip\baselineskip%
}
The result:
The solution doesn't allow any pagebreaks. You should use a package like framed
or mdframed
(new version is on the way ;-) I'm working on it. ):
\documentclass{article}
\usepackage[noframe]{showframe}
\usepackage{framed}
\usepackage{lipsum}
\renewenvironment{shaded}{%
\def\FrameCommand{\fboxsep=\FrameSep \colorbox{shadecolor}}%
\MakeFramed{\advance\hsize-\width \FrameRestore\FrameRestore}}%
{\endMakeFramed}
\definecolor{shadecolor}{gray}{0.75}
\begin{document}
\lipsum[1]
\begin{shaded}
\lipsum
\end{shaded}
\lipsum[2]
\end{document}