# Align and split subequations

I would like to ask for some help with aligning subequations. Note that we have two subequations that need to be split due to its size. Thus, my code is:

\begin{subequations}
\begin{alignat}{4}
\begin{aligned}
& B_{1(t)} &= -L_{x_{1(t)0}} & - S_{u1(t)0}^{-1} \left( L_{s_{u1(t)0}} - Y_{u1(t)0} \, L_{\lambda_{u1(t)0}} \right) \\
& &      & - S_{l1(t)0}^{-1} \left( L_{s_{l1(t)0}} + Y_{l1(t)0} \, L_{\lambda_{l1(t)0}} \right),
B_{1(t)} \in \mathscr{R}^p ;
\end{aligned}
\\
\begin{aligned}
& B_{2(t)} &= -L_{x_{2(t)0}} & - S_{u2(t)0}^{-1} \left( L_{s_{u2(t)0}} - Y_{u2(t)0} \, L_{\lambda_{u2(t)0}} \right) \\
& &      & - S_{l2(t)0}^{-1} \left( L_{s_{l2(t)0}} + Y_{l2(t)0} \, L_{\lambda_{l2(t)0}} \right),
B_{2(t)} \in \mathscr{R}^q ;
\end{aligned}
\\
\begin{aligned}
A_{(n,t)} & = A_{(t,n)}^T = \left[ \, M_t \, | \, 0 \, \right]_{p \times (p+q+3n)}, A_{(n,t)} \in \mathscr{R}^{p \times (p+q+3n)};
\end{aligned}
\\
\begin{aligned}
A_{(n,n)} & = Y_{n0}^{-1} \, S_{n0} \, I, A_{(n,n)} \in \mathscr{R}^{p \times p};
\end{aligned}
\\
\begin{aligned}
b_n       & = L_{\lambda_{n0}} - Y_{n0}^{-1} L_{s_{n0}}, b_n \in \mathscr{R}^p;
\end{aligned}
\end{alignat}
\end{subequations}


The result is:

The desired output is something similar to the following, by aligning to the '=':

Any ideas how to achieve the desired output?

• welcome to tex.sx. please extend your example so that it's compilable (with \documentclass and \begin{document} ... \end{document}) so we can cut and paste to compile. i think an outer align with nested alignedat' groups is what's mostly wanted. at least it would get rid of the too-wide spaces before the = signs in (6.9h) and (6.9i), but it wouldn't align everything to the left of the first = signs at the left. that needs more work. – barbara beeton Sep 8 '16 at 21:36

## 2 Answers

I'd suggest not being too concerned about the vertical placement of the split equation numbering, and just set them in line with the last segment:

\documentclass{article}

\usepackage{amsmath,mathrsfs}

\begin{document}

\begin{subequations}
\begin{align}
B_{1(t)}  &= -L_{x_{1(t)0}} - S_{u1(t)0}^{-1} \bigl( L_{s_{u1(t)0}} - Y_{u1(t)0} \, L_{\lambda_{u1(t)0}} \bigr) \nonumber \\
&\hphantom{{}= -L_{x_{1(t)0}}} - S_{l1(t)0}^{-1} \bigl( L_{s_{l1(t)0}} + Y_{l1(t)0} \, L_{\lambda_{l1(t)0}} \bigr), B_{1(t)} \in \mathscr{R}^p ; \\
B_{2(t)}  &= -L_{x_{2(t)0}} - S_{u2(t)0}^{-1} \bigl( L_{s_{u2(t)0}} - Y_{u2(t)0} \, L_{\lambda_{u2(t)0}} \bigr) \nonumber \\
&\hphantom{{}= -L_{x_{2(t)0}}} - S_{l2(t)0}^{-1} \bigl( L_{s_{l2(t)0}} + Y_{l2(t)0} \, L_{\lambda_{l2(t)0}} \bigr), B_{2(t)} \in \mathscr{R}^q ; \\
A_{(n,t)} &= A_{(t,n)}^T = \bigl[ \, M_t \, | \, 0 \, \bigr]_{p \times (p+q+3n)}, A_{(n,t)} \in \mathscr{R}^{p \times (p+q+3n)}; \\
A_{(n,n)} &= Y_{n0}^{-1} \, S_{n0} \, I, A_{(n,n)} \in \mathscr{R}^{p \times p}; \\
b_n       &= L_{\lambda_{n0}} - Y_{n0}^{-1} L_{s_{n0}}, b_n \in \mathscr{R}^p;
\end{align}
\end{subequations}

\end{document}


I've used align which is typically used only with one alignment along the relation. In order to achieve the second alignment for the split equations, we insert an \hphantom.

The above solution does align the left-hand side of the align to the right, which differs from your example/expected output. However, this seems more standard. That could be changed though.

How about this way?

\documentclass{article}
\usepackage{mathtools}
\usepackage{mathrsfs}

\begin{document}

\begin{subequations}
\begin{alignat}{2}
B_{1(t)} &= \!\mathrlap{\begin{alignedat}[t]{2}-L_{x_{1(t)0}} & - S_{u1(t)0}⁻¹ \left( L_{s_{u1(t)0}} - Y_{u1(t)0} \, L_{\lambda_{u1(t)0}} \right) \\
& - S_{l1(t)0}⁻¹ \left( L_{s_{l1(t)0}} + Y_{l1(t)0} \, L_{\lambda_{l1(t)0}} \right), & \enspace B_{1(t)} & ∈ \mathscr{R}^p ; \end{alignedat}} \\[1ex]
B_{2(t)} &= \!\mathrlap{\begin{alignedat}[t]{2}-L_{x_{2(t)0}} & - S_{u2(t)0}⁻¹ \left( L_{s_{u2(t)0}} - Y_{u2(t)0} \, L_{\lambda_{u2(t)0}} \right) \\
& - S_{l2(t)0}⁻¹ \left( L_{s_{l2(t)0}} + Y_{l2(t)0} \, L_{\lambda_{l2(t)0}} \right), & \enspace B_{2(t)} & ∈ \mathscr{R}^q ; \end{alignedat}} \\[1ex]
A_{(n,t)} & = A_{(t,n)}^T = \left[ \, M_t \, | \, 0 \, \right]_{p × (p+q+3n)}, & \qquad A_{(n,t)} & ∈ \mathscr{R}^{p × (p+q+3n)};
\\[1ex]
A_{(n,n)} & = Y_{n0}⁻¹ \, S_{n0} \, I, & A_{(n,n)} & ∈ \mathscr{R}^{p × p};
\\[1ex]
b_n & = L_{\lambda_{n0}} - Y_{n0}⁻¹ L_{s_{n0}}, & b_n & ∈ \mathscr{R}^p;
\end{alignat}
\end{subequations}

\end{document}
`