我正在尝试排版一个涉及多行矩阵的方程,并使用“注释”来标识某些条目出现的行/列。我的相当混乱的努力(希望至少表明我的目标)如下所示,但鉴于:
- 每行之间的间距太大;
- 整个代码是真的凌乱的,
我确信一定有一种更好、更简洁的方法来使用我不知道的技术来做到这一点。
有没有人能给出一些建议,比如(最重要的是)如何减少不同行之间的间距,以及(更普遍地说)如何改善整体呈现效果?任何帮助,一如既往,不胜感激。
\documentclass[10pt,a4paper,twoside]{article}
\usepackage{color,amsmath}
\definecolor{gray}{gray}{.5}
\begin{document}
\begin{align*}
E_{ik}(b_{ij}a_{kl}^{-1})AE_{lj} & =
\begin{array}{l} \color{gray} \phantom{\vdots} \\ \color{gray}
\phantom{\vdots} \\ \scriptstyle \color{gray} i \phantom{\vdots} \\
\phantom{\vdots} \\ \phantom{\vdots} \\ \scriptstyle \color{gray} \end{array}
\! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \!
\bordermatrix{
& & {\scriptstyle \color{gray} k} & \cr
& 0 & \color{gray} \scriptstyle \vdots & 0 \cr
\phantom{XX} & \color{gray} \scriptstyle \cdots & b_{ij}a_{kl}^{-1} &
\phantom{XX} \cr
& & & \cr
& 0 & & 0 }
\left( \begin{array}{ccc} a_{11} & \cdots & a_{1n} \\ \vdots & & \vdots \\
a_{n1} & \cdots & a_{nn} \end{array} \right)
\! \! \! \! \! \! \! \! \! \! \! \! \! \! \bordermatrix{
& & {\scriptstyle \color{gray} l} & \cr
& 0 & \color{gray} \scriptstyle \vdots & 0 \cr
& & \color{gray} \scriptstyle \vdots & \cr
\phantom{XX} & \phantom{XX} & 1 & \color{gray} \scriptstyle \cdots \cr
& 0 & & 0 } \!
\begin{array}{l} \color{gray} \phantom{\scriptstyle \vdots} \\ \color{gray}
\phantom{\scriptstyle \vdots} \\ \phantom{\scriptstyle \vdots} \\ \scriptstyle
\color{gray} j \phantom{\vdots} \\ \phantom{\vdots} \\ \scriptstyle
\color{gray} \end{array} \\
& =
\begin{array}{l} \color{gray} \phantom{\vdots} \\ \color{gray}
\phantom{\vdots} \\ \scriptstyle \color{gray} i \phantom{\vdots} \\
\phantom{\vdots} \\ \phantom{\vdots} \\ \scriptstyle \color{gray} \end{array}
\! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \!
\bordermatrix{
& & {\scriptstyle \color{gray} k} & \cr
& 0 & \color{gray} \scriptstyle \vdots & 0 \cr
\phantom{XX} & \color{gray} \scriptstyle \cdots & b_{ij}a_{kl}^{-1} &
\phantom{XX} \cr
& & & \cr
& 0 & & 0 }
\! \! \! \! \! \! \! \! \! \! \! \! \! \! \bordermatrix{
& & {\scriptstyle \color{gray} j} & \cr
& & a_{1l} & \cr
& 0 & \vdots & 0 \cr
\phantom{XX} & \phantom{XX} & a_{nl} & \cr} \\
& =
\begin{array}{l} \color{gray} \phantom{\vdots} \\ \color{gray}
\phantom{\vdots} \\ \scriptstyle \color{gray} i \phantom{\vdots} \\
\phantom{\vdots} \\ \phantom{\vdots} \\ \scriptstyle \color{gray} \end{array}
\! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \!
\bordermatrix{
& & {\scriptstyle \color{gray} j} & \cr
& 0 & \color{gray} \scriptstyle \vdots & 0 \cr
\phantom{XX} & \color{gray} \scriptstyle \cdots & b_{ij} & \phantom{XX} \cr
& & & \cr
& 0 & & 0 } \\
& = E_{ij}(b_{ij})
\end{align*}
\end{document}
答案1
也许是这样,我只做第一行
\documentclass[10pt,a4paper,twoside]{article}
\usepackage{color,mathtools}
\definecolor{gray}{gray}{.5}
\newcommand\Ldots[1]{\phantom\vdots\mathclap{\color{gray}#1\quad\cdots\quad}}
\newcommand\Rdots[1]{\mathrlap{\color{gray}\!\cdots\quad#1}\phantom\vdots}
\newcommand\Vdots[1]{\mathclap{\color{gray}\smash{%
\begin{array}[b]{@{}c@{}}#1\\[-3pt]\vdots\end{array}}}}
\begin{document}
\begin{align*}
E_{ik}(b_{ij}a_{kl}^{-1})AE_{1j} & =
\quad\begin{pmatrix}
0 & \Vdots{j} & 0 \\
\Ldots{i} & b_{ij}a_{kl}^{-1} & \\
0 & & 0
\end{pmatrix}
\begin{pmatrix}
a_{11}& \cdots& a_{1n} \\
\vdots&&\vdots\\
a_{n1} & \cdots & a_{nn}
\end{pmatrix}
\begin{pmatrix}
a_{11}& \Vdots{l}& a_{1n} \\
&1&\Rdots{j}\\
a_{n1} & & a_{nn}
\end{pmatrix}
\\
\end{align*}
\end{document}
答案2
\documentclass[10pt,a4paper,twoside]{article}
\usepackage{color,mathtools}
\definecolor{gray}{gray}{.5}
\newcommand\Ldots[1]{\phantom\vdots\mathclap{\color{gray}{\scriptstyle
#1}\quad\cdots\quad}}
\newcommand\Rdots[1]
{\mathrlap{\color{gray}\!\cdots\quad\scriptstyle#1}\phantom\vdots}
\newcommand\Vdots[1]{\mathclap{\color{gray}\smash{%
\begin{array}[b]{@{}c@{}}\scriptstyle#1\\[-3pt]\vdots\end{array}}}}
\newcommand\Vtag[2]{\mathclap{\color{gray}\smash{%
\begin{array}[b]{@{}c@{}}\scriptstyle#1\\
[-3pt]\color{black}\vphantom{\vdots}#2\end{array}}}}
\begin{document}
\begin{align*}
E_{ik}(b_{ij}a_{kl}^{-1})AE_{lj} & =
\quad
\begin{pmatrix}
0 & \Vdots{j} & 0 \\
\Ldots{i} & b_{ij}a_{kl}^{-1} & \\
0 & & 0
\end{pmatrix}
\begin{pmatrix}
a_{11}& \cdots& a_{1n} \\
\vdots&&\vdots\\
a_{n1} & \cdots & a_{nn}
\end{pmatrix}
\begin{pmatrix}
a_{11}& \Vdots{l}& a_{1n} \\
&1&\Rdots{j}\\
a_{n1} & & a_{nn}
\end{pmatrix} \\[15pt]
& =
\quad
\begin{pmatrix}
0 & \Vdots{j} & 0 \\
\Ldots{i} & b_{ij}a_{kl}^{-1} & \\
0 & & 0
\end{pmatrix}
\begin{pmatrix}
& \Vtag{l}{a_{1l}} & \\
0 & \vdots & 0 \\
& a_{nl} &
\end{pmatrix} \\[15pt]
& =
\quad
\begin{pmatrix}
0 & \Vdots{j} & 0 \\
\Ldots{i} & b_{ij} & \\
0 & & 0
\end{pmatrix} \\
& = E_{ij}(b_{ij})
\end{align*}
\end{document}