Text Formatting ⇒ automatic numbering in align* environment
automatic numbering in align* environment
I am using an align* environment because for nearly all of my lines, i do not want them to be numbered. But for a few certain ones, I do want them numbered. My question is how to get this done automatically.
I do know of two ways to do this, but they are not automatic and somewhat laborious. One is to use the align environment, and put a \notag command on every line where you don't want it numbered. The second way is to use align* and add a \tag{...} on the lines you do want numbered, but then these numbers are not automatically updated.
Any ideas?
Thanks in advance,
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
automatic numbering in align* environment
Code: Select all
\documentclass{article}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\begin{document}
Text here
\begin{align}
a&=b, \\
c&=d, \label{eq:1} \\
e&=f.
\end{align}
By \eqref{eq:1}\ldots
\end{document}