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.


\leavevmode\vspace{-3.75ex}just before\begin{shaded*}(found by trial and error). – Bernard Apr 16 '22 at 09:14\topskip(initially10pt). Setting it to0ptworks, but a zero\topskipis not ideal for pages that starts with textual content. – muzimuzhi Z Apr 16 '22 at 09:15