7

I have the following working example.

\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}

This produces "Proof (Proof of Theorem 1)." as opposed to just "Proof of Theorem 1." - I was trying to mimic the solution here How can I create a "Proof of Theorem x.xx" header for a proof environment?, which does not appear to work with the LLNCS class. What's the simplest way to do this? I am trying to avoid using many additional packages, as instructed by the conference.

Edit: In my paper, I also have things like "Theorem 1 (Bob [2]).", which I would like to keep as is... so I need to make sure that the solution proposed does not effect such things.

3 Answers 3

5

When there is an optional argument, the header (label) of unnumbered theorem-style environments is defined by the \@Opargbegintheorem macro.

Add:

\makeatletter
\renewcommand{\@Opargbegintheorem}[4]{%
  #4\trivlist\item[\hskip\labelsep{#3#2\@thmcounterend}]}
\makeatother

in the preamble of the document.

enter image description here

\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}
4

Change the definition of \proof (which is executed by \begin{proof}) to look for an optional argument and change the value of \proofname accordingly.

\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}

The redefinition of \proofname is local to the environment; it will affect also nested proofs, though. If you need them, either use the optional argument in each nested proof or you have to resort to a more complex patch.

\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}

I showed also how to avoid the warning about \vec given by the llncs package when amsmath is properly loaded: just load also bm, tell the class to keep the original \vec and then change it in a much better way than llncs does.

enter image description here

3

Here's an option provided via a newly-defined proof* environment:

enter image description here

\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* takes a single, mandatory argument that internally (temporarily) redefined \proofname.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .