我有以下工作示例。
\RequirePackage{amsmath}
\documentclass{llncs}
\begin{document}
\begin{theorem}
\label{thm:ex}
A very important result.
\end{theorem}
Some comments here \ldots
\begin{proof}[Proof of Theorem \ref{thm:ex}]
It follows by inspection.
\end{proof}
\end{document}
这产生了“证明(定理 1 的证明)”。而不是仅仅“定理 1 的证明”。 - 我试图模仿这里的解决方案如何为证明环境创建“定理 x.xx 证明”标题?,这似乎不适用于 LLNCS 类。最简单的方法是什么?我正尝试避免使用许多附加包,正如会议所指示的那样。
编辑:在我的论文中,我也有像“定理 1(Bob [2])”这样的内容,我想保留原样......所以我需要确保提出的解决方案不会影响这些事情。
答案1
当有一个可选参数时,无编号定理样式环境的标题(标签)由\@Opargbegintheorem
宏定义。
添加:
\makeatletter
\renewcommand{\@Opargbegintheorem}[4]{%
#4\trivlist\item[\hskip\labelsep{#3#2\@thmcounterend}]}
\makeatother
在该文件的序言中。
\documentclass{llncs}
\makeatletter
\renewcommand{\@Opargbegintheorem}[4]{%
#4\trivlist\item[\hskip\labelsep{#3#2\@thmcounterend}]}
\makeatother
\begin{document}
\begin{theorem}\label{thm:ex}
A very important result.
\end{theorem}
\begin{theorem}[Bob]
Another very important result.
\end{theorem}
\begin{proof}
Clear.\qed
\end{proof}
Some comments here \ldots
\begin{proof}[Proof of Theorem \ref{thm:ex}]
It follows by inspection.\qed
\end{proof}
\end{document}
答案2
\proof
更改(由 执行)的定义\begin{proof}
以查找可选参数并\proofname
相应地更改 的值。
\documentclass[orivec]{llncs}
\usepackage{amsmath,bm}
%% avoid the silly redefinition done by llncs
\renewcommand{\vec}[1]{\bm{#1}}
%% change proof to accept the optional argument
\let\llncsproof\proof
\renewcommand{\proof}[1][]{%
\ifx!#1!\else\renewcommand{\proofname}{#1}\fi
\llncsproof
}
\begin{document}
\begin{theorem}
\label{thm:ex}
A very important result.
\end{theorem}
Some comments here \ldots
\begin{proof}[Proof of Theorem \ref{thm:ex}]
It follows by inspection.
\end{proof}
\end{document}
的重新定义\proofname
是环境的局部重新定义;但它也会影响嵌套证明。如果需要,请在每个嵌套证明中使用可选参数,否则您必须求助于更复杂的补丁。
\documentclass[orivec]{llncs}
\usepackage{amsmath,bm}
\usepackage{etoolbox}
%% avoid the silly redefinition done by llncs
\renewcommand{\vec}[1]{\bm{#1}}
%% change proof to accept the optional argument
\patchcmd\proof{proofname}{genericproofname}{}{}
\let\llncsproof\proof
\renewcommand{\proof}[1][\proofname]{\def\genericproofname{#1}\llncsproof}
\begin{document}
\begin{theorem}
\label{thm:ex}
A very important result.
\end{theorem}
Some comments here \ldots
\begin{proof}[Proof of Theorem \ref{thm:ex}]
It follows by inspection.
\end{proof}
\end{document}
我还展示了如何避免在正确加载时包\vec
给出的警告:只需加载,告诉类保留原始内容,然后以比原先更好的方式进行更改。llncs
amsmath
bm
\vec
llncs
答案3
这是通过新定义的环境提供的选项proof*
:
\documentclass{llncs}
\usepackage{amsmath}
\newenvironment{proof*}[1]
{\renewcommand{\proofname}{#1}%
\begin{proof}}
{\end{proof}}
\begin{document}
\begin{theorem}\label{thm:ex}
A very important result.
\end{theorem}
Some comments here \ldots
\begin{proof*}{Proof of Theorem~\ref{thm:ex}}
It follows by inspection.
\end{proof*}
\end{document}
proof*
采用内部(临时)重新定义的单一、强制参数\proofname
。