与环境对比amsthm
,环境之间的差距mdframed
比更大amsthm
。
MWE 如下
\PassOptionsToPackage{svgnames}{xcolor}
\documentclass{book}
\usepackage{xcolor,amsthm,mdframed}
\makeatletter
\theoremstyle{definition}
\def\th@definition{%
\thm@notefont{}% same as heading font
\normalfont % body font
}
\newmdtheoremenv[
hidealllines=true, linecolor=MidnightBlue,
leftline=true, linewidth=.5ex,
innerleftmargin=1.5ex, innerrightmargin=0pt,
innertopmargin=-1.7ex, innerbottommargin=0]
{definition}
{\color{MidnightBlue}Definition}[chapter]
\newtheorem{lemma}{Lemma}
\begin{document}
A test with singlespacing:
\begin{definition}[The Definition Environment]\leavevmode\newline
From WikipediA: A definition is used to give a precise meaning to a new term, by describing a condition which unambiguously qualifies what a mathematical term is and is not.
\end{definition}
\begin{definition}[The Definition Environment]\leavevmode\newline
From WikipediA: A definition is used to give a precise meaning to a new term, by describing a condition which unambiguously qualifies what a mathematical term is and is not.
\end{definition}
\begin{lemma}[The Lemma Environment]
\end{lemma}
\begin{lemma}[The Lemma Environment]
\end{lemma}
A test with onehalfspacing:
\linespread{1.5}
\begin{definition}[The Definition Environment]\leavevmode\newline
From WikipediA: A definition is used to give a precise meaning to a new term, by describing a condition which unambiguously qualifies what a mathematical term is and is not.
\end{definition}
\begin{definition}[The Definition Environment]\leavevmode\newline
From WikipediA: A definition is used to give a precise meaning to a new term, by describing a condition which unambiguously qualifies what a mathematical term is and is not.
\end{definition}
\begin{lemma}[The Lemma Environment]
\end{lemma}
\begin{lemma}[The Lemma Environment]
\end{lemma}
\end{document}
答案1
长度选项框架框在其文档的第 6.3 节中进行了描述。尝试skipabove
并skipbelow
:
\newmdtheoremenv[
skipabove=0pt, skipbelow=0pt,
hidealllines=true, linecolor=MidnightBlue,
leftline=true, linewidth=.5ex,
innerleftmargin=1.5ex, innerrightmargin=0pt,
innertopmargin=-1.7ex, innerbottommargin=0]
{definition}