GeneralSingle equation number in multi-line equation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
Steztric
Posts: 12
Joined: Sat Oct 25, 2008 2:00 pm

Single equation number in multi-line equation

Post by Steztric »

Hey people;

I have a very wide equation that I can't put on one line. If I do, it runs off the end of the page.

Unfortunately, when I use the newline character \\ to put part of the equation on the next line, the eqnarray environment thinks it is another equation and gives a separate equation number to it. It is only supposed to be one equation!

This is the code;

Code: Select all

\begin{eqnarray}
\frac{dP\left(z\right)}{dX} =&re^{-r\left(T-z\right)}\frac{C/{NE}}{1-e^{-rT}} + \frac{1}{E}\int\limits_z^T \frac{dv}{dR}\frac{dR}{dt}e^{-r\left(t-z\right)}dt \\
&-\frac{v\left(\overline{R}\right)}{E}e^{-r\left(T-z\right)} + re^{-r\left(T-z\right)}\frac{\frac{1}{E}\int\limits_0^T ve^{-ru}du}{1-e^{-rT}}
\label{eq:eight}
\end{eqnarray}
Any ideas?

Thanks
I can do magic too... Pass me that muffin. Now you see it; now woo down'.

Recommended reading 2024:

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

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

UJS
Posts: 6
Joined: Wed Nov 19, 2008 12:54 am

Single equation number in multi-line equation

Post by UJS »

If you use \nonumber before a line break, that line won't get an equation number.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Single equation number in multi-line equation

Post by gmedina »

Hi,

to get a centered number, you can use a combination of the align and split environments provided by amsmath, as the following example suggests:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
  \label{eq:eight}
  \begin{split}
    \frac{dP\left(z\right)}{dX} =\ &re^{-r\left(T-z\right)}\frac{C/{NE}}{1-e^{-rT}} + \frac{1}{E}\int\limits_z^T \frac{dv}{dR}\frac{dR}{dt}e^{-r\left(t-z\right)}dt \\
    &-\frac{v\left(\overline{R}\right)}{E}e^{-r\left(T-z\right)} + re^{-r\left(T-z\right)}\frac{\frac{1}{E}\int\limits_0^T ve^{-ru}du}{1-e^{-rT}}
  \end{split}
\end{align}

\end{document}
By the way, you shouldn't use eqnarray anymore. Reasons can be found in l2tabu and in Avoid eqnarray!

The mathmode document contains useful information about typesetting math.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply