Im using the usual counter for my book. That is, the theorems, lemmas, etc, are labeled according to the chapter and section (Ex Theorem 2.5.18).

I included an appendix just with the chapter title and it has no sections, the commands I set were



but the theorems, lemmas, def, etc in this chapter are labeled with things like "Theorem A.0.5.", I want that it be in the form "A.5", that is, ommit the section countering.

  • What packages do you use to generate your theorems?
    – Werner
    Aug 14 '12 at 16:14
  • Do your theorems, lemmas, etc. share a common counter, or are they numbered separately? Also, how is the subordination of the theorem/lemma/etc counter(s) achieved in the first place? Via instructions such as \numberwithin{section}{theorem}? Please advise.
    – Mico
    Aug 14 '12 at 16:30
  • I use the following instructions for the subordination \newtheorem{teor}{Theorem}[section] \newtheorem{prop}[teor]{Proposition} \newtheorem{defin}[teor]{Definition} \newtheorem{corol}[teor]{Corollary} \newtheorem{lema}[teor]{Lemma}
    – everk
    Aug 14 '12 at 16:32

This may depend heavily on the package you're using for your theorems/lemmas. However, in the default situation with book and using the traditional \newtheorem command to create your theorems, the following works.

The MWE below renews the display of the section number to only print the chapter number (since the section number is not needed). The image below shows an extract of pages 1 & 3 only:

enter image description here

\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\chapter{A chapter}\lipsum[1]
\section{A section}\lipsum[2]
\@addtoreset{theorem}{chapter}% Reset theorem counter with stepping of chapter
\renewcommand{\thesection}{\thechapter}% Section number prints chapter number
\chapter{Another chapter}\lipsum[4]

Counter resetting with the stepping of other counters is achieved via \@addtoreset. However, other packages also provide this functionality, like chngcntr (using \counterwithin and \counterwithout) and amsmath (using \numberwithin and \numberwithout). See the UK TeX FAQ entry Master and slave counters.

  • it was very useful, but I have another problem with your solution. If I include a second appendix B, the labeling continues with respect to the previous appendix. For example, the first theorem was "Theorem B.15" and not "Theorem B.1"
    – everk
    Aug 14 '12 at 16:35
  • @everk: I've added \@addtoreset to modify the way theorems work in the appendix.
    – Werner
    Aug 14 '12 at 17:02
  • In my case, I included package fncychap in an article document, which caused the problem. So I just removed fncychap because I do not need to modify chapter styles in an article!
    – zyy
    Apr 15 '20 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.