I'm creating some lecture notes for my class using the book
class, it is structured by chapters and sections. In some of my sections I want to add homework (and in some, I don't). I've been accomplishing this with the amsthm
package:
\newtheorem{homew}{Homework}
\begin{homew} Solve for $x$
\begin{enumerate}
\item $1=x+2$
\item $1=x-2$
\end{homew}
However, I want this homework to be numbered by the section it is in, so I can call back to it. So for example I want my document to look like this:
Chapter 1
Section 1
Homework 1
Section 2
Section 3
Section 4
Homework 4
And so on.
My question is two-fold:
- How to accomplish this? The counter options when creating a newtheorem don't do it. I don't want the Homework to be numbered as Homework 4.1 (there's no Homework 4.2, so what's the point?), and giving it its own counter doesn't work since then I get Homework 2 in Section 4, which I don't want either.
- Is there a more elegant way of doing this? I'm really new to LaTeX so I appreciate any help.
\renewcommand*{\thehomew}{\arabic{section}}
right after the definition of thehomew
environment?amsthm
package for this. There might be other ways but this one is fine.