Math & Science ⇒ Eqnarray: numbering last line only.
Eqnarray: numbering last line only.
Thank you
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
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Eqnarray: numbering last line only.
don't use eqnarray, I recommend align instead, for reasons see eqnarray vs. align.
You can suppress the number of certain lines inside the align environment if you write \notag before \\, see amsmath user's guide.
Stefan
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Eqnarray: numbering last line only.
Code: Select all
\begin{align}
(a+b)^2&=a^2+2ab+b^2 \nonumber \\
(a-b)^2&=a^2-2ab+b^2 \nonumber \\
(a+b)(a-b)&=a^2-b^2
\end{align}
[1] The PracTeX Journal - Lars Madsen: Avoid eqnarray!
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Eqnarray: numbering last line only.
Code: Select all
\begin{align}
(a+b)^2&=&a^2+2ab+b^2 \nonumber \\
(a-b)^2&=&a^2-2ab+b^2 \\
(a+b)(a-b)&=&a^2-b^2 \nonumber
\end{align}
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Eqnarray: numbering last line only.
the syntax of align is slightly different to that of eqnarray. In eqnarray the & is a column separator, in align the & marks alignment points. That's why you just need one & before the relation symbol. align generates two columns, eqnarray three.
If you want to align at several places, using several & in align, consider to use the alignat environment instead.
Stefan