My goal is to get a new claim environment which automatically numbers. This is fine - I can make a counter, define a claim environment and claimproof environment which number automatically, and this is all fine.

However, I would like the numbering to start at one for each proof, which means I need to reset the counter at the beginning of each proof. I can do this by defining a new environment, "myproof" or so on, which is a wrapper for proof, but I would like it to automatically work on existing LaTeX code.

So how can I "redefine" the proof environment without rewriting the proof environment from scratch?

  • Could you provide the community with an example?
    – Werner
    Dec 17, 2015 at 3:21
  • It's not clear what example would be useful here. I think the description is fairly clear. If you can tell me specifically what sort of example would be useful, I'd be glad to add one. Dec 17, 2015 at 4:01
  • Does the current answer answer your question? If not, then it's clear that there could be some ambiguity in terms of what you want.
    – Werner
    Dec 17, 2015 at 4:02
  • It does. I don't know the custom here, so I thought I would wait to see votes, other answers, etc. and then pick the apparent best. But this answer looks perfect. Dec 17, 2015 at 4:03

2 Answers 2


There are numerous ways to achieve the desired behavior. A relatively clean (and general) way is to use \AtBeginEnvironment from the etoolbox package to reset the counter associated with your claim environment at the beginning of the proof environment.

For example:

\newenvironment{claim}{\refstepcounter{claimcount}\textbf{Claim \arabic{claimcount}:}}{}

test proof
a claim
more text
test proof
a claim



  • 2
    Thanks! The real magic is the "AtBeginEnvironment" command - I had never heard of it. Dec 17, 2015 at 17:52

Guho's answer is correct, but for sake of posterity, here is the code I went with:



\newenvironment{claimproof}{\noindent\textit{Proof of Claim~\arabic{claimCount}.}}{\hfill\ensuremath{\qedsymbol} \tiny{Claim~\arabic{claimCount}}



I often look for copy/paste code on this site, so I thought I'd contribute some. This automatically numbers claims and (assuming the claim's proof follows the claim before a new claim is written) the claim proofs are properly labeled. Also the QED at the end of the claim's proof is clearly marked as such, to distinguish it from the QED at the end of the full proof (another pet peeve of mine).

You must log in to answer this question.

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