我正在尝试将一些文本左对齐,如下所示:
但这里的问题是行几乎超出了页面(红色箭头所示)。我想要的是显示在文本下划线的蓝线中。我希望此文本换行,使其从 (mxn) 下方开始,而不是从 '=' 符号下方开始。我尝试了flushleft
环境,但 '=' 符号未对齐,换行的文本从 '=' 符号下方开始。示例代码如下:
\begin{flalign*}
\hat{x}_k &=(n\times 1)\hspace*{2pt} \text{state vector at time $k$}.&\\
A &=(n\times n)\hspace*{2pt} \text{matrix relating $x_k$ to $x^{}_{k+1}$}.&\\
w_k&=(n\times 1) \hspace*{2pt}\text{process noise vector}.&\\
y_k&=(m\times 1)\hspace*{2pt}\text{measurement vector}.&\\
z_k&=(m\times 1)\hspace*{2pt}\text{measurement noise vector}.&\\
H_k&=(m\times n)\hspace*{2pt} \text{matrix giving noiseless connection between measurement and the state vector at time $k$.}&\\
K_k&=(n\times m) \hspace*{2pt}\text{matrix giving Kalman gain}.&\\P_k&=(n\times n)\hspace*{2pt}\text{ matrix giving estimation error covariance.}
\end{flalign*}
答案1
我不会用flalign*
这个。这里有一种方法tabularx
,我展示了两个替代版本(我更喜欢第二个)。
\documentclass{article}
\usepackage{amsmath,tabularx,array}
\usepackage{lipsum} % just for the example
\begin{document}
\lipsum*[2]
\begin{flushleft}
\begin{tabularx}{\textwidth}{@{}>{$}r<{{}$}@{}X@{}}
\hat{x}_k = & $(n\times 1)$ state vector at time $k$.\\
A = & $(n\times n)$ matrix relating $x_k$ to $x_{k+1}$.\\
w_k = & $(n\times 1)$ process noise vector.\\
y_k = & $(m\times 1)$ measurement vector.\\
z_k = & $(m\times 1)$ measurement noise vector.\\
H_k = & $(m\times n)$ matrix giving noiseless connection between
measurement and the state vector at time $k$.\\
K_k = & $(n\times m)$ matrix giving Kalman gain.\\
P_k = & $(n\times n)$ matrix giving estimation error covariance.
\end{tabularx}
\end{flushleft}
\lipsum*[2]
\begin{center}
\begin{tabularx}{0.9\textwidth}{@{}>{$}r<{{}$}@{}X@{}}
\hat{x}_k = & $(n\times 1)$ state vector at time $k$.\\
A = & $(n\times n)$ matrix relating $x_k$ to $x_{k+1}$.\\
w_k = & $(n\times 1)$ process noise vector.\\
y_k = & $(m\times 1)$ measurement vector.\\
z_k = & $(m\times 1)$ measurement noise vector.\\
H_k = & $(m\times n)$ matrix giving noiseless connection between
measurement and the state vector at time $k$.\\
K_k = & $(n\times m)$ matrix giving Kalman gain.\\
P_k = & $(n\times n)$ matrix giving estimation error covariance.
\end{tabularx}
\end{center}
\lipsum[2]
\end{document}