0

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} \begin{equation}\label{mai:eq1} \boxed{\int f(x) dx = F(x) + c} \end{equation} \end{mdframed} \blindtext
\end{document}

using of the package resizegather

JardaFait
  • 3,922

1 Answers1

1

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 \begin{equation}\label{mai:eq1} \boxed{\int f(x) dx = F(x) + c} \end{equation} \end{mdframed} \blindtext \end{document}

enter image description here

Bernard
  • 271,350
  • Thank you so much for the solution. Can you explain to me what's going on there? – JardaFait Sep 30 '20 at 08:18
  • 1
    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. – Bernard Sep 30 '20 at 08:26