我尝试使用 LaTex 将三个矩阵并排排列在一个方程中,但一直出现许多错误。我是 LaTex 的初学者,所以请不要发送类似的问题,因为我对代码感到困惑,而且我只找到了复杂的例子。
我需要得到什么 https://i.stack.imgur.com/qEXQN.jpg
我得到了什么 https://i.stack.imgur.com/d1TPG.jpg
代码:
\[ A =
\begin{bmatrix}
1 & 0 \\
0 & \sqrt{2} \\
0 & \sqrt{2} \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & \sqrt{2} & \sqrt{2} \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 \\
0 & \sqrt{2} \\
0 & \sqrt{2} \\
\end{bmatrix}
A^{T}A =
\begin{bmatrix}
1 & 0 \\
0 & 4 \\
\end{bmatrix}
\]
答案1
数学模式中不能有空行:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[ A =
\begin{bmatrix}
1 & 0 \\
0 & \sqrt{2} \\
0 & \sqrt{2} \\
\end{bmatrix}
%
\begin{bmatrix}
1 & 0 & 0 \\
0 & \sqrt{2} & \sqrt{2} \\
\end{bmatrix}
%
\begin{bmatrix}
1 & 0 \\
0 & \sqrt{2} \\
0 & \sqrt{2} \\
\end{bmatrix}
%
A^{T}A =
%
\begin{bmatrix}
1 & 0 \\
0 & 4 \\
\end{bmatrix}
\]
\end{document}
答案2
\documentclass{article}
\begin{document}
\begin{tabular}{cccc}
$ A =
\left[ \begin{tabular}{rr}
1 & 0 \\
0 & $\sqrt{2}$ \\
0 & $\sqrt{2}$ \\
\end{tabular}
\right]$
&
$\left[ \begin{tabular}{rrr}
1 & 0 & 0 \\
0 & $\sqrt{2}$ & $\sqrt{2}$ \\
\end{tabular}\right]$
&
$\left[ \begin{tabular}{rrr}
1 & 0 \\
0 & $\sqrt{2}$ \\
0 & $\sqrt{2}$ \\
\end{tabular} \right]$
&
$A^{T} A =$
$\left[\begin{tabular}{rr}
1 & 0 \\
0 & 4 \\
\end{tabular}
\right]$
\end{tabular}
%This is done using a simple tabular environment.