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

0

1 Answer 1

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

2
  • Thank you so much for the solution. Can you explain to me what's going on there?
    – JardaFait
    Sep 30, 2020 at 8: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, 2020 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.