Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Latex counters: modifying \numberwithin?

  1. May 18, 2010 #1

    honestrosewater

    User Avatar
    Gold Member

    I am writing up some formal proofs using the proof and align environments. Each line in the proof needs to be numbered and will contain a formula and a statement referring to earlier lines in the proof that were used to derive it. I want to reset this counter for each proof. It should look something like this:
    What's the easiest way to do this? Should I define a new proof counter and modify \numberwithin to reset the equation counter when proof is incremented? (I don't know how to do this.) Or should I skip using equation and just define my own counter that will increment with each new line in align? (I don't know how to do this either.)

    Edit: Oh, duh, I'll just add \setcounter manually where I want it reset. Is there a way to get the proof environment to do this automatically?
     
    Last edited: May 18, 2010
  2. jcsd
  3. May 18, 2010 #2

    diazona

    User Avatar
    Homework Helper

    Here's the definition of the proof environment from amsthm.sty:
    Code (Text):
    \newenvironment{proof}[1][\proofname]{\par
      \pushQED{\qed}%
      \normalfont \topsep6\p@\@plus6\p@\relax
      \trivlist
      \item[\hskip\labelsep
            \itshape
        #1\@addpunct{.}]\ignorespaces
    }{%
      \popQED\endtrivlist\@endpefalse
    }
    You could always just repeat this in your document preamble (or put it in a style file of your own) and add in a \setcounter statement in the appropriate place.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Latex counters: modifying \numberwithin?
  1. Graphs in LaTeX (Replies: 3)

  2. LaTeX in PowerPoint (Replies: 2)

  3. Latex Help (Replies: 9)

  4. LaTeX help (Replies: 2)

Loading...