我需要对齐两个方程,其中一个跨越两条线。
我已经尝试过解决方案这里,但是这不是针对矩阵方程的,而且它似乎不适用于这些方程。
我的最小化代码是:
\begin{align} %start alignment between state and observation equation
%State Equation
\begin{split} %split the observation equation in two so it fits on the page
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix}
&= %This & is to align the state and observation equation
\begin{bmatrix}
a&b\\
b&c\\
d&e
\end{bmatrix}
& %This & is to align the splitted state equation
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix}\\ %This \\is to split the state equation
+
\begin{bmatrix}
a&b\\
b&c\\
c&d
\end{bmatrix}
\begin{bmatrix}
a\\
b\\
c\\
\end{bmatrix} +
\begin{bmatrix}
a\\
b
\end{bmatrix}
&a %This & is to align the splitted state equation
\end{split} \\ %This \\ is to split the state and observation equation
%Observation Equation
a &= %This & is to align the state and observation equation
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
a\\
b
\end{bmatrix}
\end{align}
为了便于阅读,我在上面的示例中添加了少量代码。但我的实际输出如下所示:
令人恼火的是,方程 5.17(状态方程)分成 3 个,而不是 2 个,以便适合页面。我还得到了错误Extra alignment tab has been changed to \cr.
我怎样才能将方程 5.17 分成两个,并且使方程 5.17 和 5.18 对齐?
期望的外观
但由于状态方程 (5.17) 两部分之间的空间较小
答案1
拆分对于对齐来说是多余的。只需使用 \notag 即可避免在任何特定行上放置方程编号。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align} %start alignment between state and observation equation
%State Equation
%\begin{split} %split the observation equation in two so it fits on the page
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix}
&= %This & is to align the state and observation equation
\begin{bmatrix}
a&b\\
b&c\\
d&e
\end{bmatrix}
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix} \notag \\ %split here
&\quad +
\begin{bmatrix}
a&b\\
b&c\\
c&d
\end{bmatrix}
\begin{bmatrix}
a\\
b\\
c\\
\end{bmatrix} +
\begin{bmatrix}
a\\
b
\end{bmatrix} a
\\ %This \\ is to split the state and observation equation
%Observation Equation
a &= %This & is to align the state and observation equation
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
a\\
b
\end{bmatrix}
\end{align}
\end{document}
答案2
您可以尝试
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\begin{split}
\begin{bmatrix}
a\\ b\\ c
\end{bmatrix}&=\begin{bmatrix}
a & b & c \\ e & f & g \\ h & i & j
\end{bmatrix}\begin{bmatrix}
ab \\ cd \\ ef
\end{bmatrix} \\
&\phantom{aaaaaa}+\begin{bmatrix}
a & b \\ c & d \\ e & f
\end{bmatrix}\begin{bmatrix}
ab \\ cd \\ ef
\end{bmatrix}+\begin{bmatrix}
a \\ b
\end{bmatrix}X
\end{split}\\
Y&=\begin{bmatrix}
a & b
\end{bmatrix}\begin{bmatrix}
c \\ d
\end{bmatrix}
\end{align}
\end{document}