When using the mdframed environment with absolutely tight margins (all set 0pt), there is too much negative vertical space of split md-frames that are placed at the top of a page.

To illustrate this, the minimal working example creates two text pages, the second of which contains text in an md-frame, clearly not aligned with the text in the first page.

I created the example using a command \FOO, which calls an environment valignFOO that contains the actual mdframed environment named mdframedFOO, the latter of which has margin sizes of zero and a small frame for visual reference.

valignFOO is responsible for Making mdframed paragraph behave like normal paragraphs in terms of spacing. But even by using that improvement with respect to vertical spacing, I still observe extra space as described above.



% New mdframed environment called mdframedFOO:
\newmdenv[leftmargin        = 0pt,
          rightmargin       = 0pt,
          innerleftmargin   = 0pt,
          innerrightmargin  = 0pt,
          innertopmargin    = 0pt,
          innerbottommargin = 0pt,
          skipabove         = 0pt,
          skipbelow         = 0pt,
          splittopskip      = 0pt,
          splitbottomskip   = 0pt,
          outerlinewidth    = 1pt,
          middlelinewidth   = 0pt,
          innerlinewidth    = 0pt,
          topline           = false,
          bottomline        = false

% Correct vertical alignment of mdframedFOO:
% (This is for making mdframed behave like a normal paragraph,
%  see https://tex.stackexchange.com/questions/88525/making-mdframed-paragraph-behave-like-normal-paragraphs-in-terms-of-spacing)

% FOO:

  • I am not seeing additional vertical spacing at the top of the 2nd page. The output I get is here. Feb 9 '17 at 8:15

Your Answer

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

Browse other questions tagged or ask your own question.