I'm using ntheorem
with the thmmarks
option but without the amsthm
option (for reasons I won't go into). I would like to define the proof
environment à la amsthm
. Specifically, I want:
- To be able to use the proofSymbol command to affect all proofs, as described in this answer.
- To be able to specify that, by default, proofs will have no QED symbol.
- For the proof symbol, when it appears, to appear by default at the end of the line (i.e. after an
\hfil
).
What I did was 'lift' the definition from ntheorem.sty
:
\newcommand{\openbox}{\leavevmode
\hbox to.77778em{%
\hfil\vrule
\vbox to.675em{\hrule width.6em\vfil\hrule}%
\vrule\hfil}}
\gdef\proofSymbol{\openbox}
\newcommand{\proofname}{Proof}
\newenvironment{proof}[1][\proofname]{
\th@nonumberplain
\def\theorem@headerfont{\itshape}%
\normalfont
\theoremsymbol{\ensuremath{_\blacksquare}}
\@thm{proof}{proof}{#1}}%
{\@endtheorem}
And add a counter definition. Here's the result in an working example:
\documentclass{article}
\usepackage[thmmarks]{ntheorem}
\usepackage{amssymb}
\usepackage{lipsum}
\makeatletter
\newcommand{\openbox}{\leavevmode
\hbox to.77778em{%
\hfil\vrule
\vbox to.675em{\hrule width.6em\vfil\hrule}%
\vrule\hfil}}
\gdef\proofSymbol{\openbox}
\newcommand{\proofname}{Proof}
\newcounter{proof}\newcounter{currproofctr}\newcounter{endproofctr}
\newenvironment{proof}[1][\proofname]{
\th@nonumberplain
\def\theorem@headerfont{\itshape}%
\normalfont
\theoremsymbol{\ensuremath{_\blacksquare}}
\@thm{proof}{proof}{#1}}%
{\@endtheorem}
\makeatother
\renewcommand\proofSymbol{\ensuremath{\blacksquare}}
\begin{document}
\begin{proof}
Without \verb|\qed| in this one.
\end{proof}
\begin{proof}
With \verb|\qed| in this one. \qed
\end{proof}
\end{document}
(Edit: Dropped the \lipsum 's from the MWE) What happens is that I get a black square when not specifying \qed
, but no black square when I do specify it. So,
- How do I get
\qed
to work now? - To avoid a symbol by default now, I'll just set
\theoremsymbol{\relax}
, right? - Can I overcome the "no
\par
before the end" limitation?
! LaTeX Error: No counter 'currproofctr' defined.
.ntheorem
really dislikes\par
before\end....