修改证明环境

修改证明环境

我希望修改proof给定的环境,amsthm以便

  1. “proof” 一词后面有一个空格
  2. qed 符号插入到证明结束后不久,而不是右移。
  3. “证明”一词以粗体而不是斜体印刷。

第三个问题之前已经问过了,我通过代码实现了它

\let\oldproofname=\proofname
\renewcommand{\proofname}{\rm\bf{\oldproofname}}

2 我很乐意每次都手动输入命令,通过关闭旧的 qed 符号并通过以下方式创建一个新的 qed 符号

\renewcommand{\qedsymbol}{}
\newcommand{\qd}{\,\, \raisebox{-2pt}{\scalebox{2}{$\square$}}}

但我确信还有比这更好的方法。

第一点我不知道如何完成。

我喜欢证明环境的其他一切,并且我想保留它。

一种可能性是:如果我知道证明环境的默认值,我可以这样做\renewenvironment并使其基本保持相同,但在哪里可以找到这些,以及每个含义的解释?

答案1

以下是您需要的更改(但我没有更改\qedhere,因为这需要更多的工作)。

\documentclass{article}
\usepackage{amsthm}

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[%
    \hskip\labelsep
    \normalfont\bfseries % was \itshape
    #1%
    \@addpunct{.}% remove this if you don't want punctuation
  ]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\let\qed\relax % avoid a warning
\DeclareRobustCommand{\qed}{%
  \ifmmode \mathqed
  \else
    \leavevmode\unskip\penalty\@M\hbox{}\nobreak\hspace{.5em minus .1em}% was \hfill
    \hbox{\qedsymbol}%
  \fi
}
\makeatother

\begin{document}

\begin{proof}
This proof ends here.
\end{proof}

\begin{proof}
This proof is quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
longerrrrr.
\end{proof}

\noindent\textbf{Proof.}
This proof is quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
quite longer
longerrrrr.


\end{document}

在此处输入图片描述

最后一段是为了说明 QED 为何不会自行形成一条直线。这一minus .1em部分是为了在困难的情况下提供一点灵活性。

相关内容