1

What I want? [that way of numbering]

1   How to do squats

Theorem 1. Put your barbell on your shoulders.
Theorem 2. Squat.

2   How to do bench press

Theorem 1. Lean on a bench.
Theorem 2. Push.

What I get

enter image description here

with this MWE:

\documentclass[10pt]{article}
\usepackage[russian]{babel} 
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}

\section{How to do squats}

\begin{theorem}\normalfont
Put your barbell on your shoulders.
\end{theorem}

\begin{theorem}\normalfont
Squat.
\end{theorem}

\section{How to do bench press}

\begin{theorem}\normalfont
Lean on a bench.
\end{theorem}

\begin{theorem}\normalfont
Push.
\end{theorem}

\end{document}
  • 2
    if you're using amsthm, why specify \normalfont? the same effect is gained by defining theorem using \theoremstyle{definition}. – barbara beeton Jun 12 '14 at 14:40
  • @barbarabeeton, thanks. It is really useful. – Vladimir Yashin Jun 12 '14 at 14:43
2

Just add the following to your code

\makeatletter
\@addtoreset{theorem}{section}
\makeatother

and now the working version

\documentclass[10pt]{article}
\usepackage[russian]{babel} 
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}

\makeatletter
\@addtoreset{theorem}{section}
\makeatother

\begin{document}

\section{How to do squats}

\begin{theorem}\normalfont
Put your barbell on your shoulders.
\end{theorem}

\begin{theorem}\normalfont
 Squat.
\end{theorem}

\section{How to do bench press}

\begin{theorem}\normalfont
 Lean on a bench.
\end{theorem}

\begin{theorem}\normalfont
 Push.
\end{theorem}

\end{document}
  • Yes. This is what I really wanted. Thank you! – Vladimir Yashin Jun 12 '14 at 14:41
  • 2
    to avoid \normalfont, define theorem (or some alternate name) using \theoremstyle{definition}. much cleaner. – barbara beeton Jun 12 '14 at 14:42
1

\newtheorem{theorem}{Theorem}[section]

\newtheorem actually has three different syntaxes.

  • 1
    Thank you for your answer. However I am aware of the number of arguments of this environment. And if you try this on, you will get the double number 1.1; 1.2; 2.1; 2.2 and so on. – Vladimir Yashin Jun 12 '14 at 14:36
  • @VladimirYashin Just add \renewcommand{\thetheorem}{\arabic{theorem}}; you're doing a bad service to your readers, though, because they'll have to look up what section they're in when browsing for a cross reference. – egreg Jun 12 '14 at 15:04
  • @egreg, yes, I totally agree with you. However this is not for publishing and using at all. Lets assume that I have to do it exactly like that. – Vladimir Yashin Jun 12 '14 at 15:24

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.