1

Possible Duplicate:
numbering few equations together

I've got an eqnarray with multiple equations and a label on it, e.g.:

\begin{eqnarray}
  \hat{\delta}(q_0,\epsilon) & = & {\color{orange}q_0} & & & & \\
  \hat{\delta}(q_0,a)    & = & \delta(\hat{\delta}(q_0,\epsilon), a) & = & {\color{orange}\delta(q_0, a)} & = & q_1 \\
  \hat{\delta}(q_0,ac)   & = & \delta(\hat{\delta}(q_0, a), c)       & = & {\color{orange}\delta(q_1, c)} & = & q_1 \\
  \hat{\delta}(q_0,aca)  & = & \delta(\hat{\delta}(q_0, ac), a)      & = & {\color{orange}\delta(q_1, a)} & = & q_2 \\
  \hat{\delta}(q_0,acac) & = & \delta(\hat{\delta}(q_, aca) c)       & = & {\color{orange}\delta(q_2, c)} & = & q_2
  \label{eqn:automata-derivation}
\end{eqnarray}

The important part for me is the colorized as a whole, that means that the whole eqnarray is important and not a single line of it.

If I refer to the label eqn:automata-derivation the reference is just for the last line and every other line is counted apart from it (line 1: (1), line 2: (2), ... , line 5: (5), and if I refer to this only 5 would be shown).

What is the correct way:

  • to count the whole eqnarray as one single equation and not every line each?
  • to refer to it adequately?
David Carlisle
  • 757,742
beyeran
  • 359
  • 1
    You need the amsmath split environment. I'll put an example up in a second. – qubyte Dec 09 '11 at 13:45
  • 1
    @MarkS.Everitt I guess there already exist questions regarding one number for several equations, solved with aligned or split. We could look which one is good here, possible closing as duplicate. – Stefan Kottwitz Dec 09 '11 at 13:51
  • ok, I haven't found it, if possible please post it. – beyeran Dec 09 '11 at 13:53
  • 2
    Please have a look at numbering few equations together. Does it help with the problem, also regarding hyperref? Btw. better avoid eqnarray. – Stefan Kottwitz Dec 09 '11 at 13:53
  • Yes this does it thanks... I'm going to close this now. – beyeran Dec 09 '11 at 13:59
  • @beyeran There's no need to delete. I undeleted it and closed it with a link to the duplicate. Your question is useful, because users could find it via a search engine and are directed to the solutions in the other question. – Stefan Kottwitz Dec 09 '11 at 14:07
  • @StefanKottwitz: This is actually not trivial to solve with split, due to the multiple alignment (not possible in a single split). I have code good to go if it gets reopened. – qubyte Dec 09 '11 at 14:08
  • 1
    Depending on what you're after the subequations environment from amsmath could also be interesting. Put the align within subequations, and the lines will be numbered 1a, 1b, etc. With a label outside align you'll get a reference to eq. 1. – Torbjørn T. Dec 09 '11 at 14:10
  • @MarkS.Everitt That's why we could use aligned or alignedat here. I understood the question was about referencing, not particularly about writing multiple equations with alignment, though it could help the OP. Perhaps we've got a link to a question where that is explained? Posting it in a comment could help. Otherwise, if you think, just click on Vote to reopen and I will gladly reopen it. – Stefan Kottwitz Dec 09 '11 at 14:26

0 Answers0