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've recently asked a question: Chapters in TeX

regarding working with chapters in tex. I have since learned that I must use documentclass report for the purposes of my document. However, now all of my Theorems, Corollaries, Remarks, and so forth are numbered "0.number.number" (with the first 0 never changing). I would like, at the very least, to understand how to make the first number denote the number of the chapter.

The current code I have is this:

\newtheorem{thm}{Theorem}[section]
\newtheorem{rmk}[thm]{Remark}
\newtheorem{qst}[thm]{Question}
\newtheorem{prp}[thm]{Proposition}
\newtheorem{hyp}[thm]{Hypotheses}
\newtheorem{crl}[thm]{Corollary}
\newtheorem{cnj}[thm]{Conjecture}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{dff}[thm]{Definition}
\newtheorem{clm}[thm]{Claim}
\newtheorem{ntt}[thm]{Notation}
\numberwithin{equation}{section}
share|improve this question
2  
You probably also have section numbers staring with 0 that never changes. If so, you're probably not using \chapter at all. If you want to get rid of the chapter numbering, you could try \makeatletter\renewcommand{\thechapter}{\@gobble}\makeatother. This is a very crude suggestion, but without more information it might work. –  Werner Apr 29 '12 at 17:04
4  
Change the line: \newtheorem{thm}{Theorem}[section] to \newtheorem{thm}{Theorem}[chapter] –  Marco Daniel Apr 29 '12 at 17:05
    
I see the problem now. I was using \chapter* rather than \chapter. Is there a way for me to still use \chapter* AND have the numbering? –  Nicole Apr 29 '12 at 17:08
    
@Nicole: Which numbering do you mean? chapter number? Why do you use chapter*? –  Marco Daniel Apr 29 '12 at 17:11
2  
@Nicole the only reason for using \chapter* rather than \chapter is to avoid numbering. If you want numbers then you want \chapter. –  David Carlisle Apr 29 '12 at 17:46

1 Answer 1

up vote 8 down vote accepted

All LaTeX classes use the \thechapter,\thesection etc., to style the numbering of the various section numbers. You can redefine these to whatever you wish. In the example below, I have redefined the \thechapter and \thesection to remove the dot and the objectionable zero. This way you can still keep on using the \chapter command and you will have no problems with the Table of Contents. I personally dislike the use of star commands as they are very unsemantic if one can coin such a word.

\documentclass{report}
\makeatletter\renewcommand{\thechapter}{}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\chaptername}{}
\makeatother

\newtheorem{thm}{Theorem}[section]
\begin{document}
\chapter{A chapter title}
\section{A section}
\begin{thm} A theorem \end{thm}
\end{document}

I have also removed the word chapter as it is meaningless, if there is no number.

If you want to number the sections with chapter numbers (but not show them in the Chapter head), use:

\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}

I am not too sure if this is a good idea though, as it will be confusing to the reader and have never seen such a style in any book.

enter image description here

share|improve this answer

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.