1

Apologies for wording my question strangely, but here's what I am asking. So I have the following commands:

\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]

\theoremstyle{remark}
\newtheorem{remark}{Remark}[section]

\theoremstyle{theorem}
\newtheorem{theorem}{Theorem}[section]

\theoremstyle{corollary}
\newtheorem{corollary}{Corollary}[section]

\theoremstyle{lemma}
\newtheorem{lemma}{Lemma}[section]

\theoremstyle{example}
\newtheorem{exmp}{Example}[section]

When I do say three definitions they come up as Definition 1.1, 1.2 and 1.3 which is great, but when I do say a lemma after them it says Lemma 1.1, how do I change it so that it says Lemma 1.4?

Thank you.

1

1 Answer 1

1

When defining theorem environments with amsthm, you can group counters with an optional argument of the \newtheorem command. You can use the optional arguments of \newtheorem in two different ways:

\newtheorem{<environment name>}{<text>}[<parent counter>]

or

\newtheorem{<environment name>}[<shared counter>]{<text>}

The first option is the one you use in your example. The second option allows you to define a new theorem environment with a counter from another that you already defined. Then both environments will be numbered using the same counter. You can use the same counter for more than two environments if you want.

Here's a small example to show how it works. For more details, see the package documentation of amsthm.

\documentclass{article}

\usepackage{amsmath, amsthm}

\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{plain}
\newtheorem{lemma}[definition]{Lemma}
\newtheorem{thm}[definition]{Theorem}

\begin{document}

\section{First section}

\begin{definition}
First definition.
\end{definition}

\begin{definition}
Other definition.
\end{definition}

\begin{lemma}
First lemma.
\end{lemma}

\begin{thm}
First theorem.
\end{thm}

\end{document}

1
  • Thank you very much :)
    – mathlover
    Dec 2, 2019 at 10:28

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.