LyXSame counter for Theorems, Lemmas, Definitions,...

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
traveller
Posts: 3
Joined: Wed Feb 08, 2012 1:38 am

Same counter for Theorems, Lemmas, Definitions,...

Post by traveller »

Hi,

When I write Theorems, Lemmas, Definitions, etc. the same counter is used for all of them, it then looks like
Theorem 1
Lemma 2
Theorem 3
Definition 4

This makes no sense, I need different counters as
Theorem 1
Lemma 1
Theorem 2
Definition 1

The problem seems to be in all classes that support Theorems etc.
My workaround is to export to .tex and then manually change

Code: Select all

\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
  \theoremstyle{definition}
  \newtheorem{defn}[thm]{\protect\definitionname}
  \theoremstyle{remark}
  \newtheorem*{rem*}{\protect\remarkname}
  \theoremstyle{plain}
  \newtheorem{lem}[thm]{\protect\lemmaname}
to

Code: Select all

\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
  \theoremstyle{definition}
  \newtheorem{defn}{\protect\definitionname}
  \theoremstyle{remark}
  \newtheorem*{rem*}{\protect\remarkname}
  \theoremstyle{plain}
  \newtheorem{lem}{\protect\lemmaname}
i.e. delete all [thm]. I hope there is a better way since the export to .tex always messes up umlauts and accents.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

Re: Same counter for Theorems, Lemmas, Definitions,...

Post by CSMR »

Document settings -> Modules
Use the "numbered by type" versions of the theorems modules you want.
Post Reply