9

I would like to alternate between two proof environments under the amsthm package, e.g. distinguished between \begin{proof1} ... \end{proof1} and \begin{proof2} ... \end{proof2}. In these I want to use different end signs like QED or $\blacksquare$.

How may I do this?

4
  • You've been here some time already: Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. In particular: The term and concept of MWE should be known ;-)
    – user31729
    Commented Jul 25, 2015 at 13:36
  • 4
    @Christian Hupfer My question is perfectly intelligible without a MWE, and so much so that it already got a perfectly acceptable answer. Some times a MWE may just obfuscate matters. Commented Jul 25, 2015 at 13:41
  • 1
    I think it's better for non-high-rep users to understand your question, to provide a MWE, but it's your choice, of course.
    – user31729
    Commented Jul 25, 2015 at 13:48
  • OK I will attempt to remember that. Commented Jul 25, 2015 at 13:52

1 Answer 1

11

You can define a proofi environment based on proof but making the desired redefinition for the \qedsymbol:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amssymb}

\newenvironment{proof1}[1][\proofname]
  {\begin{proof}[#1]\renewcommand\qedsymbol{$\blacksquare$}}
  {\end{proof}}
\newenvironment{proof2}[1][\proofname]
  {\begin{proof}[#1]\renewcommand\qedsymbol{\textsc{qed}}}
  {\end{proof}}

\begin{document}

\begin{proof}
Test text.
\end{proof}

\begin{proof1}
Test text.
\end{proof1}

\begin{proof2}
Test text.
\end{proof2}

\end{document}

enter image description here

With xparse, you can easily set another optional argument allowing to specify the symbol, if desired; something along these lines:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{xparse}

\NewDocumentEnvironment{proofi}{d()O{\proofname}}
  {\begin{proof}[#2]\IfNoValueTF{#1}{}{\renewcommand\qedsymbol{#1}}}
  {\end{proof}}

\begin{document}

\begin{proofi}
Test text.
\end{proofi}

\begin{proofi}($\blacksquare$)
Test text.
\end{proofi}

\begin{proofi}(\textsc{qed})
Test text.
\end{proofi}

\end{document}

enter image description here

Or, redefining proof:

\usepackage{letltxmacro}
\usepackage{xparse}

\LetLtxMacro\oldproof\proof
\let\oldendproof\endproof

\RenewDocumentEnvironment{proof}{d()O{\proofname}}
  {\oldproof[#2]\IfNoValueTF{#1}{}{\renewcommand\qedsymbol{#1}}}
  {\oldendproof}

You must log in to answer this question.

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