如何将矩阵元素对齐到特定符号?

如何将矩阵元素对齐到特定符号?

我想用 \sum 符号对齐 MWE 中描绘的矩阵 - 我觉得它在当前格式下不太“优雅”/可读性...我该如何实现?提前致谢!

    \documentclass[11pt,a4paper,twoside,openright]{book}

    \usepackage{IEEEtrantools}
    \usepackage{mathtools}

\begin{document}

    {
        \everymath{\displaystyle}
        \begin{IEEEeqnarray}{rCl}
            \label{inertia}
            I &=& \begin{vmatrix*}[l]
                I_{xx} & I_{xy} & I_{xz} \\
                I_{yx} & I_{yy} & I_{yz} \\
                I_{zx} & I_{zy} & I_{zz}
            \end{vmatrix*} \nonumber \\ &=& { \begin{vmatrix*}[l]
                    \sum_{i=1}^{n} m_{i}(y^{2}_{i}+z^{2}_{i}) & -\sum_{i=1}^{n} m_{i}x_{i}y_{i}            &-\sum_{i=1}^{n} m_{i}x_{i}z_{i} \\
                    -\sum_{i=1}^{n} m_{i}x_{i}y_{i}            &  \sum_{i=1}^{n} m_{i}(x^{2}_{i}+z^{2}_{i}) &-\sum_{i=1}^{n} m_{i}y_{i}z_{i} \\
                    -\sum_{i=1}^{n} m_{i}x_{i}z_{i}            & -\sum_{i=1}^{n} m_{i}y_{i}z_{i}            & \sum_{i=1}^{n} m_{i}(x^{2}_{i}+y^{2}_{i})
            \end{vmatrix*} } \IEEEeqnarraynumspace
        \end{IEEEeqnarray}
    }
\end{document}

答案1

您可以使用幻像:

\documentclass[11pt,a4paper,twoside,openright]{book}

\usepackage{IEEEtrantools}
\usepackage{mathtools}

\begin{document}

\begin{IEEEeqnarray}{rCl}
I &=& \begin{vmatrix*}[l]
      I_{xx} & I_{xy} & I_{xz} \\[1ex]
      I_{yx} & I_{yy} & I_{yz} \\[1ex]
      I_{zx} & I_{zy} & I_{zz}
      \end{vmatrix*} \nonumber \\
  &=& \everymath{\displaystyle}
      \begin{vmatrix*}[l]
      \hphantom{-}\sum_{i=1}^{n} m_{i}(y^{2}_{i}+z^{2}_{i}) &
      -\sum_{i=1}^{n} m_{i}x_{i}y_{i} &
      -\sum_{i=1}^{n} m_{i}x_{i}z_{i}
      \\[3ex]
      -\sum_{i=1}^{n} m_{i}x_{i}y_{i} &
      \hphantom{-}\sum_{i=1}^{n} m_{i}(x^{2}_{i}+z^{2}_{i}) &
      -\sum_{i=1}^{n} m_{i}y_{i}z_{i}
      \\[3ex]
      -\sum_{i=1}^{n} m_{i}x_{i}z_{i} &
      -\sum_{i=1}^{n} m_{i}y_{i}z_{i} &
      \hphantom{-}\sum_{i=1}^{n} m_{i}(x^{2}_{i}+y^{2}_{i})
      \end{vmatrix*}
      \IEEEeqnarraynumspace
\label{inertia}
\end{IEEEeqnarray}

\end{document}

在此处输入图片描述

相关内容