Specify alignment per column in align equation
Your output is what you'd expect from aligned
: you have four columns, the 1st and 3rd right aligned, the 2nd and 4th left aligned, and some space between the first and the second "lr pair". What you actually want is best achieved with a cases
environment; @{}
is used where you don't want space between the columns.
Note that the vertical space between the lines is smaller than with your aligned
code. If you want the same vertical spacing as with aligned
, use \\[\jot]
instead of \\
in the code below.
\documentclass{article}
\usepackage{mathtools} % extends amsmath and fixes some of its quirks
\usepackage{amssymb}
\begin{document}
\begin{align}\label{eq:mergefunction_with_weighting}
\curlyvee(v, \omega) := l_1 \triangleright l_2 =
\left\{
\begin{array}{@{}r@{}l@{}ll}
&l_1(v) & &\text{wenn $v \in G_1 \setminus G_2$}\\
\omega(&l_1(v)) + (1-\omega)(&\hat{R}l_2(v) +\hat{t}) &\text{wenn $v \in G_1 \cap G_2$}\\
& &\hat{R}l_2(v) +\hat{t} &\text{wenn $v \in G_2 \setminus G_1$}.
\end{array}
\right.
\end{align}
\end{document}
You can also use \begin{cases}...\end{cases}
instead of \left\{...\right.
, but then in this particular example the equation number doesn't fit anymore. Moreover, note that there's no need to use align
as the outer environment since that one has no tab stops; I'd use equation
instead.
You can use the cases
environment and \phantom
to achieve the desired alignments
\[
\curlyvee(v, \omega) :=
l_1 \triangleright l_2 =
\begin{cases}
\phantom{\omega(}l_1(v) & \text{wenn $v \in G_1 \setminus G_2$}\\
\omega(l_1(v)) + (1-\omega)(\hat{R}l_2(v) +\hat{t}) &\text{wenn $v \in G_1 \cap G_2$}\\
\phantom{\omega(l_1(v)) + (1-\omega)(}\hat{R}l_2(v) +\hat{t} &\text{wenn $v \in G_2 \setminus G_1$}.
\end{cases}
\]
A second option is to use a tabbing
environment inside a minipage
\[
\curlyvee(v, \omega) := l_1 \triangleright l_2 =
\begin{cases}
\begin{minipage}{0cm}
\begin{tabbing}
$\omega($\=$l_1(v)) + (1-\omega)($\=$\hat{R}l_2(v)+\hat{t})$ \quad\= \kill
\> $l_1(v)$ \>\> wenn $v \in G_1 \setminus G_2$\\
$\omega(l_1(v)) + (1-\omega)(\hat{R}l_2(v) +\hat{t})$ \>\>\> wenn $v \in G_1 \cap G_2$\\
\>\> $\hat{R}l_2(v) +\hat{t}$ \> wenn $v \in G_2 \setminus G_1$.
\end{tabbing}
\end{minipage}
\end{cases}
\]
I think you want to use the alignedat
environment instead of aligned
. This is similar to the aligned
environment in that it provides pairs of r
/l
equations, but without the inter equation space that the aligned
environment adds. So the only changes required to your code as posted above are:
Replace the
\begin{aligned}
with\begin{alignedat}{4}
, and the correspondingend{}
.Change the second and third alignment point from
&
to&&
. This doubling changes the alignment fromr
ight aligned tol
eft aligned which is what you want.Change
text{wenn...}
totext{ wenn...}
, or use\quad\text{wenn...}
instead so that you have some space there.
Notes:
- But as the other solutions mention, the outed environment really is a
cases
(ordcases
) environment and should not be analign
as you do not have multiple equations that are aligned. You have one equation.
Code:
\documentclass{article}
\usepackage{mathtools} % extends amsmath and fixes some of its quirks
\usepackage{amssymb}
\begin{document}
\begin{align}\label{eq:mergefunction_with_weighting}
\curlyvee(v, \omega) :=
l_1 \triangleright l_2 =
\left\{
\begin{alignedat}{4}
&l_1(v) && &&\quad\text{wenn $v \in G_1 \setminus G_2$}\\
\omega(&l_1(v)) + (1-\omega)(&&\hat{R}l_2(v) +\hat{t}) &&\quad\text{wenn $v \in G_1 \cap G_2$}\\
& &&\hat{R}l_2(v) +\hat{t} &&\quad\text{wenn $v \in G_2 \setminus G_1$}.
\end{alignedat}
\right.
\end{align}
\end{document}