对齐矩阵内的元素

对齐矩阵内的元素

我怎样才能改善这个矩阵方程内的对齐?

在此处输入图片描述

我的 Tex 代码是

\begin{equation}
\begin{bmatrix}
d\varepsilon_v\\
d\varepsilon_q
\end{bmatrix}
= 
\left[
\begin{matrix}
\dfrac{1}{K^{'}} & 0 \\ 
0 & \dfrac{1}{3 G^{'}} 
\end{matrix}
+\ 
\dfrac{
\begin{matrix}
\dfrac{\partial g}{\partial p^{'}} \dfrac{\partial f}{\partial q} & 
\dfrac{\partial g}{\partial p^{'}} \dfrac{\partial f}{\partial q} \\
\dfrac{\partial g}{\partial q} \dfrac{\partial f}{\partial p^{'}} & 
\dfrac{\partial g}{\partial q} \dfrac{\partial f}{\partial q}
\end{matrix}}{P}
\right]
\begin{bmatrix}
dp^{'}\\
dq
\end{bmatrix}
\label{eq:149}
\end{equation}

答案1

像这样吗?

在此处输入图片描述

请注意,我还将所有的 替换^{'}'。 (附言:在数学模式下,'解析为^{\prime}。)

\documentclass{article} % or some other suitable document class
\usepackage{amsmath}    % for 'bmatrix' and 'pmatrix' env. and '\dfrac' macro
\usepackage{booktabs}   % for '\addlinespace' macro
\newcommand\mystrut{\vphantom{\partial p'}} % typographic strut
     % to fine-tune position of cells in first inner 2x2 matrix

\begin{document}

\begin{equation} \label{eq:149}
\begin{bmatrix}
  d\varepsilon_v \\
  \addlinespace
  d\varepsilon_q
\end{bmatrix}
=
\left( % delimiter for sum of 2x2 matrices
  \begin{bmatrix} % first "inner" 2x2 matrix
    \dfrac{1}{K'\mystrut} & 0 \\
    \addlinespace
    0 & \dfrac{1}{3G'\mystrut}
  \end{bmatrix}
  +
  \dfrac{1}{P} % multiply matrix with a scalar
  \begin{bmatrix} % second "inner" 2x2 matrix
    \dfrac{\partial g}{\partial p'} \dfrac{\partial f}{\partial q} &
    \dfrac{\partial g}{\partial p'} \dfrac{\partial f}{\partial q} \\
    \addlinespace
    \dfrac{\partial g}{\partial q}  \dfrac{\partial f}{\partial p'} &
    \dfrac{\partial g}{\partial q}  \dfrac{\partial f}{\partial q}
  \end{bmatrix}
\right)
\begin{bmatrix}
  dp'\\
  \addlinespace
  dq
\end{bmatrix}
\end{equation}

\end{document}

相关内容