0

I am writing solutions for a textbook and the exercises are labelled as [chapter].[section].[exercise] (ex: 6.4.32 would be exercise 32 from section 4 of chapter 6). How do I create a theorem environment with this numbering scheme?

So far I have:

\newcounter{chapter}
\addtocounter{chapter}{6}

\newcounter{section}
\addtocoutner{4}

\newcounter{exercise}
\addtocounter{exercise}{32}

and the theorem environments:

\theoremstyle{definition}
\newtheorem{exrc}{Exercise}[chapter]
\newtheorem{soln}{Solution}[chapter]
\newtheorem{ans}{Answer}[chapter]

But of course this only provides me with the correct chapter numbering, completely ignores the section number, and assumes each exercise directly proceeds the one before, starting at 1 (which is almost never the case for my purposes).

  • 2
    Welcome to TeX SX! Why not \newtheorem{exrc}{Exercise}[section], and so on? – Bernard Jul 3 at 19:50
  • 1
    you should define section to be under chapter, subsection to be under section etc and then finally your theorems to be under subsubsection see for example report class which defines \newcounter {chapter} \newcounter {section}[chapter] \newcounter {subsection}[section] \newcounter {subsubsection}[subsection] \newcounter {paragraph}[subsubsection] \newcounter {subparagraph}[paragraph] – David Carlisle Jul 3 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.