使用 SIAM 模板的证明环境末尾 QED 符号的位置不稳定

使用 SIAM 模板的证明环境末尾 QED 符号的位置不稳定

我已经遇到了问题(描述如下:使用 SIAM LaTeX 模板文件时出现 amsmath 包错误) 使用最新版本的 SIAM LaTeX 模板http://www.siam.org/journals/auth-info.php

现在,我想澄清一下为什么 QED 符号在证明环境取决于方程环境类型。使用手册中的示例\begin{displaymath}\end{displaymath}

\begin{corollary}
  Let $f(x)$ be continuous and differentiable everywhere. If $f(x)$
  has at least two roots, then $f’(x)$ must have at least one root.
\end{corollary}
\begin{proof}
  Let $a$ and $b$ be two distinct roots of $f$.
  By \cref{thm:mvt}, there exists a number $c$ such that
  \begin{displaymath}
    f’(c) = \frac{f(b)-f(a)}{b-a} = \frac{0-0}{b-a} = 0.
  \end{displaymath}
\end{proof}

将 QED 符号放在正确的位置(等式的末尾)。 在此处输入图片描述

然而,$$ $$在证明环境中完全不存在使用 QED 符号的情况:

\begin{corollary}
    Let $f(x)$ be continuous and differentiable everywhere. If $f(x)$
    has at least two roots, then $f’(x)$ must have at least one root.
\end{corollary}
\begin{proof}
    Let $a$ and $b$ be two distinct roots of $f$.
    By \cref{thm:mvt}, there exists a number $c$ such that
    $$
    f’(c) = \frac{f(b)-f(a)}{b-a} = \frac{0-0}{b-a} = 0.
    $$
\end{proof}

在此处输入图片描述

最后,使用\begin{equation*}\end{equation*}将 QED 符号放在错误的位置,即方程式上方。

\begin{corollary}
  Let $f(x)$ be continuous and differentiable everywhere. If $f(x)$
  has at least two roots, then $f’(x)$ must have at least one root.
\end{corollary}
\begin{proof}
  Let $a$ and $b$ be two distinct roots of $f$.
  By \cref{thm:mvt}, there exists a number $c$ such that
  \begin{equation*}
    f’(c) = \frac{f(b)-f(a)}{b-a} = \frac{0-0}{b-a} = 0.
  \end{equation*}
\end{proof}

在此处输入图片描述

我的问题如下:

  1. 对于任何包含数学方程式并在其末尾添加 QED 符号的证明环境来说,这种行为是否是典型现象?或者这是 SIAM 模板文件中的另一个“错误”?

  2. 在证明环境中输入数学方程式的正确方法是什么?以前我最常使用\begin{equation*}\end{equation*},但在这里它会产生错误的行为。

答案1

首先,永远不要$$...$$在 LaTeX 中使用:你已经发现了另一个原因,但请看一下为什么 \[ ... \] 比 $$ ... $$ 更可取?

ntheorem其次,该选项的另一个特点是thmmarks,它可以修改部分环境(但不是全部),以便自动放置墓碑。

特别是equation*没有重新定义,所以它不符合自动放置。您可以通过重新定义它来使其兼容。

\documentclass[
  %review
]{siamart0516}
\usepackage{amsmath}

\usepackage{etoolbox}
% fix for https://tex.stackexchange.com/questions/328946
\patchcmd{\SetTagPlusEndMark}{$}{}{}{}
\patchcmd{\SetTagPlusEndMark}{$}{}{}{}

% fix for the QED in equation*    
\renewenvironment{equation*}{\[}{\]\ignorespacesafterend}

\begin{document}
\begin{equation}
\bar{x} = x + y
\tag{$\bar{x}$}
\label{eq:x}
\end{equation}

\begin{corollary}
  Let $f(x)$ be continuous and differentiable everywhere. If $f(x)$
  has at least two roots, then $f’(x)$ must have at least one root.
\end{corollary}
\begin{proof}
  Let $a$ and $b$ be two distinct roots of $f$.
  By \cref{thm:mvt}, there exists a number $c$ such that
  \begin{displaymath}
    f’(c) = \frac{f(b)-f(a)}{b-a} = \frac{0-0}{b-a} = 0.
  \end{displaymath}
\end{proof}

\begin{corollary}
  Let $f(x)$ be continuous and differentiable everywhere. If $f(x)$
  has at least two roots, then $f’(x)$ must have at least one root.
\end{corollary}
\begin{proof}
  Let $a$ and $b$ be two distinct roots of $f$.
  By \cref{thm:mvt}, there exists a number $c$ such that
  \begin{equation*}
    f’(c) = \frac{f(b)-f(a)}{b-a} = \frac{0-0}{b-a} = 0.
  \end{equation*}
\end{proof}

\begin{corollary}
  Let $f(x)$ be continuous and differentiable everywhere. If $f(x)$
  has at least two roots, then $f’(x)$ must have at least one root.
\end{corollary}
\begin{proof}
  Let $a$ and $b$ be two distinct roots of $f$.
  By \cref{thm:mvt}, there exists a number $c$ such that
  \begin{equation}
    f’(c) = \frac{f(b)-f(a)}{b-a} = \frac{0-0}{b-a} = 0.
  \end{equation}
\end{proof}

\end{document}

但是,equation不会将 QED 推到与 相同的位置equation*(我认为 中的放置是错误的equation*,但显然这让 的作者感到高兴ntheorem)。

在此处输入图片描述

相关内容