我想写一个大矩阵,我想像图中一样用两行来写,但我找不到方法!
答案1
\documentclass{article}
\usepackage{mathtools}
\def\mtrm#1{\rule{#1}{1.5ex}}
\begin{document}
\begin{multline}
\bar{L}_2 = \left(
\begin{matrix}
\mtrm{15ex} & \mtrm{15ex}\\
\mtrm{7ex} & \mtrm{7ex} \\
\mtrm{4ex} & \mtrm{4ex} \\
\mtrm{18ex} & \mtrm{18ex}\\
\end{matrix}\right.
\\
\left.
\begin{matrix}
\mtrm{16ex} & \mtrm{6ex} \\
0 & 0 \\
\mtrm{4ex} & \mtrm{14ex}\\
\mtrm{19ex} & \mtrm{19ex}
\end{matrix}\right)
\end{multline}
\end{document}
答案2
也可以使用\substack
:
笔记:
- 这里使用的矩阵来自我想在两行上写一个矩阵元素是可能的。
- 修正了的使用
\sin
,\cos
并定义了字体选择的宏。
代码:
\documentclass{article}
\newcommand{\MyFont}[1]{\textrm{\fontfamily{lmr}\fontshape{ui}\selectfont #1}}
\usepackage{mathtools}
\begin{document}
$\tilde{A}_{Long}=\begin{pmatrix}
X_{\MyFont{u}}&X_{\MyFont{w}}&X_q-M_{33}\MyFont{w}_0&-(mg-B_u)\cos(\theta_0)\\[1.0ex]
Z_{\MyFont{u}}&Z_{\MyFont{w}}&Z_q-M_{11}\MyFont{u}_0&-(mg-B_u)\sin(\theta_0)\\[1.0ex]
M_{\MyFont{u}}&M_{\MyFont{w}}
&\substack{M_{q}-M_{11}.x_G\MyFont{u}_0 \\ -M_{33}.z_G\MyFont{w}_0}
&\substack{\hphantom{-}(x_Gmg+x_BB_u)\sin(\theta_{0})\\ -(z_Gmg+z_BB_u) \cos(\theta_{0})}
\\[1.0ex]
0&0&1&0\\
\end{pmatrix}$
\end{document}
答案3
\documentclass{standalone}
\begin{document}
\begin{tabular}{ccc}
$L=$ & $\left( \begin{tabular}{c}A\\B\\C\\D\\\end{tabular} \right.$ & $\begin{tabular}{c}E\\F\\G\\H\\\end{tabular}$ \\
& $\begin{tabular}{c}I\\J\\K\\L\\\end{tabular}$ & $\left. \begin{tabular}{c}M\\N\\O\\P\\\end{tabular} \right)$\\
\end{tabular}
\end{document}
答案4
{NiceMatrix}
的一个解决方案nicematrix
。
\documentclass{article}
\usepackage{nicematrix}
\def\mtrm#1{\protect\rule{#1}{1.5ex}}
\begin{document}
\begin{equation*}
\bar{L}_2 =
\begin{NiceMatrix}[baseline = line-3,margin]
\mtrm{10ex} & \mtrm{10ex} \\
\mtrm{7ex} & \mtrm{7ex} \\
\mtrm{4ex} & \mtrm{4ex} \\
\mtrm{8ex} & \mtrm{8ex} \\
& \mtrm{6ex} & \mtrm{6ex} \\
& 0 & 0 \\
& \mtrm{4ex} & \mtrm{4ex} \\
& \mtrm{9ex} & \mtrm{9ex} \\
\CodeAfter
\SubMatrix{(}{1-1}{4-2}{.}
\SubMatrix{.}{5-2}{8-3}{)}
\end{NiceMatrix}
\end{equation*}
\end{document}