0

For long calculations, I have two align* environments for two equations.

I have as an example

\documentclass{article}

\usepackage{amsmath}
\usepackage{nccmath}

\begin{document}

\begin{align*}
\label{Sum 1}1+2=3
1+2=3
1+2=3
1+2=3
1+2=3
1+2=3
1+2=3
\end{align*}
\\
\begin{align*}
\label{Sum 2}3+4=7
3+4=7
3+4=7
3+4=7
3+4=7
3+4=7
\end{align*}

\end{document}

When I try to compile, it says there is an ams error from using "multiple label's" which means it somehow thinks both align* environments are on the same line even though they can't be. I want to use align* because I only want one label for an entire equation, I do not want to have to type \nonumber for every single line in a regular align environment.

  • 2
    use align* instead of align – David Carlisle Jan 5 at 22:53
  • When I use \align* it has no labels at all, I have to use \intertext which doesn't update with changes for cross referencing. – user14554 Jan 5 at 22:55
  • 5
    Please show us a short compilable code resulting in your issue. And please add a screenshot of your result to your question ... – Mensch Jan 5 at 22:57
  • 1
    it is \begin{align*} not \align* you could use \tag to add a label I can not guess what you mean by \intertext which works the same way with align and align* – David Carlisle Jan 5 at 22:58
  • 4
    sorry no we are suggesting that you make your question clear enough that people can help you, but if you would rather not, that is OK too. – David Carlisle Jan 5 at 23:00
1

Just spelling out @DavidCarlisle's comment. (Your code does not compile because there is no \documentclass and you have \usepackages after \begin{document}. Nor does it make too much sense using align the way you do, so I assume you forgot to add multiple \\.)

\documentclass{article}
\usepackage{amsmath}
\usepackage{nccmath}
\begin{document}
\begin{align*}
1+2&=3\\ 
1+2&=3\\
1+2&=3\\
1+2&=3\\
1+2&=3\\
1+2&=3\\
1+2&=3\label{Sum_1}\tag{1}
\end{align*}

\begin{align*}
3+4&=7\\
3+4&=7\\
3+4&=7\\
3+4&=7\\
3+4&=7\\
3+4&=7\label{Sum_2}\tag{2}
\end{align*}
The equations under \eqref{Sum_1} are at least as illuminating as those under
\eqref{Sum_2}.
\end{document}

enter image description here

  • I also have the article document class, but individual labels don't work. Why does adding tag do anything? – user14554 Jan 5 at 23:46
  • 1
    @user14554 align* produces equations without labels. To add a label you can use \tag. (IMHO the cleaner way would be to use align and \notag for all the lines that should not get a number, but this is a matter of taste.) – user121799 Jan 5 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.