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.

I'm writing a multichapter report and I'm having a problem with the theorems being numbered correctly of section zero of a new chapter.

For instance, chapter two ends with Corollary 2.3.21 and Chapter three begins with Theorem 3.0.22. Also, Chapter three ends with Corollary 3.3.2 and Chapter four begins with Theorem 4.0.3. And so on...

My (edited to not write out whole theorems) code follows.

\documentclass[12pt]{report} 
\usepackage{fullpage}
\usepackage{amsmath} 
\usepackage{amsthm} 
\usepackage{amssymb}
\usepackage{MnSymbol} 
\usepackage[shortlabels]{enumitem}
\usepackage[all,arc,curve,color,frame]{xy}
\usepackage[pdftex]{graphicx}

%Declaring a bunch of math symbols%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{remark}[theorem]{Remark}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}
\newtheorem*{theorem*}{Theorem}
\newtheorem*{corollary*}{Corollary}

\begin{document}

\chapter{The First Chapter} \input{thefirstchapter}

\chapter{The Second Chapter} \input{thesecondchapter}

et cetera

edit: I also forgot to mention something very curious about this: Chapters one and two are fine, it's every following chapter that is a problem.

edit part 2: Here's a minimal working example

\documentclass[12pt]{report}
\usepackage{fullpage}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{remark}[theorem]{Remark}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\begin{document}
\chapter{The First Chapter}
\begin{theorem} Here's some stuff.\end{theorem}
\begin{remark} Here's a remark about stuff \end{remark}
\section{stuff part 2}
\begin{corollary} Here's some stuff about stuff\end{corollary}
\begin{conjecture} Here's what should happen \end{conjecture}
\chapter{The Second Chapter}
\begin{lemma} Here's some small stuff\end{lemma}
\begin{lemma} Here's some more smalll stuff\end{lemma}
\section{big stuff}
\begin{theorem} Big Theorem\end{theorem}
\begin{theorem} Big Theorem\end{theorem}
\begin{corollary} Big Consequence.\end{corollary}
\section{almost as big stuff}
\begin{lemma} small stuff\end{lemma}
\begin{theorem} big stuff\end{theorem}
\begin{corollary} big stuff\end{corollary}
\chapter{The Third chapter}
\begin{definition} How about this stuff?\end{definition}
\end{document}

Note that the first lemma of chapter 2 prints as lemma 2.0.3 and the definition in chapter 3 prints as definition 3.0.4

share|improve this question
2  
Have a look at tex.stackexchange.com/questions/24822/… –  lockstep Apr 6 '12 at 17:17
add comment

1 Answer

up vote 4 down vote accepted

you are numbering theorems within sections. therefore, if a theorem appears within the first part of a chapter before the first \section command, the theorem number won't be reset. (it isn't automatically reset at a chapter break since you have specified per-section numbering.)

add the code \setcounter{theorem}{0} at the beginning of any chapter where you will have theorem-class objects before the first section.

the reference given in @lockstep's comment also contains a workable approach.

share|improve this answer
    
I implemented this and it worked. Thanks! –  user13352 Apr 6 '12 at 18:26
add comment

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.