Results 1 to 8 of 8

Math Help - Numbering within chapters

  1. #1
    Super Member Deadstar's Avatar
    Joined
    Oct 2007
    Posts
    722

    Numbering within chapters

    How do you number equations, definitions, theorems etc within chapters?

    Like every def, theorem, equation in chapter 2 for example would start with 2.1, 2.2 etc...
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member Focus's Avatar
    Joined
    Aug 2009
    Posts
    228
    Quote Originally Posted by Deadstar View Post
    How do you number equations, definitions, theorems etc within chapters?

    Like every def, theorem, equation in chapter 2 for example would start with 2.1, 2.2 etc...
    \numberwithin{equation}{section}
    \renewcommand{\theequation}{\thesection.\arabic{eq uation}}

    And similarly
    \numberwithin{counter_here}{section}
    \newtheorem{thm}[counter_here]{Theorem}
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Super Member Deadstar's Avatar
    Joined
    Oct 2007
    Posts
    722
    Hmm that didn't work...

    I already have this in my report which defines styles of all theorems, lemmas, definitions, etc...

    \newtheorem{lemma}{Lemma}
    \newtheorem{theorem}[lemma]{Theorem}
    \newtheorem{corollary}[lemma]{Corollary}
    \theoremstyle{definition}
    \newtheorem{definition}[lemma]{Definition}
    \newtheorem{example}[lemma]{Example}

    Remember EVERY definition, theorem, corollary and lemma is numbered. I would like it so they are numbered according to what chapter they are in.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member Focus's Avatar
    Joined
    Aug 2009
    Posts
    228
    Quote Originally Posted by Deadstar View Post
    \newtheorem{lemma}{Lemma}[section]
    \newtheorem{theorem}[lemma]{Theorem}
    \newtheorem{corollary}[lemma]{Corollary}
    \theoremstyle{definition}
    \newtheorem{definition}[lemma]{Definition}
    \newtheorem{example}[lemma]{Example}
    Try that.

    That should give you numbering such as 2.1.1, 2.1.2,... if you are in section 1 and chapter 2. If you just want it like 2.1, 2.2,... then use [chapter] instead of [section].
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member Deadstar's Avatar
    Joined
    Oct 2007
    Posts
    722
    Perfect thanks a lot.

    I've just given myself another problem in that some of my sections are numbered the same as my theorems... Like I have a section numbered 2.1 and an equation numbered 2.1 lol...

    Also doing it the first way [section] works fine for the first two chapters but after that it goes in a mess and ends up with 9.0.50 as my last definition instead of 9.0.6... This is why I don't really like Latex that much, so hard to style it!

    Might just not number the sections...
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member Focus's Avatar
    Joined
    Aug 2009
    Posts
    228
    Quote Originally Posted by Deadstar View Post
    Perfect thanks a lot.

    I've just given myself another problem in that some of my sections are numbered the same as my theorems... Like I have a section numbered 2.1 and an equation numbered 2.1 lol...

    Also doing it the first way [section] works fine for the first two chapters but after that it goes in a mess and ends up with 9.0.50 as my last definition instead of 9.0.6... This is why I don't really like Latex that much, so hard to style it!

    Might just not number the sections...
    I have no idea why it would number .50 at the end but the 0 indicates that you just have a chapter and not a section. You could number your equations according to the section and theorems according to chapter.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member Deadstar's Avatar
    Joined
    Oct 2007
    Posts
    722
    Not really sure what I'll do to be honest! I really like the chapter numbering way you showed me above (not so keen on the 1.2.3 style numbering). But It means that it looks odd when you number sections as they will have the same numbering as some formulas...

    I think I need to go get a book or two and take note of how they number their parts. Then maybe come back for more advice...

    Just for future reference, say I wanted to number all my corollarys (for example) by section what would I do?

    Would it be
    \newtheorem{corollary}[lemma]{Corollary}[section]

    or ustj
    \newtheorem{corollary}{Corollary}[section]
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Member Focus's Avatar
    Joined
    Aug 2009
    Posts
    228
    Quote Originally Posted by Deadstar View Post
    Just for future reference, say I wanted to number all my corollarys (for example) by section what would I do?

    Would it be
    \newtheorem{corollary}[lemma]{Corollary}[section]

    or ustj
    \newtheorem{corollary}{Corollary}[section]
    If you want equations numbered you use this format;

    \numberwithin{equation}{section}
    \renewcommand{\theequation}{\thesection.\arabic{eq uation}}

    For theorems the format is;
    \newtheorem{name}[counter]{printed name}[section]

    If you leave out the [counter] (where "counter" is the name of the counter) then it will make a new one, so for example

    \newtheorem{corollary}{Corollary}[section]
    \newtheorem{def}[lemma]{Definition}

    will give you, Corollary 2.1.1, Definition 2.1.2,... whereas

    \newtheorem{corollary}{Corollary}[section]
    \newtheorem{def}{Definition}[section]

    will give Corollary 2.1.1, Definition 2.1.1, Corollary 2.1.2, Corollary 2.1.3, Definition 2.1.2,...

    You can also manually set counters with \setcounter{counter}{value} if you want to solve the numbering problem manually.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Gödel numbering
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: October 19th 2011, 10:36 PM
  2. Equation numbering
    Posted in the LaTeX Help Forum
    Replies: 0
    Last Post: April 24th 2010, 01:53 AM
  3. Godel Numbering
    Posted in the Advanced Math Topics Forum
    Replies: 3
    Last Post: January 16th 2010, 02:06 AM
  4. page numbering
    Posted in the LaTeX Help Forum
    Replies: 0
    Last Post: October 24th 2008, 01:17 PM
  5. [SOLVED] numbering squares
    Posted in the Math Topics Forum
    Replies: 4
    Last Post: June 8th 2007, 09:24 AM

Search Tags


/mathhelpforum @mathhelpforum