从列表开始的定理

从列表开始的定理

我想要一种强大的方法来处理以列表环境开头的定理,其中第一项位于新行。我不想使用不同的定理样式来区分带有列表的定理和不带有列表的定理。我不想在定理头和列表的第一项之间有任何分页符。

这个话题已经被讨论过很多次了,例如:

这些促使我使用 amsthm 测试以下修复:

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsthm}

\theoremstyle{plain} 
\newtheorem{theorem}{Theorem}[section] 

\title{Theorem lists test}
\begin{document}
\maketitle
\section{test}

\lipsum[1-3]

\vspace{1cm}

\begin{theorem}\leavevmode
\begin{enumerate}
\item first
\item second.
\end{enumerate}
\end{theorem}

\end{document}

或者

\documentclass{article}

\usepackage{lipsum}
\usepackage{amsthm}
\theoremstyle{plain}

\newtheorem{theorem}{Theorem}[section] 

\makeatletter
\def\enumfix{%
\if@inlabel
 \noindent \par\nobreak\vskip-\parskip\vskip-\parskip\hrule\@height\z@
\fi}
\let\oldenumerate\enumerate
\def\enumerate{\enumfix\oldenumerate}

\title{Theorem lists test}
\begin{document}
\maketitle
\section{test}

\lipsum[1-3]
\vspace{1cm}

\begin{theorem}\label{mythm}
\begin{enumerate}
\item first
\item second.
\end{enumerate}
\end{theorem}

\end{document}

所有这些 MWE 都产生了同样令人失望的结果,即定理标题后立即出现分页符。此外,我没有在定理环境的精神下使用 Needspace 找到解决方案。

当然,用 \hfill 命令代替 \leavevmode 会产生相同的结果。我使用 ntheorem 包观察到了相同的行为。

任何想法?

答案1

在第一个例子中,您可以\samepage在 之前插入\begin{enumerate};这会让上一行与列表保持在同一页面上,并且 设置的惩罚\samepage将消失\end{theorem}

建议 ams 作者采用的另一种方法是手动将枚举列表的第一行设置为定理的第一行,并以第二项开始列表本身。 \samepage如果第一项很短,则可以按照与上述相同的方式使用。

这是您的第一个例子,按照描述进行了修改。定理标题和第一项将移至第二页。

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsthm}

\theoremstyle{plain} 
\newtheorem{theorem}{Theorem}[section] 

\title{Theorem lists test}
\begin{document}
\maketitle
\section{test}

\lipsum[1-3]

\vspace{1cm}

\begin{theorem}
\hangindent\leftmargini
1.\hskip\labelsep First item.
\samepage
\begin{enumerate}
\setcounter{enumi}{1}
%\item first
\item second.
\end{enumerate}
\end{theorem}

\end{document}

相关内容