我正在这样做:
\[
\begin{blockarray}{cccc}
basal & prism & \pi_1 & \dots \\
\left(
\begin{array}{cccc}
Q^b\left(\begin{array}{ccc}
h_{1}^b & h_{2}^b & \dots \\
h_{2}^b & h_{1}^b & \dots \\
h_{2}^b & h_{2}^b & \ddots \\
\end{array}\right) & Q^bh^b_p & Q^bh^b_{\pi 1} & \dots\\
Q^ph^b_p & Q^p \left(\begin{array}{ccc}
h_1^p & h_2^p & \dots\\
h_2^p & h_1^p & \dots\\
h_2^p & h_2^p & \ddots\\
\end{array}\right) & Q^ph^p_{\pi1} & \dots \\
Q^{\pi 1} h_b^{\pi 1} & Q^{\pi 1} h_p^{\pi 1} & \left( \begin{array}{ccc}
h_1^{\pi1} & h_2^{\pi1} & \dots\\
h_2^{\pi1} & h_1^{\pi1} & \dots\\
h_2^{\pi1} & h_2^{\pi1} & \ddots\\
\end{array}\right) & \dots\\
\cdots & \cdots & \cdots & \ddots \\
\end{array}\right)
\end{blockarray}
\]
我得到了这个:
但我想要的是这个:
请告诉我我做错了什么。我已经被这个问题困扰了三天了……
答案1
nicematrix
已经评论中提到。您可以玩弄这些点,使它们更具吸引力,请参阅手册。
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[
\begin{pNiceMatrix}[first-row,first-col]
& \text{basal} & \text{prism} & \pi_1 & \dots \\
\text{basal} & Q^b\begin{pmatrix}
h_{1}^b & h_{2}^b & \dots \\
h_{2}^b & h_{1}^b & \dots \\
h_{2}^b & h_{2}^b & \ddots \\
\end{pmatrix}& Q^bh^b_p & Q^bh^b_{\pi 1} & \dots\\
\text{prism} & Q^ph^b_p & Q^p \begin{pmatrix}
h_1^p & h_2^p & \dots\\
h_2^p & h_1^p & \dots\\
h_2^p & h_2^p & \ddots\\
\end{pmatrix} & Q^ph^p_{\pi1} & \dots \\
\pi_1 & Q^{\pi 1} h_b^{\pi 1} & Q^{\pi 1} h_p^{\pi 1} &
\begin{pmatrix}
h_1^{\pi1} & h_2^{\pi1} & \dots\\
h_2^{\pi1} & h_1^{\pi1} & \dots\\
h_2^{\pi1} & h_2^{\pi1} & \ddots\\
\end{pmatrix} & \dots\\
\vdots &\vdots & \vdots & \vdots & \ddots \\
\end{pNiceMatrix}
\]
\end{document}