我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}