Installation Word Processing Computations Typesetting File Issues Graphics Exam Builder Style Editor Other Free Updates Technical Articles Scientific NotebookSupport Information Troubleshooting TeXnology BibDB TeXnology links |
Document 247 ## Theorem number counter doesn't reset correctly between sections
## ProblemA TeX command has been added to a document to make the theorem numbers in the document reflect not only the chapter but also the section in which the theorem occurs, as in Theorem 3.5.1 (the first theorem in section 5 of chapter 3). However, the theorem number counter doesn't reset to 1 from section to section. ## ExplanationWhen you insert the following TeX command in the preamble of your document \renewcommand{\thetheorem}{\thesection.\arabic{theorem}} you expect to have theorem numbers that reflect both the chapter and the section number in which they occur and that reset to 1 at the beginning of each new section. For example, suppose the first and second theorems occur in Chapter 3, Section 2, and the third occurs in Chapter 3, Section 5. You expect the theorem numbers to occur in this sequence: Theorem 3.2.1, Theorem 3.2.2, Theorem 3.5..... However, the theorem numbers that actually occur are the following: Theorem 3.2.1, Theorem 3.2.2, Theorem 3.5.3.... ## Preferred solutionsUse a form of the \newtheorem statement that will automatically count the theorem objects based on a division (chapter or section) object, usually section counter for article documents or the chapter counter for book and report documents. ## Theorems numbered with section + theorem number
In an \newtheorem{theorem}{Theorem}[section] \newtheorem{acknowledgement}{Acknowledgement}[section] \newtheorem{algorithm}{Algorithm}[section] \newtheorem{axiom}{Axiom}[section] \newtheorem{case}{Case}[section] \newtheorem{claim}{Claim}[section] \newtheorem{conclusion}{Conclusion}[section] : \newtheorem{solution}{Solution}[section]
\newtheorem{summary}{Summary}[section] The replacement yields numbering such as Theorem 2.1, Theorem 2.2, Corollary 2.1, Theorem 3.1, Theorem 3.2.... where the first digit is the section number and the second digit is the number of the object inside the section. The theorem number is reset to 1 at the beginning of each section. ## Theorems numbered with chapter + section + theorem number
In a The replacement yields numbering such as Theorem 1.2.1 where the first 1 is the chapter number, the 2 is the section number, and the second 1 is the theorem number within the section. The theorem number is reset to 1 at the beginning of each section. ## Theorems numbered with chapter + theorem number
In a \newtheorem{theorem}{Theorem}[chapter] \newtheorem{acknowledgement}{Acknowledgement}[chapter] \newtheorem{algorithm}{Algorithm}[chapter] \newtheorem{axiom}{Axiom}[chapter] \newtheorem{case}{Case}[chapter] \newtheorem{claim}{Claim}[chapter] \newtheorem{conclusion}{Conclusion}[chapter] : \newtheorem{solution}{Solution}[chapter]
\newtheorem{summary}{Summary}[chapter] The replacement yields numbering such as Theorem 2.1 where the 2 is the chapter number and the 1 is the theorem number within the chapter. The theorem number is reset to 1 at the beginning of each chapter. ## Alternate solutionInsert TeX commands in the preamble of your document, in place of the \renewcommand statement shown in the Explanation above, according to these instructions: -
From the Typeset menu, choose Preamble. -
In the input box, enter \makeatletter and press Return. -
Enter \renewcommand{\thetheorem}{\thesection.\arabic{theorem}} and press Return. -
Enter \@addtoreset{theoremname}{section} where theoremname is the counter for the theorem-like environment you want to reset and section is the name of the document part where you want the reset to occur. -
Press Return. -
Repeat steps 3 - 5 for **each**theorem-like environment for which you want to reset the counter. -
Enter \makeatother . -
Choose OK. -
Save your document.
For example, if you want to reset the numbering of theorems each time you change sections and you want to reset the numbering of notes each time you change chapters, the preamble would contain these lines: \makeatletter \renewcommand{\thetheorem}{\thesection.\arabic{theorem}} \@addtoreset{theorem}{section} \renewcommand{\thenote}{\thesection.\arabic{theorem}} \@addtoreset{note}{chapter} \makeatother
Last revised 07/12/06 This document was created with Scientific WorkPlace. |