定理末尾的指示符

定理末尾的指示符

我正在写一篇包含非常长的定理环境的文章,我发现斜体定理在很长的时候看起来不太美观。所以我使用定义大多数情况下,这种方法都是定理风格。然而,这种方法的缺点是,定理何时结束并不明确。我尝试过以下方法:

\documentclass{book}
\usepackage{amsthm}
\parindent0pt

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newenvironment{thm}{\begin{theorem}}{\hfill$\diamond$\end{theorem}}

\begin{document}

\begin{thm} This is some long theorem. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 

\begin{enumerate}
\item Part A
\item Part B
\end{enumerate}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \end{thm}

Here is some text not in the theorem anymore.

\begin{thm}
Here is some other theorem that ends with a list.
\begin{enumerate}
\item Part 1
\item Part 2 
\end{enumerate} 
\end{thm}

Some more text.

\end{document}

结果是: LaTeX 文档

我喜欢定理 1 中的菱形指示符。它不会分散注意力,并且非常清楚地表明了定理的实际结束位置。然而,在定理 2 中,菱形的位置看起来有点尴尬。

在这种情况下您会提出什么建议?

答案1

您可以使用 QED 机制amsthm机制提供:定义适当的符号,在定理的开头推送 QED,在结尾弹出。然后,\qedhere如果您之前需要标记,则可以将其放在某处,最后的弹出将不执行任何操作。

示例输出

\documentclass{book}
\usepackage{amsthm}
\parindent0pt

\newcommand{\thmsymbol}{\( \diamond \)}

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}

\newenvironment{thm}{\begin{theorem}%
  \renewcommand{\qedsymbol}{\thmsymbol}\pushQED{\qed}}%
  {\popQED\end{theorem}}

\begin{document}

\begin{thm}
  This is some long theorem. Lorem ipsum dolor sit amet, consetetur
  sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
  et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
  accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
  no sea takimata sanctus est Lorem ipsum dolor sit amet.
  \begin{enumerate}
  \item Part A
  \item Part B
  \end{enumerate}

  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
  nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
  erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
  et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
  Lorem ipsum dolor sit amet.
\end{thm}

Here is some text not in the theorem anymore.

\begin{thm}
  Here is some other theorem that ends with a list.
  \begin{enumerate}
  \item Part 1
  \item Part 2 \qedhere
  \end{enumerate}
\end{thm}

Some more text.

\begin{proof}
  Exactly.
\end{proof}

\end{document}

相关内容