LyX ⇒ Numbering Equations by Theorem
Numbering Equations by Theorem
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Numbering Equations by Theorem

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
Numbering Equations by Theorem
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.