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 using the thmtools package to format my theorems. I want theorems to be labeled like: I.1.0, which refers to the first theorem of the first section of the first chapter. (Also, the section counter for chapter I should start at 5.)

(Sorry for the stupid question. I am sure that the answer to it is in the documentation, but I have been poring over it for the past hour, and honestly I can't find it.)

Thanks!

share|improve this question
3  
According to the thmtools documentation, it seems like you're interested in \declaretheorem[numberwithin=section]{theorem}. However, this will start numbering the theorem as 1, not 0. Also, I don't know why "chapter I should start at 5"? Regardless, if you're after roman numerals for your chapters, \renewcommand{\thechapter}{\Roman{chapter}} does this. Otherwise, please provide more detail. –  Werner Sep 12 '11 at 5:37
    
Since you don't usually get to have anything starting from 0 anywhere in LaTeX, this is not trivially possible in thmtools. Maybe what you want re: starting from 5 is not to reset the section counter at all for each chapter, i.e. (chapter, section) should behave like (part, chapter)? –  Ulrich Schwarz Sep 12 '11 at 8:48

1 Answer 1

up vote 3 down vote accepted

Including the explanations from the comment by Werner, I tried to figure out how a MWE would look like in your case. It is possible to set/modify the counters manually like this:

    \documentclass{book}

    \usepackage{thmtools}

    \declaretheorem[numberwithin=section]{theorem}

    \renewcommand{\thechapter}{\Roman{chapter}}

    \begin{document}
    \chapter{title}
    \addtocounter{section}{4}
    \section{something}
    \addtocounter{theorem}{-1}
    \begin{theorem}
        something
    \end{theorem}
    \end{document}

I must confess, I also find it strange that you want to start numbering with 0, but why not! :) With the line \addtocounter{theorem}{-1} you can force that.

share|improve this answer
    
Brilliant++! That did the trick. Thanks. –  kjo Sep 12 '11 at 11:48

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.