当我使用“svmono.cls”撰写论文时,墓碑(QED 标记)不会显示在证明的末尾。我该如何启用它?
以下是代码示例:
<\documentclass[12pt,sectrefs]{svmono}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage[bottom]{footmisc}
\usepackage{amsmath}
\usepackage{lipsum}
\makeindex
\begin{document}
\frontmatter
\mainmatter
\chapter{Chapter Heading}
\section{Section Heading}
\subsection{Subsection Heading}
\begin{theorem}
\lipsum[1-2]
\end{theorem}
\begin{theorem}
nonses\\
nonsesnse\\
nonsesnse\\
nonsesnse\\
nonsesnse\\
%nonsesnse\\
\end{theorem}
\begin{proof}
here is the proof.
\end{proof}
\end{document}
答案1
proof
提供的环境不svmono
包含自动 QED 符号。相反,它提供了一种笨拙的手动添加墓碑的方法。
您可以通过加载来解决问题amsthm
,只要您继续使用svmono
定义新类定理环境的方法。
\documentclass[12pt,sectrefs]{svmono}
\usepackage{amsmath}
\let\proof\relax\let\endproof\relax
\usepackage{amsthm}
\begin{document}
\chapter{Chapter Heading}
\section{Section Heading}
\subsection{Subsection Heading}
\begin{theorem}
Some statement
\end{theorem}
\begin{proof}
Here is the proof.
\end{proof}
\end{document}
答案2
我找到了一种方法,可以自动将 qed 标记添加到预定义的证明环境中svjour3
(svmono
应该是相同的):
\documentclass{svjour3}
\smartqed
\usepackage{etoolbox}
\AtEndEnvironment{proof}{\phantom{}\qed} %Automatically add qed symbol to the end of proof environment
\begin{document}
\begin{proof}
xxxxxx
\end{proof}
\end{document}
这里\phantom{}
用于“退出”垂直模式。
答案3
我想在 Yijun Yuan 的回答中添加以下内容。如果您想使用 \qedhere,其工作方式与在内部使用时类似未编号您可以使用的数学环境:
\documentclass{svjour3}
\smartqed
\usepackage{etoolbox}
\global\newtoggle{QEDHERE} %Variable used to know if there is a command \qedhere before the end of proof
\AtEndEnvironment{proof}{\iftoggle{QEDHERE}{\global\togglefalse{QEDHERE}}{\phantom{}\qed}} %Automatically add qed symbol to the end of proof environment if there is no \qedhere
\newcommand{\qedhere}{\global\toggletrue{QEDHERE}\tag*{\qed}} %puts \qed and sets the toggle to keep track that it has been used
\begin{document}
Normal proof:
\begin{proof}
xxxxxx
\end{proof}
Proof with qedhere
\begin{proof}
xxxxxx
\begin{align*}
x=x \qedhere
\end{align*}
\end{proof}
\end{document}
注意:它是非常基本的,如果你在数学或证明环境之外使用 \qedhere,它可能会崩溃,并且如果你在同一个证明中使用它两次,它会产生两个正方形,等等,所以请谨慎使用它。