9

I am currently using this in the preamble:

\theoremstyle{plain}% default
\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem*{cor}{Corollary}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\newtheorem{conj}{Conjecture}[section]
\newtheorem{exmp}{Example}[section]
\theoremstyle{remark}
\newtheorem*{rem}{Remark}
\newtheorem*{note}{Note}
\newtheorem{case}{Case}

On the whole, this works exactly as I want it to. However for cases within a proof, I want the numbering to start at 1 again within each theorem: eg it should read:

Thm 1: blah blah
Proof:
Case 1:
Case 2:

Thm 2: blah blah blah
Proof:
Case 1:
Case 2:

Rather than in the second theorem the cases starting from 3 which is what currently happens.

Google suggested using something to do with numbered_within but I haven't managed to get the formatting right for this to work yet.. any ideas?

Werner
  • 603,163
Zoe Kelly
  • 141
  • Maybe this: \newtheorem[thm]{Case}. Or you can use \begin{proof}[Case I]\end{proof}. – Sigur Apr 29 '14 at 21:20
  • 2
    What theorem package are you using? It may be as simple as \makeatletter\@addtoreset{case}{thm}\makeatother... – Werner Apr 29 '14 at 21:26
  • @Werner: what if it happens within the proof ot a proposition, lemma, &c.? – Bernard Apr 29 '14 at 21:36
  • \newtheorem[thm]{Case} doesn't compile, the closest I have so far is \newtheorem{case}{Case}[thm] but although it resets the case counter as desired, that puts in the entire theorem number (which is 3 part not one as in the 'example') ie Case 3.2.1.1 which seems a little excessive.
    Package wise I am using amsmath and amsthm. Will experiment.
    – Zoe Kelly Apr 29 '14 at 21:41
  • 1
    @Bernard: Then one can add more entries to the counter reset list: \@addtoreset{case}{lem}\@addtoreset{case}{prop}... – Werner Apr 29 '14 at 21:45
  • Werner your first suggestion works perfectly (sorry for being slow to try it). Thank you! And thanks for the tip about getting it to reset within lemmas/propositions too. – Zoe Kelly Apr 29 '14 at 21:50
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Heiko Oberdiek Apr 29 '14 at 22:01
  • 1
    I just found \setcounter{case}{0} [put this before your next case environment] at ftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdf#page=6 – bjd2385 Sep 19 '16 at 15:18

1 Answers1

9

I have a simple solution with the ntheorem package and its \theorempostwork command: the case counter is reset at the end of the proof environment. However, the proof symbol will have to be set by hand if the proof ends in a case environment:

        \documentclass[11pt,a4paper]{book} 
        \usepackage[utf8]{inputenc}
        \usepackage[T1]{fontenc}
        \usepackage{fourier}


        \usepackage{amsmath}
       \usepackage[thmmarks,  thref, amsmath]{ntheorem}

        \theoremstyle{plain}
        \newtheorem{thm}{Theorem}

        \theoremheaderfont{\itshape}
        \theorembodyfont{\upshape}
        \newtheorem{case}{Case}

        \theoremstyle{nonumberplain}
        \theoremheaderfont{\scshape}
        \theorembodyfont{\upshape}
        \theoremsymbol{\scshape Q. E. D.}% or\ensuremath{ _{\Box}}, also add \usepackage{amssymb}
        % or O. E. \ensuremath{\Delta} % for Euclid's  ὅπερ ἔδει δεῖξαι
        \theorempostwork{\setcounter{case}{0}}
        \newtheorem{proof}{Proof}

        \begin{document}

        \begin{thm}
         Once upon a time…
        \end{thm}

        \begin{proof}
        Fiddle dee dee! 
        \begin{case}
          First case of this proof
        \end{case}
        And now:
        \begin{case}
         Second case of this proof .\proofSymbol
        \end{case}
                    \end{proof}

        \begin{thm}
        Once upon another time…
        \end{thm}

        \begin{proof}
        Fiddle dee dee!
        \begin{case}
          First case of this proof
        \end{case}
        And now:
        \begin{case}
         Second case of this proof
        \end{case} 
         This ends the proof of the theorem. 
        \end{proof}

        \end{document} 

enter image description here

Bernard
  • 271,350