[Tex/LaTex] Setting Counters for Theorems

counterstheorems

I'm using the following code to generate the "lemma" functionality in my document:

\newtheorem{lemma}[theorem]{Lemma}

However, the first lemma I define appears as Lemma 0.1. I tried using the \setcounter{lemma} command to change the count, but it didn't work. I want to be able to set the counter so that the first lemma I define appears as Lemma 5.1. Note that I'm not working with sections or any other partitioning like that, so the 5 is somewhat arbitrary.

Best Answer

Since you have defined the lemma structure using

\newtheorem{lemma}[theorem]{Lemma}

this implies that lemmas will share the counter for theorems and, unfortunately, the question doen't give information about how exactly the theorem structure was defined. Seeing the form of the counter, however, one can guess that the definition for theorems must be something along the lines of

\newtheorem{theorem}{Theorem}[section]

where, instead of [section] it could be [chapter] or similar. In this case, the representation for the counter for lemmas will have a prefix: the counter declared in the second optional argument for theorems and this is the counter you have to change:

\documentclass{article}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}

\begin{lemma}
test
\end{lemma}

\setcounter{section}{5}
\begin{lemma}
test
\end{lemma}

\end{document}

enter image description here