
我希望建立類似定理的環境,因為這是使它們從正文中脫穎而出的有效方法。
根據貢薩洛·梅迪納的回答對這個問題定理陳述周圍的方格,包\newmdtheoremenv
中的命令mdframed
就是正確的方法。
然而,我發現這種框架定理環境前後缺乏垂直空間(見下文)。我查看了mdframed
文檔,但沒有找到任何可以解決此問題的內容。
我錯過了文檔中的某些內容嗎?
您將如何以簡單有效(自動)的方式解決這個問題?
是否有其他套件更mdframed
適合框架定理環境?
\documentclass{book}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mdframed}
\theoremstyle{definition}
\newmdtheoremenv{assum}{Assumption}[chapter]
\begin{document}
\chapter{Fluid mechanics}
\section{Fields}
The following fields are of particular interest:
\begin{itemize}
\item $\rho$: fluid density (time-dependent scalar field);
\item $p_{\text{tot}}$: total pressure in the fluid (time-dependent scalar field);
\item $v$: velocity of the fluid parcels (time-dependent vector field).
\end{itemize}
\begin{assum}[Differentiability of tensor fields]
\label{assum:differentiability}
All tensor fields of interest are differentiable (weakly, at least).
\end{assum}
Assumption~\ref{assum:differentiability} blah blah
\subsubsection{Mass-continuity equation}
The mass-continuity equation is derived from the principle of conservation of mass:
\begin{assum}[Conservation of mass]
\label{assum:conservation_of_mass}
Fluid density $\rho$ is a conserved quantity within fluid parcels:
if $V_{\text{fp}}(t)$ delimits a region of space occupied by a fluid parcel
at time $t$, then
\begin{equation}
\frac{\mathrm{d}\phantom{t}}{\mathrm{d}t}
\iiint_{ V_{\text{fp}}(t)} \rho \, \mathrm{d}V = 0\,.
\end{equation}
\end{assum}
blablah
\end{document}
答案1
是的,您錯過了可以將選項傳遞給環境;特別是你可以使用skipabove=<length>
,skipbelow=<length>
:
\newmdtheoremenv[skipabove=\topsep,skipbelow=\topsep]{assum}{Assumption}[chapter]
你的例子:
\documentclass{book}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mdframed}
\theoremstyle{definition}
\newmdtheoremenv[skipabove=\topsep,skipbelow=\topsep]{assum}{Assumption}[chapter]
\begin{document}
\chapter{Fluid mechanics}
\section{Fields}
The following fields are of particular interest:
\begin{itemize}
\item $\rho$: fluid density (time-dependent scalar field);
\item $p_{\text{tot}}$: total pressure in the fluid (time-dependent scalar field);
\item $v$: velocity of the fluid parcels (time-dependent vector field).
\end{itemize}
\begin{assum}[Differentiability of tensor fields]
\label{assum:differentiability}
All tensor fields of interest are differentiable (weakly, at least).
\end{assum}
Assumption~\ref{assum:differentiability} blah blah
\subsubsection{Mass-continuity equation}
The mass-continuity equation is derived from the principle of conservation of mass:
\begin{assum}[Conservation of mass]
\label{assum:conservation_of_mass}
Fluid density $\rho$ is a conserved quantity within fluid parcels: if $V_{\text{fp}}(t)$ delimits a region of space occupied by a fluid parcel at time $t$, then
\begin{equation}
\frac{\mathrm{d}\phantom{t}}{\mathrm{d}t} \iiint_{ V_{\text{fp}}(t)} \rho \, \mathrm{d}V = 0\,.
\end{equation}
\end{assum}
blablah
\end{document}
這回答了您的前兩個問題;關於第三個,如果您的框架必須允許分頁,那麼可能性基本上是mdframed
或 framed
;這個問題對它們進行了比較:框架還是mdframed? (優點缺點)。