I am trying to create a custom "proof" environment that behaves as follows:
\begin{proof}\end{proof}
should produce \textit{Proof.}
, while \begin{proof}{method}\end{proof}
should produce \textit{Proof (method).}
. Here's what I have right now:
\documentclass[10pt]{article}
\usepackage{xifthen}
\newenvironment{proof}[1]
{\par\vspace{\baselineskip}\noindent\textit{Proof
{\ifthenelse
{\isempty{#1}}
{}
{(#1)}
}}}
\begin{document}
\begin{proof}{by contradiction}
1
\end{proof}
\begin{proof}
2
\end{proof}
\end{document}
For some reason, I cannot get #1
in parentheses as they always disappear upon compiling. Any ideas?
[...]
. That would make things a lot easier. Would that be an acceptable syntax?