I'm writing an exercise book, and in some exercises I'll have several numbered equations in an align environment, e.g.,
(1) x^2+x+1=0, (2) ax^3+2x=0, (3) x^5=2i,
(4) x^4=-i, (5) x-1/x=2, (6) cosh(x)=3.
(I'll want them to be aligned with respect to the number).
I'm using a macro \newcommand*\ExoEq{\refstepcounter{ExoEq}(\theExoEq)~}
so that the previous example is typed as:
\begin{align*}
\ExoEq&x^2+x+1=0,&
\ExoEq&ax^3+2x=0,&
\ExoEq&x^5=2i,\\
\ExoEq&x^4=-i,&
\ExoEq&x-\frac1x=2,&
\ExoEq&\cosh(x)=3.
\end{align*}
All is good so far, except that I sometimes need to refer to an equation, e.g.,
In Equation~(2), we assume that $a\neq0$.
The thing is when I want to use \label and \eqref, I get weird results in the align environment: here is a minimal example that shows what goes wrong:
\documentclass{amsart}
\usepackage{amsthm}
\usepackage[pdftex]{hyperref}
\parindent0pt
\newtheoremstyle{myexercise}{\baselineskip}{\baselineskip}{}{}{\bfseries}{.}{ }{\thmname{#1}\ \thmnumber{#2}}%
\theoremstyle{myexercise}
\newtheorem{Exo}{Exercise}[section]
\newcounter{MyCounter}
\newcommand*\Number{\refstepcounter{MyCounter}(\theMyCounter)~}
\let\oldlabel\label
\begin{document}
\section{Exercises}
\begin{Exo}
\begin{align*}
\Number\oldlabel{L1}&x^2+x=2,&
\Number\oldlabel{L2}&x^3+x^2=0.
\end{align*}
Equation~\eqref{L1} is very nice, and Equation~\eqref{L2}
is lovely too.
\end{Exo}
\end{document}
Without the hyperref package, I get the exercise reference, instead of the equation reference. With the hyperref package, I get an error on the second latex pass.
I'm using a \let\oldlabel\label trick, as the align* environment redefines \label, and it just doesn't work with \label instead.
How can I work around this annoying thing to have it work?



tabular(x)environment with equations in cells instead ofalign. – Stefan Kottwitz♦ Mar 6 '11 at 12:55