How can I number theorems, definitions etc. etc. consecutively in latex without starting an own line for each?
Asked Answered
M

1

10

Because I'm not a native speaker and I'm sure so far noone understood it I will try to explain it in simple words... I'm writing a thesis for my bachelor so it's just around 30 pages... Now I made a definition for some commands like this:

\newtheorem{theo}{Theorem}[chapter]

\newtheorem{lema}{Lemma}[chapter]

\theoremstyle{definition}
\newtheorem{defin}{Definition}[chapter]

\theoremstyle{plain}
\newtheorem{cor}{Corollar}[chapter]

This works great; However e.g. if I'm in chapter 2 and use commands like this:

\cor
\cor
\defin
\lema

it counts like this:

Corollar 2.1 
Corollar 2.2
Definition 2.1
Lemma 2.1

However it doesn't make sense to start an own numbering for corollar, definiton, lemma etc. because the thesis is very short and for this reason it would be more confusing than helping; So I want it to be like this:

Corollar 2.1 
Corollar 2.2
Definition 2.3
Lemma 2.4

Any idea how to do that?

Mccarron answered 14/12, 2015 at 18:40 Comment(1)
Incindental to your question, but you should be writing \begin{cor}...\end{cor}. Just putting \cor is roughly equivalent to \begin{cor} but will leave with an unclosed group.Rodenticide
D
7

As explained there you can try this :

\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theo}{Theorem}[chapter] % reset theorem numbering per chapter

\theoremstyle{definition}
\newtheorem{defin}[theo]{Definition} % definition numbers are dependent on theorem numbers
\newtheorem{lema}[theo]{Lemma} % same for  Lemmas
\newtheorem{cor}[theo]{Corollar}% same for Corollars
Decathlon answered 14/12, 2015 at 20:51 Comment(2)
What do I do, when I do not have theorems but only would like to have section depending numbered definitions?Entomb
You could try something like \renewcommand{\thedef}{\arabic{section}.\arabic{defin}} as suggested here : tex.stackexchange.com/questions/63231/… for theoremsDecathlon

© 2022 - 2024 — McMap. All rights reserved.