1

I am typing lecture notes according to day in a single tex file.

The theorems in Lecture of day 1 are numbered as follows:

\newtheorem{theorem}{Theorem}

\begin{theorem}

This is Theorem number 1.

\end{theorem}

....

\begin{theorem}

This is Theorem number 20.

\end{theorem}

Then I continue the same file to type Lecture notes of next day. But there, I want to number Theorems again from 1, 2,... but not 21, 22, .....

How to do this?

2
  • Depending on your setup etc: \setcounter{theorem}{0} after the first day or you have some kind of a day counter.
    – user31729
    Nov 8, 2015 at 12:48
  • I am not worrying for any command on day counter. I am typing just 5 day lecture notes. I worried about numberings on each day to be started from 1.
    – Groups
    Nov 8, 2015 at 12:49

1 Answer 1

2

This will reset the theorem number each time a new 'day' (actually section) has started.

\documentclass{article}

\usepackage{amsmath}
\usepackage{chngcntr}

\newtheorem{theorem}{Theorem}
\counterwithin*{theorem}{section}  % Remove the day number in front of the theorem number.





\begin{document}

\section{First Day}

    \begin{theorem}

    This is Theorem number 1.

    \end{theorem}

    ....

    \begin{theorem}

    This is Theorem number 20.

    \end{theorem}

\section{Another Day}

    \begin{theorem}

    This is Theorem number 1.

    \end{theorem}

    ....

    \begin{theorem}

    This is Theorem number 20.

    \end{theorem}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .