我怎样才能从所有引理证明中删除 qed 符号?

我怎样才能从所有引理证明中删除 qed 符号?

以下代码只会使 qed 不出现在第二个证明中。但是,是否可以使 qed 符号永远不会出现在证明的末尾,而不必每次都在本地指定它?

\documentclass{article}
\usepackage{amsthm}
\begin{document}
\begin{proof}
This has the QED symbol.
\end{proof}
\begin{proof}\renewcommand{\qedsymbol}{}
This hasn't.
\end{proof}
\begin{proof}
And this has it again.
\end{proof}
\end{document}

答案1

一个简单的解决方案是添加

\renewcommand{\qedsymbol}{}

在序言中,但这实际上不起作用,如以下示例所示:

\documentclass{article}
\usepackage{amsthm}

\renewcommand{\qedsymbol}{}

\begin{document}
\begin{proof}
A one liner
\end{proof}
\begin{proof}
This ends with a display
\[
0=0.
\]
\end{proof}
\begin{proof}
Another one liner.
\end{proof}
\end{document}

在此处输入图片描述

您仍应\qedhere在显示屏上显示以获得更好的间距。

最好修改一下定义,proof删除QED业务。

\documentclass{article}
\usepackage{amsthm}

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
%  \pushQED{\qed}% <--- remove the QED business
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{.}]\ignorespaces
}{%
%  \popQED% <--- remove the QED business
  \endtrivlist\@endpefalse
}
\renewcommand\qedhere{} % to ensure code portability
\makeatother

\begin{document}
\begin{proof}
A one liner
\end{proof}
\begin{proof}
This ends with a display
\[
0=0.
\]
\end{proof}
\begin{proof}
Another one liner.
\end{proof}
\end{document}

在此处输入图片描述

您仍然可以拥有\qedhere,但它不会产生任何效果,因此复制已使用该命令的代码不会带来意外。

答案2

如果你不想在所有proofs 中使用 qed 符号,请使用etoolbox

\AtBeginEnvironment{proof}{\renewcommand{\qedsymbol}{}}{}{}

梅威瑟:

\documentclass{article}
\usepackage{amsthm}
\usepackage{etoolbox}
\AtBeginEnvironment{proof}{\renewcommand{\qedsymbol}{}}{}{}
\begin{document}
\begin{proof}
This has the QED symbol.
\end{proof}
\begin{proof}
This hasn't.
\end{proof}
\begin{proof}
And this has it again.
\end{proof}
\end{document}

或者定义一个新的myproof

\documentclass{article}
\usepackage{amsthm}
\makeatletter
\newenvironment{myproof}[1][\proofname]{\par
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{.}]\ignorespaces
}{%
  \endtrivlist\@endpefalse
}
\makeatother
\begin{document}
\begin{proof}
This has the QED symbol.
\end{proof}
\begin{myproof}
This hasn't.
\end{myproof}
\begin{proof}
And this has it again.
\end{proof}
\end{document}

在此处输入图片描述

相关内容