I have a page that has a shaded box at the top. How do I get the shaded box to align with the top of the page frame? There's a bit of a gap. My code:
\documentclass[10pt]{book}
\usepackage[showframe]{geometry}
\usepackage[x11names]{xcolor}
\usepackage{framed}
\colorlet{shadecolor}{LavenderBlush2}
\usepackage{lipsum}
\begin{document}
\setlength{\OuterFrameSep}{0pt}
\begin{shaded*}
\lipsum[1]
\end{shaded*}
\vfill
\begin{shaded*}
\lipsum[1]
\end{shaded*}
\end{document}
In another question (Align shaded box to bottom of page), it has been suggested to set OuterFrameSep
to 0 in order to remove the vertical space before and after the framed environment. That does seem to work for after the framed environment, but not before.
Best Answer
Try the following, it may work for you too: