3
\begin{eqnarray} \label{eq1}
\begin{split}
A & = \frac{\pi r^2}{2} \\
 & = \frac{1}{2} \pi r^2
\end{split}
\end{eqnarray}

enter image description here

What this gives me: an equation number between the first and the second equation line.

I'm trying to put the equation number at the fist line (on the the right side).

I've looked at Equation number at the right of first line with multline but unfortunately it doesn't help, because I have to have this equation written in \eqnarray.

thunder
  • 133
  • 2
    don't use split in eqnarray, it is best to avoid eqnarray anyway but split is designed for use with ams alignments. just use align here, with \notag on the second line. – David Carlisle Mar 19 '21 at 12:13
  • 2
    you should not be using eqnarray in the first place, use align then you done get the wrong spacing and other problems that comes with eqnarray. Why are you even combing eqnarray with split, you could just have left of split and put a \notag on the second line – daleif Mar 19 '21 at 12:13
  • @daleif Have to use \eqnarray. It is a mandatory obligation from my professor. – thunder Mar 19 '21 at 12:29
  • 1
    then simply remove split and use \nonumber on the second line (but your professor is wrong) – David Carlisle Mar 19 '21 at 12:32
  • 1
    then send your professor this: http://www.tug.org/TUGboat/tb33-1/tb103madsen.pdf, they should come into the 21 century. A lot of professors have not kept up with developments. I see this a lot in the manuscripts that I edit. Often they just don't know any better. – daleif Mar 19 '21 at 12:51
  • @daleif Will try to update him, but can't promise :) Good argument! – thunder Mar 19 '21 at 12:55

1 Answers1

4

Just use align instead of eqnarray and remove split. In general, always use align if possible, it is preferred to eqnarray.

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}

\begin{align} \label{eq1} A &= \frac{\pi r^2}{2} \ &= \frac{1}{2} \pi r^2 \notag \end{align}

\end{document}

enter image description here

Edit:

In case of eqnarray being mandatory, you can get around this with a bit of "ugly" code:

\begin{eqnarray} \label{eq1}
\setlength{\arraycolsep}{0pt}
A &{}={}& \frac{\pi r^2}{2} \\
  &{}={}& \frac{1}{2} \pi r^2 \notag
\end{eqnarray}

And you get the same result, but I strongly encourage you to update your professor as others have suggested, even this simple example can convince any person.

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
  • 1
    I don't know why @campa deleted his answer, I wrote mine at the same time but didn't submit until he removed his answer. – AboAmmar Mar 19 '21 at 12:19
  • I removed mine because upon re-reading the question I noted that eqnarray is apparently required, so "don't use eqnarray" didn't strike me as a helpful answer :-) Then I started rewriting the answer with eqnarray, then the phone rang... – campa Mar 19 '21 at 12:35