I have the following definition (MWE below) of a lrbox
. If I use the normal setting parskip=off
the interaction \mdf@restoreparams
works as expected. Inside the lrbox
I can use parskip
and parindent
. But if I use the option parskip=half
I get an extra skip at the beginning of the save box. How can I avoid this.
Picture
MWE:
\documentclass[parskip=half]{scrreprt}
\usepackage{kantlipsum}
\catcode`\@11\relax
\def\mdf@lrbox#1{%
\edef\mdf@restoreparams{%
\parindent=\the\parindent \parskip=\the\parskip}%
\setbox#1\vbox\bgroup%
\color@begingroup%
% \mdf@horizontalmargin@equation%
\columnwidth=\hsize%
\textwidth=\hsize%
\let\if@nobreak\iffalse%
\let\if@noskipsec\iffalse%
\let\par\@@par%
\let\-\@dischyph%
\let\'\@acci\let\`\@accii\let\=\@acciii%
\parindent\z@ \parskip\z@skip%
\linewidth\hsize%
\@totalleftmargin\z@%
\leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip%
\parfillskip\@flushglue \lineskip\normallineskip%
\baselineskip\normalbaselineskip%
%% \sloppy%
\let\\\@normalcr%
\hrule \@height\z@ \@width\hsize\relax
\mdf@restoreparams\relax
\@afterindentfalse%
\@afterheading%
}
\def\endmdf@lrbox{\color@endgroup\egroup}
\newbox\MyTestBox
\begin{document}
\mdf@lrbox\MyTestBox
\kant[1]
\kant[1]
\endmdf@lrbox
\fbox{\box\MyTestBox}
\end{document}
I didn't tag this question with KOMA
because the same result is reached by the header with a standard class
\documentclass[]{report}
\usepackage{parskip}
or with memoir
\documentclass[]{memoir}
\setlength{\parindent}{0pt}
\nonzeroparskip