2

How to make the label of equation at the end of the equation?

and not in the middle of equation using \begin{split}

enter image description here

My MWE:

\begin{equation}
\begin{split}
A =& A+ B \\
  =& A-C \\
  =& d + f -d \\
  =& 1234
\end{split}
\end{equation}


\begin{equation}
A =  1234
\end{equation}
2
  • 1
    Off-topic: In order to get the typographically correct amount of spacing around the = symbols, it's essential to write &= rather than =&.
    – Mico
    May 3 '20 at 14:25
  • @Mico. Thanks.It is strange that both way =& and &= works. But i guess &= is better. But I could not see the difference
    – aan
    May 3 '20 at 14:27
5

With the environment DispWithArrows of witharrows (which is similar to align of amsmath), you have an option to specify that you want to tag only the last line.

You may also fix globally this option with \WithArrowsOptions{tagged-lines = last}.

Of course, the first aim of witharrows is to add arrows in such alignments and that's why I've added an arrow.

\documentclass[12pt]{book}
\usepackage{witharrows}
\begin{document}
\begin{DispWithArrows}[tagged-lines = last]
A & = A+ B \\
  & = A-C \Arrow{an arrow} \\
  & = d + f -d \\
  & = 1234
\end{DispWithArrows}
\end{document}

Result of the above code

3
  • Thanks. What happened if I want to specific a line to be label (either line 2, line 3). I posted another questions.
    – aan
    May 3 '20 at 14:28
  • Take a closer look at the space around the = signs. The & should precede it: &=. May 3 '20 at 18:39
  • @ Babara Beeton: You re right. I have modified. May 3 '20 at 19:13
6

enter image description here

If this features is desired in whole document, than the asmath's option tbtags solve your problem:

\documentclass{article}
\usepackage[tbtags]{amsmath}

\begin{document}
\begin{equation}
\begin{split}
A & = A+ B      \\
  & = A-C       \\
  & = d + f -d  \\
  & = 1234
\end{split}
\end{equation}

\begin{equation}
A =  1234
\end{equation}
\end{document}
5
  • @Zarco ... see the second comment in my answer ... (+1)
    – koleygr
    May 3 '20 at 12:56
  • +1. Do please change all instances of = & to &=, though.
    – Mico
    May 3 '20 at 14:23
  • @Zarko, Thanks. What happened if I want to specific a line to be label (either line 2, line 3). I posted another questions. tex.stackexchange.com/questions/542050/…
    – aan
    May 3 '20 at 14:28
  • @Mico, you are right. I (again) overlooked this misplacing in OP question. Corrected!
    – Zarko
    May 3 '20 at 14:40
  • 2
    @aan, I clearly stated that use of tbtag influence on all similar cases in document. If you like to change placement in just one occasions, than you should stick with other answers.
    – Zarko
    May 3 '20 at 14:44
4

Try like this:

\documentclass[12pt,twoside,draft]{book}
\usepackage{amsmath}


\begin{document}



\begin{align}\nonumber
A &= A+ B \\\nonumber
  &= A-C \\\nonumber
  &= d + f -d \\
  &= 1234
\end{align}



\begin{equation}
A =  1234
\end{equation}
\end{document}

enter image description here

5
  • Generally, you should stack two separate align/equation environments like that. It'd be better to include the equation into the align (and I'd probably have \nonumber just before \\ , since that's the line it's modifying).
    – Teepeemm
    May 3 '20 at 12:33
  • 3
    With =& in the align, we don't have the right space after the =. You should use &= instead. May 3 '20 at 12:49
  • @Teepeemm It is just an example I suppose and I can't know if one align could be ok for the op ... He could possibly have already used one and not two, bat mau be you are right... About the \nonumber LaTeX doesn't really care if it is before or after the equation ...
    – koleygr
    May 3 '20 at 12:54
  • @F.Pantigny ... Yes ... right ... just copy pasted and didn't try to improve the code ... just added the code in a align environment and could nor right all that in a comment (it shows terrible ...) [Thanks ... fixed!]
    – koleygr
    May 3 '20 at 12:55
  • \notag is equivalent to \nonumber, and is shorter to type. May 3 '20 at 18:41

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.