# [texhax] Problem with eqnarray

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Fri Apr 8 11:10:19 CEST 2005

> \begin{eqnarray}
>   f(x,y,z) & = & P \times \\
>   \exp \bigl[ -\bigl( \frac{ \cos \theta \cos \phi (x - \mu_x) \\
>                             + \sin \theta (y - \mu_y) \\
>                    - \cos \theta \sin \phi (z - \mu_z)}{A_x} \bigr)^2 \\
>             -\bigl(\frac{ \sin \theta \cos \phi (x - \mu_x) \\
>                         + \cos \theta (y - \mu_y) \\
>                   + \sin \theta \sin \phi (z - \mu_z)}{A_y} \bigr)^2 \\
>   -\bigl( \frac{\sin \phi (x - \mu_x) + \cos \phi (z - \mu_z)}{A_z}
> \bigr)^2 \bigr]
> \end{eqnarray}

the problem (which i hadn't spotted before) is presumably the array
break commands inside the argument of \frac: each one is trying to
start a new alignment line for the eqnarray, and getting confused.

\\ is bad news pretty much everywhere except in alignments: take your
\frac out of the equation and the \\ commands are ignored.

i would recommend putting the array inside the \frac argument into an
array or something.