LaTeX 使用矩阵对齐方程

LaTeX 使用矩阵对齐方程

我该如何简化这个等式,以便每个步骤都显示在不同的行上,而不是全部显示在同一行上?我尝试使用 \begin{align*} \end{align*},但一直出现错误,我不知道如何修复。这是没有任何对齐的代码

\noindent
Let $k \in \mathbb{N}$ and suppose that the equation holds for $n = k$. Then:\\ 

\[
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}^{k+1}
= \begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}^{k}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}
= 
\begin{bmatrix}
F_{k+1} & F_{k}\\
F_{k} & F_{k-1}
\end{bmatrix}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix} \text{(by the equation with $n = k$)}
= 
\begin{bmatrix}
F_{k+1} + F_k & F_{k + 1}\\
F_{k} + F_{k - 1} & F_{k}
\end{bmatrix} \text{(by matrix multiplication)}
=
\begin{bmatrix}
F_{k+2} & F_{k + 1}\\
F_{k + 1} & F_{k}
\end{bmatrix} \text{(by the recurrence $F_n = F_{n-1} + F_{n-2}$)}
\] 

这就是它现在的样子

答案1

align 确实有效。

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
Let $k \in \mathbb{N}$ and suppose that the equation holds for $n = k$. Then:
\begin{align*}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}^{k+1}
=& \begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}^{k}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}\\
= &
\begin{bmatrix}
F_{k+1} & F_{k}\\
F_{k} & F_{k-1}
\end{bmatrix}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix} &\text{(by the equation with $n = k$)}\\
= &
\begin{bmatrix}
F_{k+1} + F_k & F_{k + 1}\\
F_{k} + F_{k - 1} & F_{k}
\end{bmatrix} &\text{(by matrix multiplication)} \\
= &
\begin{bmatrix}
F_{k+2} & F_{k + 1}\\
F_{k + 1} & F_{k}
\end{bmatrix} &\text{(by the recurrence $F_n = F_{n-1} + F_{n-2}$)}
\end{align*}
\end{document}

在此处输入图片描述

由于你的垂直空间比水平空间大,你可以尝试

\documentclass[fleqn]{article}
\usepackage{amsmath,amssymb}
\begin{document}
Let $k \in \mathbb{N}$ and suppose that the equation holds for $n = k$. Then:
\begin{align*}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}^{k+1}
=& \begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}^{k}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix}\\
= &
\begin{bmatrix}
F_{k+1} & F_{k}\\
F_{k} & F_{k-1}
\end{bmatrix}
\begin{bmatrix}
1 & 1\\
1 & 0\\ 
\end{bmatrix} & &
\begin{pmatrix}
\text{by the equation}\\
\text{with $n = k$}
\end{pmatrix}\\
= &
\begin{bmatrix}
F_{k+1} + F_k & F_{k + 1}\\
F_{k} + F_{k - 1} & F_{k}
\end{bmatrix} & &
\begin{pmatrix}\text{by matrix}\\
\text{multiplication}
\end{pmatrix} \\
= &
\begin{bmatrix}
F_{k+2} & F_{k + 1}\\
F_{k + 1} & F_{k}
\end{bmatrix} & &
\begin{pmatrix}\text{by the recurrence}\\
F_n = F_{n-1} + F_{n-2}
\end{pmatrix}
\end{align*}
\end{document}

在此处输入图片描述

答案2

这是一个解决方案,它使用 (a)align*环境来对齐方程式,以及 (b)\tag指令将三个解释性“旁白”放置在文本块的右侧边缘。这反过来又减少了为了使它们适合而引入换行符的需要。

\\请注意,我还从您的代码中删除了相当多的实例。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}

\noindent
Let $k \in \mathbb{N}$ and suppose that the equation holds for $n = k$. Then:
\begin{align*}
\begin{bmatrix}
1 & 1\\
1 & 0
\end{bmatrix}^{k+1}
&= 
\begin{bmatrix}
1 & 1\\
1 & 0
\end{bmatrix}^{k}
\begin{bmatrix}
1 & 1\\
1 & 0
\end{bmatrix} \\
&= 
\begin{bmatrix}
F_{k+1} & F_{k}\\
F_{k} & F_{k-1}
\end{bmatrix}
\begin{bmatrix}
1 & 1\\
1 & 0
\end{bmatrix} 
\tag{by the equation with $n = k$} \\
&= 
\begin{bmatrix}
F_{k+1} + F_k & F_{k + 1}\\
F_{k} + F_{k - 1} & F_{k}
\end{bmatrix} 
\tag{by matrix multiplication} \\
&=
\begin{bmatrix}
F_{k+2} & F_{k + 1}\\
F_{k + 1} & F_{k}
\end{bmatrix} 
\tag{by the recurrence $F_n = F_{n-1} + F_{n-2}$}
\end{align*}

\end{document}

相关内容