我正在尝试添加 \downarrow 以与下面显示的第二个矩阵对齐,以便列对齐。 知道如何实现吗?
$$a_{11} =
\begin{array}{c}
\rightarrow \\
\\
\\
\end{array}
\begin{bmatrix}
& 1 & 3 \\
& 2 & 6 \\
& 5 & -4 \\
\end{bmatrix}
\cdot
\begin{array}{ccc}
\downarrow & & \\
\begin{bmatrix}
2 & 4 & -1 \\
-1 & 3 & 2 \\
\end{bmatrix}
\end{array}
= 1 \cdot 2 + 3 \cdot (-1) = 2 -3 = -1$$
答案1
快速破解:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
a_{11} =
\begin{array}{c}
\rightarrow \\
\\
\\
\end{array}
\begin{bmatrix}
& 1 & 3 \\
& 2 & 6 \\
& 5 & -4 \\
\end{bmatrix}
\cdot
\begin{array}{l}
\quad\hspace{-1pt}\downarrow\\ %%<-----
\begin{bmatrix}
2 & 4 & -1 \\
-1 & 3 & 2 \\
\end{bmatrix}
\end{array}
= 1 \cdot 2 + 3 \cdot (-1) = 2 -3 = -1
\]
\end{document}
答案2
和nicematrix
。
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[a_{11} =
\begin{bNiceMatrix}[first-col]
\rightarrow & 1 & 3 \\
& 2 & 6 \\
& 5 & -4
\end{bNiceMatrix}
\cdot
\begin{bNiceMatrix}[first-row]
\downarrow \\
2 & 4 & -1 \\
-1 & 3 & 2 \\
\end{bNiceMatrix}
=1\cdot2+3\cdot(-1)=2-3=-1\]
\end{document}
答案3
另一个解决方案是blkarray
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray, bigstrut}
\begin{document}
\[
a_{11} =
\begin{blockarray}{r@{\enspace }[rr]}
\rightarrow &\bigstrut[t] 1 & 3 \\
& 2 & 6 \\
& 5 & -4 \\
\end{blockarray}
\cdot
\begin{blockarray}{crr}
\enspace \downarrow\\ %%<-----
\begin{block}{[rrr]}
2 & 4 & -1 \\
-1 & 3 & 2 \\
\end{block}
\end{blockarray}
= 1 \cdot 2 + 3 \cdot (-1) = 2 - 3 = -1
\]
\end{document}