3

I am using the mdframed package along with the options skipabove and skipbelow and although the vertical space above the box is appearing, as it should, the space below does't appear! What am I doing wrong and it doesn't appear? How should I fix it?

As an extra question why when I use the parskip package instead of adding vertical space above and below it does the exact opposite?

enter image description here

MWE

\documentclass{article}

\usepackage{mdframed}

\begin{document}

Text above

\begin{mdframed}[skipabove=2cm, skipbelow=2cm]

Text in box

\end{mdframed}

Text below

\end{document}
5

If you want to try with tcolorbox, it seems that before skip and after skip work as expected.

\documentclass{article}

\usepackage{tcolorbox}

\begin{document}

Text above

\begin{tcolorbox}[before skip=2cm, after skip=2cm]

Text in box

\end{tcolorbox}

Text below

\end{document}

enter image description here

Update: more minimalistic

If `more minimalistic` means a box like the one shown in question, it's not too difficult to get a similar one with `tcolorbox`

\documentclass{article}

\usepackage{tcolorbox}

\newtcolorbox{minimal}{%
    sharp corners, colback=white, colframe=black, notitle,
    before skip=2cm, after skip=2cm}

\begin{document}

Text above

\begin{minimal}

Text in box

\end{minimal}

Text below

\end{document}

enter image description here

8
  • Damn, you were quicker with tcolorbox (;-)). Actually, I never got mdframed to work as I intended. (+1) – user31729 May 2 '16 at 19:07
  • @ChristianHupfer i think it is a known problem in mdframed – daleif May 2 '16 at 19:12
  • @daleif: I see -- thanks for information. – user31729 May 2 '16 at 19:13
  • Thanks. I use tcolorbox sometimes but mdframed seemed more minimalistic in this case. If this is a known issue then I will use the tcolorbox again. – Adam May 2 '16 at 19:16
  • @ChristianHupfer Don't worry, next time you will the faster. As usual. ;-) – Ignasi May 2 '16 at 19:40

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.