删除连续 mdframed 框之间的一些空间

删除连续 mdframed 框之间的一些空间

下面是一个 MWE。简而言之,我想改变连续框之间的间距,而不影响框和文本之间的间距。

\documentclass[11pt]{report}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{mdframed}
\usepackage{amsthm}
\usepackage{thmtools}

\mdfsetup{
    skipabove=0.8\baselineskip,
    skipbelow=0.3\baselineskip,
    innerbottommargin=8pt,
}

\declaretheoremstyle[
headfont=\sffamily\bfseries,
mdframed={},
headpunct={\\[3pt]},
postheadspace={3pt},
]{thmtheorembox}

\declaretheoremstyle[
headfont=\sffamily\bfseries,
mdframed={},
headpunct={\\[3pt]},
postheadspace={3pt},
]{thmdefinitionbox}

\mdfdefinestyle{mdproofbox}{
    skipabove=0.3\baselineskip,
    skipbelow=0.3\baselineskip,
    innerbottommargin=6pt,
}
\surroundwithmdframed[style=mdproofbox]{proof}

\declaretheorem[style=thmtheorembox,name=Theorem]{theorem}
\declaretheorem[style=thmdefinitionbox,name=Definition]{definition}

\begin{document}
    
    Here I have some text before a box.
    
    \begin{definition}
        This is a dummy \textbf{definition}.
    \end{definition}
    
    I am happy with the amount of space when there is text between the boxes.
    
    \begin{theorem}
        This is a dummy theorem.
    \end{theorem}

    \begin{definition}
        But I feel there is too much \textbf{space} between two consecutive boxes. Is there any way to reduce the amount of space between boxes without affecting the spacing of boxes surrounded by text?
    \end{definition}
    
    \begin{proof}
        Ideally, I would want the amount of space between consecutive boxes to be like the one between Definition 2 and this proof.
    \end{proof}
    
\end{document}

相关内容