TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to number specific lines of an equation in the align environment. I've seen how to use gather instead of align here, but putting \usepackage[fleqn]{amsmath} in the preamble messes with the other equations in the document.

\documentclass[11pt,a4paper,openright]{book}
\usepackage[latin1]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage[left=1.00in, right=1.00in, top=1.00in, bottom=1.20in]{geometry}
\usepackage[hidelinks]{hyperref}

\begin{document}

For any test function $\phi\in\mathcal{D}$,
\begin{align}
\langle f'(t),\phi(t) \rangle &= \int_{-\infty}^{\infty} f'(t)\phi(t) \mathrm{d}t \\ 
&= [f(t)\phi(t)]_{-\infty}^\infty - \int_{-\infty}^{\infty} f(t)\phi'(t) \mathrm{d}t \\ \nonumber
&= -\langle f(t),\phi'(t) \rangle
\end{align}

\end{document}

I want to number the first and third lines, not the first and second.

share|improve this question
4  
Your \nonumber should be before the \\ that ends the second line. – Werner Jul 15 '14 at 20:48
    
Yay! Care to submit this as an answer below? – Medulla Oblongata Jul 15 '14 at 20:53
up vote 7 down vote accepted

In each line of your align environment, \\ ends the equation. So, any actions you want to perform on that particular line need to go before the ending \\.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

For any test function $\phi\in\mathcal{D}$,
\begin{align}
  \langle f'(t),\phi(t) \rangle &= \int_{-\infty}^{\infty} f'(t)\phi(t) \mathrm{d}t \\ 
    &= [f(t)\phi(t)]_{-\infty}^\infty 
         - \int_{-\infty}^{\infty} f(t)\phi'(t) \mathrm{d}t \nonumber \\ %%%%%%%%
    &= -\langle f(t),\phi'(t) \rangle
\end{align}

\end{document} 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.