有人能帮我把等式 M 弄成不受下括号影响吗?我希望 M、等号和它等于的东西都对齐,而不是 M= 与中心对齐,如果这有意义的话。一个对当前代码影响最小的解决方案会很棒!谢谢 :D
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{align*}
M=& \setlength{\arraycolsep}{2pt}
\begin{array}{ccc}
\underbrace{\begin{array}{ccccccc}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{array}}_\text{text}
& \underbrace{\begin{array}{ccccccc}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{array}}_\text{text}
& \underbrace{\begin{array}{ccccccc}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{array}}_\text{text} \\
\end{array} \\[5pt]
=& \setlength{\arraycolsep}{2pt}
\begin{array}{ccccccccccccc}
(1 & 1)(1 & 1). \\
\end{array}
\end{align*}
\end{document}
答案1
让我阐明一下我的评论:......
编辑: 删除括号中术语之间的空格:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\setlength{\arraycolsep}{2pt}
\begin{aligned}
M = & \underbrace{\begin{array}{ccccccc}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{array}}_\text{text}\,
\underbrace{\begin{array}{ccccccc}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{array}}_\text{text}\,
\underbrace{\begin{array}{ccccccc}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{array}}_\text{text} \\
= & \begin{array}{ccccccccccccc}
(1 & 1)(1 & 1). \\
\end{array}
\end{aligned}
\]
\end{document}
或使用matrix
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\setlength{\arraycolsep}{2pt}
\begin{aligned}
M = & \underbrace{\begin{matrix}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{matrix}}_\text{text}\,
\underbrace{\begin{matrix}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{matrix}}_\text{text}\,
\underbrace{\begin{matrix}(1 & 1 & 1 & 1)(1 & 1 & 1 & 1) \end{matrix}}_\text{text} \\
= & \begin{array}{ccccccccccccc}
(1 & 1)(1 & 1). \\
\end{array}
\end{aligned}
\]
\end{document}
结果和以前一样)
答案2
我认为没有理由用 来包装array
。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\newcommand{\rowvec}[2][2pt]{%
\begingroup\setlength{\arraycolsep}{#1}%
\begin{pmatrix}#2\end{pmatrix}%
\endgroup
}
\begin{document}
\begin{align*}
M &=
{\underbrace{
\rowvec{1 & 1 & 1 & 1}\rowvec{1 & 1 & 1 & 1}
}_\text{text}}
\,
{\underbrace{
\rowvec{1 & 1 & 1 & 1}\rowvec{1 & 1 & 1 & 1 }
}_\text{text}}
\,
{\underbrace{
\rowvec{1 & 1 & 1 & 1}\rowvec{1 & 1 & 1 & 1 }
}_\text{text}}
\\
&=
\rowvec{1 & 1}\rowvec{1 & 1}.
\end{align*}
\end{document}
答案3
pmatrix
很容易使用:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\newcommand{\pmatn}[1]{\setlength\arraycolsep{2pt}\begin{pmatrix}#1\end{pmatrix}}
\begin{align*}
M &= \underbrace{\pmatn{1 & 1 & 1 & 1}\pmatn{1 & 1 & 1 & 1}}_\text{text} \,
\underbrace{\pmatn{1 & 1 & 1 & 1}\pmatn{1 & 1 & 1 & 1}}_\text{text} \,
\underbrace{\pmatn{1 & 1 & 1 & 1}\pmatn{1 & 1 & 1 & 1}}_\text{text} \\
&= \pmatn{1 & 1}\pmatn{1 & 1}
\end{align*}
\end{document}