I have used this answer https://tex.stackexchange.com/a/61290/46626 to adjust my matrices and it works fine with the standard font (Latin Modern Math)
But when I use Cambria Math, the inner matrices seem to be too tall:
I am not able to fix that, does anybody have an idea? Is it possible to use it as an standard matrix style? I am using TeX Live 2016 and LuaLaTeX. Other solution for a proper setting of this matrices are also welcome. Thanks!
MWE:
\documentclass{article}
\usepackage{fontspec}
\usepackage{mathtools} % includes: \usepackage{amsmath} (-> needed e.g. for bmatrix) !! load BEFORE \usepackage{unicode-math}
\usepackage{unicode-math} %Unicode mathematics support for X∃TEX and LuaTEX
%% Set font
%\setromanfont{Cambria}
%\setsansfont{Calibri}
%\setmonofont{Consolas}
%\setmathfont{Cambria Math}
\makeatletter
\newif\ifcenter@asb@\center@asb@false
\def\center@arstrutbox{%
\setbox\@arstrutbox\hbox{$\vcenter{\box\@arstrutbox}$}%
}
\newcommand*{\CenteredArraystretch}[1]{%
\ifcenter@asb@\else
\pretocmd{\@mkpream}{\center@arstrutbox}{}{}%
\center@asb@true
\fi
\renewcommand{\arraystretch}{#1}%
}
\makeatother
\begin{document}
\begin{equation}
\CenteredArraystretch{1.2}
\delimitershortfall=-2pt %\renewcommand*{\arraystretch}{1.2} %Default is 1.0
\begin{split}
\begin{bmatrix}
\begin{bmatrix}
m & 0\\
0 & m
\end{bmatrix}&
-m\, \mathbfit{A}^{RL}
\begin{bmatrix}
\phantom{-}y^L_{P_{\mathrm{COG}}O_L}\\
-x^L_{P_{\mathrm{COG}}O_L}
\end{bmatrix}\\
-m
\begin{bmatrix}
y^L_{P_{\mathrm{COG}}O_L} & -x^L_{P_{\mathrm{COG}}O_L}
\end{bmatrix}
\mathbfit{A}^{LR}&
J^L + m\left(\left(x^L_{P_{\mathrm{COG}}O_L}\right)^2 +
\left(y^L_{P_{\mathrm{COG}}O_L}\right)^2
\right)
\end{bmatrix}
\begin{bmatrix}
\begin{bmatrix}
\ddot{x}^R_{O_LO_R}\\
\ddot{y}^R_{O_LO_R}
\end{bmatrix}\\%[2ex]
\ddot{\psi}
\end{bmatrix} = \\
\begin{bmatrix}
\sum
\begin{bmatrix}
F^R_{ix}\\
F^R_{iy}
\end{bmatrix}\\
\sum M^L_{iz}+\sum
\begin{bmatrix}
-y^L_{PiP} &
x^L_{PiP}
\end{bmatrix}
\begin{bmatrix}
F^L_{ix}\\
F^L_{iy}
\end{bmatrix}
\end{bmatrix}
+
\begin{bmatrix}
m\,\mathbfit{A}^{RL}
\begin{bmatrix}
x^L_{P_{\mathrm{COG}}O_L}\\
y^L_{P_{\mathrm{COG}}O_L}
\end{bmatrix}
\dot{\psi}^2\\%[2ex]
0
\end{bmatrix}
\end{split}
\end{equation}
\end{document}
Update: Using Mico's answer, I (almost) found the desired result. But it needs a lot of manual adjustment and I wonder if there is a simpler solution?
\documentclass{article}
\usepackage{fontspec}
\usepackage{mathtools} % includes: \usepackage{amsmath} (-> needed e.g. for bmatrix) !! load BEFORE \usepackage{unicode-math}
\usepackage{unicode-math} %Unicode mathematics support for X∃TEX and LuaTEX
% Set font
\setmainfont{Cambria}
\setmathfont{Cambria Math}
\setsansfont{Calibri}
\setmonofont{Consolas}
\begin{document}
\begin{multline}
\delimitershortfall=-2pt \renewcommand{\arraystretch}{1.33}
\begin{bmatrix}
\delimitershortfall=5pt
\begin{bmatrix}
m & 0\\
0 & m
\end{bmatrix} &
-m\, \mathbfit{A}^{RL}
\delimitershortfall=5pt
\begin{bmatrix}
\phantom{-}y^L_{P_{\mathrm{COG}}O_L} \\
-x^L_{P_{\mathrm{COG}}O_L}
\end{bmatrix} \\[3ex]
-m \begin{bmatrix}
y^L_{P_{\mathrm{COG}}O_L} &
-x^L_{P_{\mathrm{COG}}O_L}
\end{bmatrix}
\mathbfit{A}^{LR} &
J^L + m\bigl(
(x^L_{P_{\mathrm{COG}}O_L})^2 +
(y^L_{P_{\mathrm{COG}}O_L})^2
\bigr)
\end{bmatrix}\,
\begin{bmatrix}
\delimitershortfall=5pt
\begin{bmatrix}
\ddot{x}^R_{O_LO_R}\\
\ddot{y}^R_{O_LO_R}
\end{bmatrix} \\[3.25ex]
\ddot{\psi}
\end{bmatrix} \\[2ex] % end of first row
\delimitershortfall=-2pt
=\begin{bmatrix}
\sum\limits_{i} \begin{bmatrix}
F^R_{ix} \\[0.5ex]
F^R_{iy}
\end{bmatrix}\\
\sum\limits_{i} M^L_{iz}+
\sum\limits_{i} \begin{bmatrix}
-y^L_{PiP} & x^L_{PiP}
\end{bmatrix}
\begin{bmatrix}
F^L_{ix} \\[0.5ex] F^L_{iy}
\end{bmatrix}
\end{bmatrix}
+
\begin{bmatrix}
m\,\mathbfit{A}^{RL}
\begin{bmatrix}
x^L_{P_{\mathrm{COG}}O_L} \\[0.5ex]
y^L_{P_{\mathrm{COG}}O_L}
\end{bmatrix}
\dot{\psi}^2 \\[4.5ex]
0
\end{bmatrix}
\end{multline}
\end{document}
\sum
correct? Should it maybe be\Sigma
? Please advise.\setromanfont
is deprecated; use\setmainfont
instead.