Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\appendix

\chapter{a1}

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.

share|improve this question
    
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

1 Answer 1

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

\documentclass{book}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\newtheorem{theorem}{Theorem}[section]
\renewcommand{\thetheorem}{\thesection.\arabic{theorem}}
\begin{document}
\chapter{A chapter}\lipsum[1]
\section{A section}\lipsum[2]
\begin{theorem}\lipsum[3]\end{theorem}
\appendix
\makeatletter
\@addtoreset{theorem}{chapter}% Reset theorem counter with stepping of chapter
\makeatother
\renewcommand{\thesection}{\thechapter}% Section number prints chapter number
\chapter{Another chapter}\lipsum[4]
\begin{theorem}\lipsum[5]\end{theorem}
\end{document}​

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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