Hey,
in LyX, I know how to insert numbered equations so that I have the number of the equation written in the marginal, like this:
As you can see, the number in the second theorem is (2) because I have already used the "numbered equation" once in my document. I want this counter to reset for each theorem. That is, in my example, both of the numbers should be (1).
ps. If possible, I'd prefer if this could be done purely by using the LyX interface.
LyX ⇒ Numbering Equations by Theorem
Numbering Equations by Theorem
Last edited by localghost on Tue Jul 24, 2012 5:25 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Numbering Equations by Theorem
The package
chngcntr supports such customization, besides low level LaTeX commands. You could write in your document preable, which you can modify via the LyX menu Document / Settings
If your theorem counter had another name, use that one in the second line.
Note, that it's difficult to understand references, if you have several equations (1). It could be a good idea to label them together with the theorem number, such as (1.2.1) if at all - I would number then independently of theorems. Perhaps I would not number at all, if they are not referenced, just displayed in theorems.
Stefan

Code: Select all
\usepackage{chngcntr}
\counterwithin*{equation}{theorem}
Note, that it's difficult to understand references, if you have several equations (1). It could be a good idea to label them together with the theorem number, such as (1.2.1) if at all - I would number then independently of theorems. Perhaps I would not number at all, if they are not referenced, just displayed in theorems.
Stefan
LaTeX.org admin
Numbering Equations by Theorem
Thank you Stefan, what you said worked well.
However, I'm planning to use this numbering only to make it easier for the reader to follow my proofs. Say, if I wanted to prove the Pythagora's Theorem, I could label the equation as (1), and start my proof by "To prove the theorem, it suffices to show that (1) holds for all positive numbers."
Of course, in such simple case this this kind of numbering is unnecessary but I have found it helpful in cases that have lots of conditions and equations.
Yes, I realised it wouldn't be easy to understand where I was referencing by say "equation (5)" if I had multiple equations labeled as (5).Stefan_K wrote: Note, that it's difficult to understand references, if you have several equations (1). It could be a good idea to label them together with the theorem number, such as (1.2.1) if at all - I would number then independently of theorems. Perhaps I would not number at all, if they are not referenced, just displayed in theorems.
Stefan
However, I'm planning to use this numbering only to make it easier for the reader to follow my proofs. Say, if I wanted to prove the Pythagora's Theorem, I could label the equation as (1), and start my proof by "To prove the theorem, it suffices to show that (1) holds for all positive numbers."
Of course, in such simple case this this kind of numbering is unnecessary but I have found it helpful in cases that have lots of conditions and equations.