![证明的名称而不仅仅是证明](https://linux22.com/image/291113/%E8%AF%81%E6%98%8E%E7%9A%84%E5%90%8D%E7%A7%B0%E8%80%8C%E4%B8%8D%E4%BB%85%E4%BB%85%E6%98%AF%E8%AF%81%E6%98%8E.png)
我正在使用的软件包:
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{amsthm}
\usepackage{amssymb}
\newtheorem{thm}{Theorem}
\newtheorem{lma}{Lemma}
\newtheorem{df}{Definition}
\newtheorem{axiom}{Axiom}
\theoremstyle{definition}
\newtheorem{exmp}{Example}[section]
我正在尝试证明一个定理,并且得到以下内容:
\begin{proof} (Proof of theorem)
...
\end{proof}
仅输出“证明。(定理证明)”。
相反,我希望它显示“定理证明”。我该怎么做?我试过了
\begin{proof}[Proof of theorem \ref{maintheorem}]
Use the commutative property.
\end{proof}
输出结果为“定理证明??”但我不需要问号。我该如何解决这个问题?
答案1
首先你需要一个 来\label
“标记”定理。这样你就可以选择使用 来引用定理\ref
。如果你没有\label
某个对应的\ref
,它将显示为??(看了解引用和标签的工作原理)。
以下是适合您情况的一个设置:
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[Some theorem]\label{thm:some-theorem}
This is an important theorem.
\begin{proof}
This is a very important proof.
\end{proof}
\begin{proof}[Proof of Theorem~\ref{thm:some-theorem}]
This is a very important proof.
\end{proof}
\end{theorem}
\end{document}
我认为上面的用例是最简单的。例如,可以调整环境proof
以不同方式处理其可选参数,但这可能有点过头了。下面是一个产生相同输出的示例:
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\makeatletter
\renewenvironment{proof}[1][\relax]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep\itshape
\ifx#1\relax \proofname\else\proofname{} of #1\fi\@addpunct{.}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother
\begin{document}
\begin{theorem}[Some theorem]\label{thm:some-theorem}
This is an important theorem.
\begin{proof}
This is a very important proof.
\end{proof}
\begin{proof}[Theorem~\ref{thm:some-theorem}]
This is a very important proof.
\end{proof}
\end{theorem}
\end{document}
上述设置现在采用可选参数并在其前面加上Proof of
,假设您只包含某种引用。
答案2
由于ntheorem
具有自动处理证明结束符号的功能,因此可以使用它进行以下操作cleveref
:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{heuristica}
\usepackage{amsmath}
\usepackage[thmmarks, amsmath, thref]{ntheorem}
\usepackage{cleveref}
\theoremstyle{plain}
\theoremheaderfont{\bfseries}
\theoremseparator{.}
\theorembodyfont{\itshape}
\newtheorem{theorem}{Theorem}
\makeatletter
\newtheoremstyle{proof}%
{\item[\hskip\labelsep\theorem@headerfont\MakeUppercase ##1\theorem@separator]}%
{\item[\hskip \labelsep\theorem@headerfont\MakeUppercase ##1\ ##3\theorem@separator]}
\makeatother
\theoremstyle{proof}
\theoremheaderfont{\scshape}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\square}}
\newtheorem{proof}{Proof}
\begin{document}
\begin{theorem}[Some theorem]\label{thm:some-theorem}
This is an important theorem.
\end{theorem}
\begin{proof}
This is a very important proof.
\end{proof}
\begin{proof}[of \nameCref{thm:some-theorem}]
This is a very important proof.
\end{proof}
\begin{proof}[of \Cref{thm:some-theorem}]
This is a very important proof.
\begin{align*}
a & = b\\ c & = d.
\end{align*}
\end{proof}
\end{document}