我在 Overleaf 上执行了以下代码片段,
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools,siunitx}
\usepackage{amsmath}
\title{test}
\author{spanos.nikolaos }
\date{July 2020}
\begin{document}
\maketitle
\[
\begin{bmatrix}
[1, & 2, & 3]\\
[4, & 5, & 6]\\
[7, & 8, & 9]\\
[10, & 11, & 12]\\
\end{bmatrix}\\
\operatorname{shape}(4\times3)
$$\,\to\,$$ %display them in the same row (matrix -> 3 arrays)
[5.5, 6.5, 7.5],%shape(3,) and caption{A},
[1, 2, 3], %shape(3,) and caption{B}
[10, 11, 12] %shape(3,) and caption{C}
\]
\end{document}
按照我的意见,我想将箭头右侧的所有内容与箭头左侧放在同一行,并附上形状特征和标题,如数组 A、B、C,位于其相对数组下方。
答案1
我不确定我是否理解了所要求的布局,但也许像
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools,siunitx}
\usepackage{amsmath}
\title{test}
\author{spanos.nikolaos }
\date{July 2020}
\begin{document}
\maketitle
\[
\begin{array}{ccccc}
\begin{bmatrix}
[1, & 2, & 3]\\
[4, & 5, & 6]\\
[7, & 8, & 9]\\
[10, & 11, & 12]\\
\end{bmatrix}
&\to
&[5.5, 6.5, 7.5],
&[1, 2, 3],
&[10, 11, 12]
\\
\operatorname{shape}(4\times3)
&&
\operatorname{shape}(3,)
&
\operatorname{shape}(3,)
&
\operatorname{shape}(3,)
\\
\text{A}&
&\text{B}&\text{C}&\text{D}
\end{array}
\]
\end{document}