Align $:=$ with $=$ in align/split mode
\documentclass[12pt]{amsart}
\usepackage{amsfonts,graphics,amsmath,amsthm}
\usepackage{amsfonts,amscd, amssymb,amsmath,latexsym}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{split}
A :={}& B - C \\
={}& U + V \\
\geq{}& Z.
\end{split}
\end{equation}
\end{document}
With a TABstack, one does not need to add the blank groups that the split
version needs, because TABstacks automatically, by default, add a group to the right end of each cell. The blank group can be defaulted to the left of each cell with the declaration \TABbinaryLeft
(also \TABunaryRight
), or blank groups can be added to both ends of each cell with \TABbinary
. The original default condition can be restored with \TABbinaryRight
(also \TABunaryLeft
).
\documentclass[12pt]{amsart}
\usepackage{amsfonts,graphics,amsmath,amsthm}
\usepackage{amsfonts,amscd, amssymb,amsmath,latexsym}
\usepackage{mathtools}
\usepackage{tabstackengine}
\TABstackMath
\begin{document}
\begin{equation}
\tabbedCenterstack[r]{
A \coloneqq& B - C \\
=& U + V \\
\geq& Z.
}
\end{equation}
\end{document}
Note that I preferably use \coloneqq
instead of :=
, since \coloneqq
comes ready made with vertical symmetry, whereas :=
does not.
This produces perfect alignment, and only affects the first line.
as shown by replacing the first \\
by \\[-.9\baselineskip]
.
However, it might be a bit silly...
The output
with \\[-.9\baselineskip]
without
The code
\documentclass[12pt]{standalone}
\usepackage{mathtools}
\newlength\myUselessLength
\begin{document}
\settowidth{\myUselessLength}{${}={}$}
$
\begin{aligned}
A\coloneqq{}\hspace{-\myUselessLength} & \phantom{{}={}} B - C \\
& = U + V \\
& \geq Z. \\
\end{aligned}
$
\end{document}