LaTeX 数组和矩阵等距

LaTeX 数组和矩阵等距

我正在尝试制作一个包含块 0 的矩阵(这样我就不必写出零)。这是我所拥有的

 % Taken from https://tex.stackexchange.com/questions/323297/typing-block-matrices-with-zero-blocks-and-seperators
\newcommand{\bigzero}{\mbox{\normalfont\Large\bfseries 0}}

\begin{equation}
\begin{bmatrix}
    \begin{array}{c|c|c}
        \bigzero_{4\times 4} & \begin{matrix}
            1 & 0 & 0 & 0 \\
            0 & 0 & 0 & 1 \\
            0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 \\
        \end{matrix} & \begin{matrix}
            0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 \\
            1 & 0 & 0 & 0 \\
            0 & 0 & 0 & 1 \\
        \end{matrix} \\
        \hline
        \bigzero_{4\times 4} & \begin{matrix}
            X_u & X_w & X_q & -\cos(\theta_1) \\
            Z_u & Z_w & Z_q & \substack{-\sin(\theta_1)\\\times\cos(\phi_1)} \\
            M_u & M_w & M_q & 0 \\
            0 & 0 & \cos(\phi_1) & 0 \\
        \end{matrix} & \begin{matrix}
            X_v & X_p & X_r & 0 \\
            Z_v & Z_p & Z_r & \substack{-\cos(\theta_1)\\\times\sin(\phi_1)} \\
            M_v & M_p & M_r & 0 \\
            0 & 0 & -\sin(\phi_1) & \substack{-q_1\sin(\phi_1) \\- r_1\cos(\phi_1)} \\
        \end{matrix} \\
        \hline
        \bigzero_{4\times 4} & \begin{matrix}
            Y_u & Y_w & Y_q & \substack{-\sin(\phi_1)\\\sin(\theta_1)} \\
            L_u & L_w & L_q & 0 \\
            N_u & N_w & N_q & 0 \\
            0 & 0 & \substack{\sin(\phi_1)\\\times\tan(\theta_1)} & \substack{\substack{(q_1\sin(\phi_1) \\+ r_1\cos(\phi_1))}\\\times\sec^2(\theta_1)} \\
        \end{matrix} & \begin{matrix}
            Y_v & Y_p & Y_r & \substack{\cos(\phi_1)\\\cos(\theta_1)} \\
            L_v & L_p & L_r & 0 \\
            N_v & N_p & N_r & 0 \\
            0 & 1 & \substack{\cos(\phi_1)\\\times\tan(\theta_1)} & \substack{\substack{(q_1\cos(\phi_1)\\- r_1\sin(\phi_1))}\\\times\tan(\theta_1)} \\
        \end{matrix}
    \end{array}
  \end{bmatrix}
\end{equation}

结果如下: 输出图像

有没有办法让所有项都排成一行,而不是第一列小于后续列?到目前为止,我看到的所有答案都只处理矩阵,而不是嵌套在数组中的矩阵

答案1

啊,我最终得到了一个解决方案nicearray

\underbrace{\begin{bNiceArray}{cccc|cccc|cccc}[cell-space-limits = 4pt]
\Block{4-4}<\Large>{0_{4\times 4}} & & & & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 & & & & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
 & & & & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
 & & & & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\\hline
\Block{4-4}<\Large>{0_{4\times 4}} & & & & X_u & X_w & X_q & -\cos(\theta_1) & X_v & X_p & X_r & 0 \\
 & & & & Z_u & Z_w & Z_q & \substack{-\sin(\theta_1)\\\times\cos(\phi_1)} & Z_v & Z_p & Z_r & \substack{-\cos(\theta_1)\\\times\sin(\phi_1)} \\
 & & & & M_u & M_w & M_q & 0 & M_v & M_p & M_r & 0 \\
 & & & & 0 & 0 & \cos(\phi_1) & 0 & 0 & 0 & -\sin(\phi_1) & \substack{-q_1\sin(\phi_1) \\- r_1\cos(\phi_1)} \\\hline
\Block{4-4}<\Large>{0_{4\times 4}} & & & & Y_u & Y_w & Y_q & \substack{-\sin(\phi_1)\\\sin(\theta_1)} & Y_v & Y_p & Y_r & \substack{\cos(\phi_1)\\\cos(\theta_1)} \\
 & & & & L_u & L_w & L_q & 0 & L_v & L_p & L_r & 0 \\
 & & & & N_u & N_w & N_q & 0 & N_v & N_p & N_r & 0 \\
 & & & & 0 & 0 & \substack{\sin(\phi_1)\\\times\tan(\theta_1)} & \substack{\substack{(q_1\sin(\phi_1) \\+ r_1\cos(\phi_1))}\\\times\sec^2(\theta_1)} & 0 & 1 & \substack{\cos(\phi_1)\\\times\tan(\theta_1)} & \substack{\substack{(q_1\cos(\phi_1)\\- r_1\sin(\phi_1))}\\\times\tan(\theta_1)}
\end{bNiceArray}}_{A_c}

在此处输入图片描述

相关内容