我想请教一下对齐方面的帮助subequations
。请注意,由于大小原因,我们有两个subequations
需要拆分。因此,我的代码是:
\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}
结果是:
通过与“=”对齐,所需的输出类似于以下内容:
关于如何实现期望的输出有什么想法吗?
答案1
ID建议不用太在意分割方程编号的垂直位置,只需将它们与最后一段对齐即可:
\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}
我使用了align
通常仅用于关系的一次对齐的 。为了实现拆分方程的第二次对齐,我们插入了一个\hphantom
。
上述解决方案确实将左侧align
与正确的,这与您的示例/预期输出不同。但是,这似乎更标准。不过,这可以改变。
答案2
这样怎么样?
\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}