I have been told that there was a way to use text within eqnarray; however, I have not been able to find or create any workable code. Any help is appreciated.
Asked
Active
Viewed 1.4k times
2
Torbjørn T.
- 206,688
Mathematician
- 3,363
1 Answers
3
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{eqnarray}
\text{left} &=& \text{right}
\end{eqnarray}
\begin{align}
\text{left} &= \text{right}
\end{align}
\end{document}

edit: (by bbeeton, without consulting Sigur)
Consider the following slightly extended example:
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{eqnarray*}
\text{left} &=& \text{middle} = \text{right}
\end{eqnarray*}
\begin{align*}
\text{left} &= \text{middle} = \text{right}
\end{align*}
\end{document}

(There isn't any facility for adding extra alignment points in eqnarray; they are
changed to "new line" breaks, after being reported as an error.)
Now is it obvious what the (or at least one) problem is with eqnarray?
barbara beeton
- 88,848
Sigur
- 37,330
-
I prefer the top version (which is
eqnarray). Why should I not use it? – Mathematician Jun 17 '14 at 19:43 -
@Mathematician, see the Ian comment above. He linked a pdf file. See it and also the section 2.2 therein. – Sigur Jun 17 '14 at 19:44
-
@Mathematician: Look at the spacing of
\text{left}=\text{right}and compare it to the spacing of\begin{eqnarray} \text{left} &=& \text{right} \end{eqnarray}- they're inconsistent. – Werner Jun 17 '14 at 19:44 -
@Sigur So, based on Section 2.2, using
eqnarray*is good since that does not label the equation. – Mathematician Jun 17 '14 at 19:48 -
@Werner I am sorry, but I do not understand what you are talking about. The spacing looks fine to me. – Mathematician Jun 17 '14 at 19:49
-
@Mathematician, OK. But and if you really need to number it? Also, see 2.3. – Sigur Jun 17 '14 at 19:49
-
1@Mathematician: Yes, the spacing looks fine to you in the separate environments and that's good. In a similar light, the discussion in What is the Necessity of
$…$Around Numbers? would probably seem superfluous to you... and that's fine as well. It's just that a majority of LaTeX users have conformed to not usingeqnarrayfor reasons already mentioned. Just like I enjoy cream in my coffee doesn't mean that everyone has to follow what I do, so be happy with your choice and accept that (most) others have a different opinion. – Werner Jun 17 '14 at 19:53 -
1@Mathematician Apart of the spacing, if your equation is long,
eqnarraytype the number of the equation over the equation, whilealigntype the equation number below the equation. – Dox Jun 17 '14 at 19:56 -
@Werner You say that the majority of LaTeX users have conformed to not using
eqnarraybut no one has said explicitly WHYalignis better. I am just trying to figure out why. I am not trying to give people a hard time. I just want to know whether the preference ofalignovereqnarrayis merely opinion or whether there is an actual reason. – Mathematician Jun 17 '14 at 20:02 -
-
@Mathematician, if this would the case, we would have to change all our old files. – Sigur Jun 17 '14 at 20:05
-
3@Mathematician: I think most of that is covered in
eqnarrayvsalign(and the links provided there). Many things remain in (La)TeX for legacy reasons, otherwise there would be no compatibility with a new/updated release (...things would break). – Werner Jun 17 '14 at 20:06
\text{}withamsmathpackage. – Sigur Jun 17 '14 at 19:30align... – Dox Jun 17 '14 at 19:32alignand compare the result witheqnarray. – Sigur Jun 17 '14 at 19:33