Document 630

Message: Command \proof already defined

Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word

Problem

If you add the package amsthm to a document and then typeset the document, the compile results in this LaTeX error message:

! LaTeX Error: Command \proof already defined.

The message appears in the LaTeX window and in the .log file for the document.

Explanation

The preamble of documents created using SWP and SW Version 3.0 and later includes a number of \newtheorem statements to define theorem-like environments and a \newenvironment statement to define the proof environment. The amsthm package also defines the proof environment, resulting in a LaTeX error when the document is compiled. If you remove the \newenvironment statement from the document preamble, the document will compile without errors, but the proof environments in your document will appear as TeX fields.

Solution

You can avoid the problem by using a conditional statement around the \newenvironment statement in the preamble. The conditional statement causes the program to see the \newenvironment statement and to display the body of your proof environment in the document window. However, LaTeX does not see the \newenvironment statement, so it uses the one defined by the amsthm package. Follow these steps to add the conditional statement to the preamble:

  1. Open your document.

  2. From the Typeset menu, choose Preamble.

  3. Replace the single line:

    \newenvironment{proof}[1][Proof]{\textbf{#1.} }{\ \rule{0.5em}{0.5em}}

    with these lines:

    \iffalse

    \newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}

    \fi

  4. Choose OK.

Last revised 02/16/11