Math & ScienceCounterpart to \nonumber

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
achim
Posts: 49
Joined: Wed Aug 05, 2009 2:29 pm

Counterpart to \nonumber

Post by achim »

Hi all

I was wondering about this for a while:

In equations, it's easy to suppress the numbering with the \nonumber command. But how can one only have one equation numbered in a environment like:

Code: Select all

\begin{align*}
    ...
\end{align*}
?

E.g.:

Code: Select all

\documentclass{article}

\usepackage[sumlimits, intlimits]{amsmath}      %Math Type setting
\usepackage{amsfonts}                           %Math Fonts

\begin{document}


\begin{align}
	w(s, \tau) &= \sum_j^n \Phi_{Wj}(s) q_{wj}(\tau) = \mathbf{\Phi}_W^T(s) q_W(\tau) \nonumber \\
	\theta(s, \tau) &= \sum_j^n \Phi_{Tj}(s) q_{Tj}(\tau) = \mathbf{\Phi}_T^T(s) q_T(\tau)
\end{align}

\hrule

\begin{align*}
	w(s, \tau) &= \sum_j^n \Phi_{Wj}(s) q_{wj}(\tau) = \mathbf{\Phi}_W^T(s) q_W(\tau) \\
	\theta(s, \tau) &= \sum_j^n \Phi_{Tj}(s) q_{Tj}(\tau) = \mathbf{\Phi}_T^T(s) q_T(\tau) % \number or so?
\end{align*}

\end{document}
Is there a counterpart to \nonumber?

Cheers
Last edited by achim on Wed Dec 15, 2010 3:07 am, edited 1 time in total.
OS: Kubuntu
Distribution: TexLive
Editor: Kile

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Counterpart to \nonumber

Post by frabjous »

I think the normal way of dealing with this is just to use \nonumber or \notag on all the lines you don't want numbered with an align environment. If you're set on using align*, I suppose you could use \refstepcounter{equation}\tag{\theequation} though it feels a bit hacky.

Code: Select all

\begin{align*}
   w(s, \tau) &= \sum_j^n \Phi_{Wj}(s) q_{wj}(\tau) = \mathbf{\Phi}_W^T(s) q_W(\tau) \\
   \theta(s, \tau) &= \sum_j^n \Phi_{Tj}(s) q_{Tj}(\tau) = \mathbf{\Phi}_T^T(s) q_T(\tau) \refstepcounter{equation}\tag{\theequation}
\end{align*}
Also, if the idea behind this is that there should be a single reference number assigned to the whole series of equations, then consider using an aligned environment (inside another math environment) instead, e.g.:

Code: Select all

\begin{equation}
\begin{aligned}
   w(s, \tau) &= \sum_j^n \Phi_{Wj}(s) q_{wj}(\tau) = \mathbf{\Phi}_W^T(s) q_W(\tau) \\
   \theta(s, \tau) &= \sum_j^n \Phi_{Tj}(s) q_{Tj}(\tau) = \mathbf{\Phi}_T^T(s) q_T(\tau) 
\end{aligned}
\end{equation}
(The single number is thus centered in the middle.)
achim
Posts: 49
Joined: Wed Aug 05, 2009 2:29 pm

Counterpart to \nonumber

Post by achim »

I was in fact trying to have only one equation numbered in the align* environment (as you correctly addressed in the first part of your answer) and not have the number centred over the environment.
Of course there is no reason not to use the \nonumber if the align* only holds a few equations. It's rather handy though if there are more equations in it. Specifically I'm thinking of the situation where one uses the \intertext{...} in order to have all equations in a section aligned equally. Anyway, this could be a follow up question. It's quite cumbersome to use the \intertext{} all the time within an align environment. Is there an easier way to maybe 'synchronise' all the align environments?

As for the numbering, It's probably a good idea to define a new command:

Code: Select all

\newcommand{\eqnumbering}{%
    \refstepcounter{equation}\tag{\theequation}
    }
Thanks for the help frabjous!
OS: Kubuntu
Distribution: TexLive
Editor: Kile
Post Reply