Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 at 20:48
    
Yay! Care to submit this as an answer below? –  Medulla Oblongata Jul 15 at 20:53

1 Answer 1

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.