I have a code block using minted and mdframed and a caption afterwards.
\begin{mdframed}
\begin{minted}[tabsize=4]{c++}
some code
\end{minted}
\end{mdframed}
\begingroup\captionof{listing}{some caption\label{lst:label}}\endgroup
The caption however is too far away from the code.
I tried adding negative vertical space right after the frame, however it doesn't work correctly.
Up to \vspace{-4em}
nothing happens, but with \vspace{-5em}
, the caption is moved right into the code block.
How can I move the caption that it is positioned right after the code block?