我想向给定矩阵添加符号和标签。为了具体说明我所寻找的内容,我将在下面提供一些图形示例。
基本上,我只想以正确对齐的方式将数据附加到矩阵。例如,我们可以添加一些指示矩阵维度的键
或者我们可以在列中添加一些标签
无论如何,我想知道如何将某些数据与给定矩阵内的数据对齐。
如果您愿意提供帮助,我将向您提供这两个矩阵的代码。
\text{det}\begin{pmatrix} a_0 & a_1 & \dots & a_{n-1} & a_n & 0 & \dots & 0\\ 0 & a_0 & \dots & a_{n-2} & a_{n-1} & a_n & \dots & 0 \\ & & \ddots & & & & \ddots & \\ 0 & 0 & \dots & a_0 & a_1 & a_2 & \dots & a_n \\ b_0 & b_1 & \dots & b_{m-1} & b_m & 0 & \dots & 0 \\ 0 & b_0 & \dots & b_{m-2} & b_{m-1} & b_m & \dots & 0\\ & & \ddots & & & & \ddots & & \\ 0 & 0 & \dots & b_0 & b_1 & b_2 & \dots & b_m \end{pmatrix}
\text{det}\begin{pmatrix} -a & 0 & \dots & 0 & 0 & 1 & \dots & 0\\ 0 & -a & \dots & 0 & 0 & 0 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & -a & 0 & 0 & \dots & 1 \\ 0 & 0 & \dots & 0 & n & 0 & \dots & 0 \\ 0 & 0 & \dots & 0 & 0 & n & \dots & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & 0 & 0 & 0 & \dots & n \end{pmatrix}=(-a)^{n-1}n^n
提前感谢您的关注。
答案1
它nicematrix
相当容易,您可以使用相同的工具来处理这两个矩阵。
\documentclass[fleqn]{article}
\usepackage{nicematrix}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}
\[\det\begin{pNiceArray}{CCCCCCCC}%
[create-medium-nodes,
code-after = {\begin{tikzpicture}[name suffix = -medium]
\draw[thick,decorate,
decoration={calligraphic brace,amplitude=3pt,raise=1em}]
(1-8.north east) -- (4-8.south east) node[midway,right=1.2em]{$m$ files};
\draw[thick,decorate,
decoration={calligraphic brace,amplitude=3pt,raise=1em}]
(5-8.north east) -- (8-8.south east) node[midway,right=1.2em]{$n$ files};
\end{tikzpicture}}]
a_0 & a_1 & \Cdots & a_{n-1} & a_n & 0 & \Cdots & 0\\
0 &a_0 & \Cdots & a_{n-2} & a_{n-1} & a_n & \Cdots & 0 \\
& & \Ddots & & & & \Ddots & \\
0 & 0 & \Cdots & a_0 & a_1 & a_2 & \Cdots & a_n \\
b_0 & b_1 & \Cdots &b_{m-1} & b_m & 0 & \Cdots & 0 \\
0 & b_0 & \Cdots & b_{m-2} & b_{m-1} & b_m & \Cdots & 0\\
& & \Ddots & & & & \Ddots & \\
0 & 0 & \Cdots & b_0 & b_1 & b_2 & \Cdots & b_m \\
\end{pNiceArray}\]
\bigskip
\[\det\begin{pNiceArray}{CCCCCCCC}%
[create-medium-nodes,first-row,
code-after = {\begin{tikzpicture}[name suffix = -medium]
\foreach \X in {4,5,6} {\draw[rounded corners] ([xshift=-1pt]0-\X.north west)
|- ([yshift=-1pt]0-\X.south east);}
\end{tikzpicture}}]
& & & n-1 & k & n+1 & &\\
-a & 0 & \Cdots & 0 & 0 & 1 & \Cdots & 0\\
0 & -a & \Cdots & 0 & 0 & 0 & \Cdots & 0 \\
\Vdots & \Vdots & \Ddots & \Vdots & \Vdots & \Vdots & \Ddots & \Vdots \\
0 & 0 & \Cdots & -a & 0 & 0 & \Cdots & 1 \\
0 & 0 & \Cdots & 0 & n & 0 & \Cdots & 0 \\
0 & 0 & \Cdots & 0 & 0 & n & \Cdots & 0\\
\Vdots & \Vdots & \Ddots & \Vdots & \Vdots & \Vdots & \Ddots & \Vdots \\
0 & 0 & \Cdots & 0 & 0 & 0 & \Cdots & n \end{pNiceArray}=(-a)^{n-1}n^n
\]
\end{document}