TransWikia.com

Definition counter resetting on new section

TeX - LaTeX Asked on June 11, 2021

I encountered this behavior from LaTex: last definition from section 2.1 was labeled (correctly) as 2.1.8. Then, the first definition of the next section was 2.2.9. I would like it to be 2.2.1 (don’t know the standards but that makes much more sense to me). I found this question which is kinda relevant but works with theorems and not definitions.

The only commands(I think) that modify somehow the definitions are:

newtheorem{definition}{MyDef}

renewcommand{thedefinition}{arabic{chapter}.arabic{section}.arabic{definition}}

So, how do I change it? Thanks in advance.

One Answer

Using newtheorem{definition}{Definition}[section] should result in the expected output:

enter image description here

documentclass{report}

newtheorem{definition}{Definition}[section]
begin{document}

chapter{chapter}
section{first section}

begin{definition}
first definition in first section
end{definition}

begin{definition}
second definition in first section
end{definition}

section{second section}

begin{definition}
first definition in second section
end{definition}

end{document}

Correct answer by leandriis on June 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP