[Tex/LaTex] Counter on Appendix without sections

appendicesnumberingtheorems

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.

Best Answer

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.