7

I've set skipbelow=0pt. I still have vertical spacing below every box. I think this has to do with the paragraph spacing. Is there a way to disable this for mdframed? I'd like to avoid using \vspace{-5pt} after every box, since this makes behave my multicols layout weird (page breaks in the middle of the page).

How can I get rid of the spacing after every box? (Disable new line? Disable paragraph spacing just for mdframed boxes? ...)

Here's a MWE

\documentclass[a4paper,8pt]{article}

\usepackage{mdframed}
\mdfdefinestyle{myframe}{%
    outerlinewidth=1pt,
    skipabove=0pt,
    skipbelow=0pt
}

\begin{document}

\begin{mdframed}[style=myframe]
Hello
\end{mdframed}
% Annoying space in between, despite skipabove=skipbelow=0pt
\begin{mdframed}[style=myframe]
Hello
\end{mdframed}

\end{document}
ndrizza
  • 479

1 Answers1

11

Setting skipabove and skipbelow to 0pt globaly with the \mdfsetup command does the trick (mdframed version 1.9b).

\documentclass[a4paper,8pt]{article}

\usepackage{mdframed}
\mdfsetup{skipabove=0pt,skipbelow=0pt}

\mdfdefinestyle{myframe}{%
    outerlinewidth=1pt
}

\begin{document}

\begin{mdframed}[style=myframe]
Hello
\end{mdframed}
\begin{mdframed}[style=myframe]
Hello
\end{mdframed}


\end{document}
  • 1
    Thanks! That worked! The approach of Steven B. Segelets with \unskip also works. However, with Seven's approach, if one still wants to have some exact amount of space greater than 0, then one needs to add \vskip ...pt after \unskip. – ndrizza Sep 17 '15 at 14:32
  • 1
    Any idea why setting it globally works but setting it just for a specific environment doesn't? – nog642 Oct 20 '21 at 21:36