I'm trying to use LaTeX for my current ODE lecture and use mdframed for a "boxed proposition" to make it easier for the reader to distinguish the formulation from the proof.

This is what I use to create the boxed environment "proposition"



My problem is that this seems to include more spacing at the top of the proposition that at the bottom. Take a look here

enter image description here

The top contains almost one whole line of space, while the bottom seems a little narrow. How can I change this behaviour to even the spacing or even increase the bottom spacing?

2 Answers 2


You can adjust the spacing of your proposition environment with options passed in the first optional argument of newmdtheoremenv. Specifically, you can remove any inner margin by setting innertopmargin to 0, or to a negative value if needed. For more details, see the documentation of mdframed.

It might be important to note that other lengths in a document may influence the behavior of mdframed environments' margins. The examples below show the influence of parskip, but I don't think it's the only length that influences.




Here is the proposition with default settings.

Here is the proposition with \textnormal{\texttt{innertopmargin=0pt}}.

Here is the proposition with \textnormal{\texttt{innertopmargin=-2pt}}.


With the code above, where parskip is set to 0, we get: Using the same code, but changing parskip to 6pt, we get:

  • Thank you, but if I set innerbottommargin = innertopmargin = 0pt I still get more space at the top. Why is this the case? In your example you don't set the innerbottommargin (it defaults to 5px). Dec 7, 2019 at 17:14
  • I know that other lengths influence how mdframed environments behave, so I'd say it's probably another length in your document. For example, if you change parskip, the margins will change. But if you want the top margin to be decreased more than what it is when it is set to 0, you can always define a negative length for innertopmargin.
    – Vincent
    Dec 7, 2019 at 17:29
  • I edited my answer to give some examples of how parskip influences the margins, but I think other lengths might have a similar behavior. I'm no expert, but in my experience, it's simpler to adjust the margins of mdframed environments at the end, when other lengths are fixed.
    – Vincent
    Dec 7, 2019 at 18:05

I had the exact same issue and discovered that the excess top margin disappeared if I removed the amsthm package from my preamble. I can't say that yours is caused by the same problem, but it could be something similar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .