我们如何在 LaTeX 中用矩阵形式写出以下语句?(我们希望以矩阵形式表示它)
By $\delta_{ij}(a)$ we mean a n by n matrices
in $M_n(\mathbb{R})$ which has only one nonzero
entry $a$ at $i$, th row and j th column.
答案1
如果我理解得没错,你想要的是这种东西吗?
\documentclass{article}
\usepackage{fourier}
\usepackage{amsmath}
\usepackage{blkarray, bigstrut}
\begin{document}
\begin{equation*}
\begin{blockarray}{rl@{}c@{}r}
& & \makebox[0pt]{column $j$} \\[-0.5ex]
& & \,\downarrow \\[-0.5ex]
\begin{block}{r(l@{}c@{}r)}
& \makebox[3.1em]{\Large $0$\bigstrut[t]} & \vdots &\makebox[4.2em]{\Large $0$} \\[-0.2ex]
\text{row }i \to \mkern-9mu & \raisebox{0.5ex}{\makebox[3.2em][l]{\dotfill}} & 1 & \raisebox{0.5ex}{\makebox[4.2em][r]{\dotfill}} \\[-1ex]
& \makebox[3.1em]{\Large $0$} & \vdots &\makebox[4.2em]{\bigstrut\Large $0$} \\
\end{block}
\end{blockarray}
\end{equation*}
\end{document}
答案2
附有{NiceMatrix}
包裹nicematrix
。
\documentclass{article}
\usepackage{nicematrix}
\usepackage{tikz}
\begin{document}
\NewDocumentCommand{\zero}{}{\Block{}<\Large>{0}}
$\begin{NiceMatrix}[nullify-dots,columns-width=4mm,xdots/shorten=5pt]
\CodeBefore
\SubMatrix({3-2}{5-4})
\Body
& & \clap{column $j$} \\
& & \downarrow \\[1mm]
& \zero & \Vdots & \zero \\
\text{row } i \to & \Cdots & 1 & \Cdots \\
& \zero & \Vdots & \zero
\end{NiceMatrix}$
\end{document}
您需要多次编译(因为nicematrix
在后台使用 PGF/Tikz 节点)。