用两行写矩阵

用两行写矩阵

我想写一个大矩阵,我想像图中一样用两行来写,但我找不到方法!在此处输入图片描述

答案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

在此处输入图片描述

笔记:

代码:

\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}

上述代码的输出

相关内容