Math & Scienceautomatically number only those equations that I label?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
mattlorig
Posts: 19
Joined: Fri May 14, 2010 9:55 pm

automatically number only those equations that I label?

Post by mattlorig »

When I write a paper, I prefer to number only those equations that I reference later on. Inevitably, as I edit and update my paper, this requires a lot of
1. changing align <---> align*
2. adding and removing \nonumber
I find this rather tedious.

Is there any way to have LaTeX automatically number only those equations that I label? e.g.

Code: Select all

\begin{align}
a &= b \label{eq:one} \\
a &> c
\end{align}
The top equation would carry a number, the bottom one would not.
Last edited by mattlorig on Tue Jul 20, 2010 3:40 am, edited 1 time in total.

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

automatically number only those equations that I label?

Post by gmedina »

Hi,

perhaps the shownolyrefs key for the \mathtoolsset command (from the mathtools package) could be useful for you Using this key, only those equations to which you make reference will be numbered in the final output. Refer to the package documentation for further information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mattlorig
Posts: 19
Joined: Fri May 14, 2010 9:55 pm

Re: automatically number only those equations that I label?

Post by mattlorig »

I haven't tried it yet, but from the documentation you referred me to, that looks like exactly what I need. Thanks!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

automatically number only those equations that I label?

Post by localghost »

As soon as the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules.


Best regard and welcome to the board
Thorsten
Post Reply