![为什么我的定理下面的空间没有显示出来?](https://linux22.com/image/299930/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E7%9A%84%E5%AE%9A%E7%90%86%E4%B8%8B%E9%9D%A2%E7%9A%84%E7%A9%BA%E9%97%B4%E6%B2%A1%E6%9C%89%E6%98%BE%E7%A4%BA%E5%87%BA%E6%9D%A5%EF%BC%9F.png)
我amsthm
用 来设计我的定理mdframed
。我尝试在定理之前和下方添加一些空间,skipabove
如skipbelow
所述这里在第 6 页。
\documentclass{article}
\usepackage{amsthm, mdframed}
\parindent 0pt
\definecolor{mygray}{gray}{0.95}
\mdfdefinestyle{mythm}{
backgroundcolor=mygray,
linewidth=0pt,
innertopmargin=0pt,
innerbottommargin=6pt,
skipabove=20pt,
skipbelow=20pt
}
\newmdtheoremenv[style=mythm]{thm}{Theorem}
\begin{document}
This comes before the theorem.
\begin{thm}
This is my theorem.
\end{thm}
This comes after the theorem.
\end{document}
但是底部的间距并未显示出来。
出了什么问题?我该如何解决?
答案1
我已向作者发送了以下 MWE:
\documentclass{article}
\usepackage{amsthm, mdframed}
\definecolor{mygray}{gray}{0.95}
%
% notice how skipbelow is ignored
\mdfdefinestyle{mythm}{
backgroundcolor=mygray,
linewidth=0pt,
innertopmargin=0pt,
innerbottommargin=6pt,
skipabove=5em,
skipbelow=5em,
}
\newmdtheoremenv[style=mythm]{thm}{Theorem}
% if we use this instead, it works
% \mdfsetup{
% backgroundcolor=mygray,
% linewidth=0pt,
% innertopmargin=0pt,
% innerbottommargin=6pt,
% skipabove=5em,
% skipbelow=5em,
% }
% \newmdtheoremenv{thm}{Theorem}
\usepackage{kantlipsum}
\begin{document}
\kant*[2]
\begin{thm}
This is my theorem.
\end{thm}
\kant*[2]
\end{document}