# Using package resizegather leads to extra vertical space inside mdframed equations

When I try to add package resizegather, extra vertical space is added into mdframed equations. By gradually truncating the code, I found that commenting package resizegather would fix the problem. See figure below. But I have no idea, what is behind that. I found similar issues described in tasks:

but it didn't help

MNWE:

\documentclass{scrbook}

\usepackage{mdframed}
\usepackage{amsmath}
\usepackage{resizegather}
\usepackage{blindtext}

\begin{document}
\chapter{My title test 7}
\blindtext
\begin{mdframed}
$$\label{mai:eq1} \boxed{\int f(x) dx = F(x) + c}$$
\end{mdframed}
\blindtext
\end{document}


You can solve the problem with nccmath and its \useshortskip command:

\documentclass{scrbook}

\usepackage{mdframed}
\usepackage{amsmath, nccmath}
\usepackage{resizegather}
\usepackage{blindtext}

\begin{document}
\chapter{My title test 7}
\blindtext
\begin{mdframed}\useshortskip
$$\label{mai:eq1} \boxed{\int f(x) dx = F(x) + c}$$
\end{mdframed}
\blindtext
\end{document}


• Thank you so much for the solution. Can you explain to me what's going on there? Sep 30, 2020 at 8:18
• I really don't know why mdframed behaves this way. For the vertical spacing of displayed equations, two kind of rubber lengths can be used: \abovedisplayskip and \abovedisplayshortskip, depending on the length of the last line of text above the equation. The nccmath command, as you can guess, forces the use of the short version. Sep 30, 2020 at 8:26