\documentclass{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{mathtools}
\begin{document}
\begin{align}
\begin{split}
\label{eq:lines}
Q_{1x} &= C_{1x} + \mu_1 \vec{h_{1x}} \\
Q_{1y} &= C_{1y} + \mu_1 \vec{h_{1y}} \\
\vdots \\
Q_{3z} &= C_{3z} + \mu_3 \vec{h_{3z}}
\end{split} \\
\begin{split}
\label{eq:distances}
\overline{Q_1 Q_2}^2 &= (Q_{1x}-Q_{2x})^2 + (Q_{1y}-Q_{2y})^2 + (Q_{1z}-Q_{2z})^2\\
\vdots
\end{split}
\end{align}
\end{document}
I want to align the equations in both split-environments along the "="-Symbol in the same way.
Any ideas?
Best Answer
All you need to do is to remember to put alignment signs
&
on all the lines in yoursplits
(your code has none on the\vdots
lines). Minimising your example gives:Now you need to decide how you want to place the
\vdots
...Discussion
The documentation
amsmath.pdf
is not so clear about this structure sayingin the section "Split equations with alignment", in contrast to the description under
gather
However, the accompanying filed
testmath.pdf
contains two explicit examples of multiplesplits
within analign
. What you can't do is enclose such asplit
construction inside e.g. a\left ... \right
construction.Note that there is the package
breqn
which contains code that allows complicated alignment between various blocks, but it alters fundamental constructions in math mode, and so has a number of compatibility issues.