我在 pmatrix 中,在数学环境 (displaymath) 中制作了两个表格。结果不适合页面,有人知道我该如何缩放代码以使其适合吗?
\documentclass[a4paper]{amsart}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\usepackage[dutch]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\begin{document}
\begin{displaymath}
\begin{pmatrix}
\begin{tabular}{c c c c c c c c c c c}
& & &$\vdots$ & & & &$\vdots$ & & & \\
&$A$ & & 0 & & $B$& & 0& & $C$& \\
& & &$\vdots$ & & & &$\vdots$ & & & \\ \cline{4-8}
$\cdots$ &0 &$\cdots$ 0&\multicolumn{1}{|l}{0} & 0 & $\cdots$&0 & 1 &\multicolumn{1}{|l}{0}$\cdots$ & 0&$\cdots$ \\\cline{5-7}
& & & \multicolumn{1}{|l}{0} & \multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}&\multicolumn{1}{|l}{} & & \\
&$D$ & & \multicolumn{1}{|l}{ $\vdots$ } & \multicolumn{1}{|l}{} & $E$& &\multicolumn{1}{|l}{$\vdots$}& \multicolumn{1}{|l}{}& $F$& \\
& & & \multicolumn{1}{|l}{0} &\multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}& \multicolumn{1}{|l}{}& & \\ \cline{5-7}
$\cdots$ &0 &$\cdots$ 0 & \multicolumn{1}{|l}{1} & 0 & $\cdots$&0 & 0 &\multicolumn{1}{|l}{0 $\cdots$} & 0&$\cdots$ \\ \cline{4-8}
& & & $\vdots$ & & & & $\vdots$& & & \\
&$G$ & & 0 & & $H$& & 0& & $I$& \\
& & & $\vdots$ & & & & $\vdots$& & & \\
\end{tabular}
\end{pmatrix}
\Longrightarrow
\begin{pmatrix}
\begin{tabular}{c c c c c c c c c c c}
& & &$\vdots$ & & & &$\vdots$ & & & \\
&$A$ & & 0 & & $B$& & 0& & $C$& \\
& & &$\vdots$ & & & &$\vdots$ & & & \\ \cline{4-8}
$\cdots$ &0 &$\cdots$ 0&\multicolumn{1}{|l}{0} & 0 & $\cdots$&0 & 1 &\multicolumn{1}{|l}{0}$\cdots$ & 0&$\cdots$ \\\cline{5-7}
& & & \multicolumn{1}{|l}{0} & \multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}&\multicolumn{1}{|l}{} & & \\
&$D$ & & \multicolumn{1}{|l}{ $\vdots$ } & \multicolumn{1}{|l}{} & $E$& &\multicolumn{1}{|l}{$\vdots$}& \multicolumn{1}{|l}{}& $F$& \\
& & & \multicolumn{1}{|l}{0} &\multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}& \multicolumn{1}{|l}{}& & \\ \cline{5-7}
$\cdots$ &0 &$\cdots$ 0 & \multicolumn{1}{|l}{1} & 0 & $\cdots$&0 & 0 &\multicolumn{1}{|l}{0 $\cdots$} & 0&$\cdots$ \\ \cline{4-8}
& & & $\vdots$ & & & & $\vdots$& & & \\
&$G$ & & 0 & & $H$& & 0& & $I$& \\
& & & $\vdots$ & & & & $\vdots$& & & \\
\end{tabular}
\end{pmatrix}
\end{displaymath}
\end{document}
答案1
如果您不想减小字体大小,则必须减少列之间的空间以便将两个矩阵彼此相邻设置:
% arara: pdflatex
\documentclass[a4paper]{amsart}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\arraycolsep=1.55pt\def\arraystretch{1} % maximum value for this case.
\left(\begin{array}{*{13}c}
& & & & \vdots & & & & \vdots & & & & \\
& A & & & 0 & & B & & 0 & & & C & \\
& & & & \vdots & & & & \vdots & & & & \\ \cline{5-9}
\cdots & 0 & \cdots & 0 & \multicolumn{1}{|c}{0} & 0 & \cdots & 0 & 1 & \multicolumn{1}{|c}{0} & \cdots & 0 & \cdots \\ \cline{6-8}
& & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \\
& D & & & \multicolumn{1}{|c}{\vdots} & \multicolumn{1}{|c}{} & E & & \multicolumn{1}{|c}{\vdots} & \multicolumn{1}{|c}{} & & F & \\
& & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \\ \cline{6-8}
\cdots & 0 & \cdots & 0 & \multicolumn{1}{|c}{1} & 0 & \cdots & 0 & 0 & \multicolumn{1}{|c}{0} & \cdots & 0 & \cdots \\ \cline{5-9}
& & & & \vdots & & & & \vdots & & & & \\
& G & & & 0 & & H & & 0 & & & I & \\
& & & & \vdots & & & & \vdots & & & & \\
\end{array}\right)
\Longrightarrow
\left(\begin{array}{*{13}c}
& & & & \vdots & & & & \vdots & & & & \\
& A & & & 0 & & B & & 0 & & & C & \\
& & & & \vdots & & & & \vdots & & & & \\ \cline{5-9}
\cdots & 0 & \cdots & 0 & \multicolumn{1}{|c}{0} & 0 & \cdots & 0 & 1 & \multicolumn{1}{|c}{0} & \cdots & 0 & \cdots \\ \cline{6-8}
& & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \\
& D & & & \multicolumn{1}{|c}{\vdots} & \multicolumn{1}{|c}{} & E & & \multicolumn{1}{|c}{\vdots} & \multicolumn{1}{|c}{} & & F & \\
& & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \multicolumn{1}{|c}{0} & \multicolumn{1}{|c}{} & & & \\ \cline{6-8}
\cdots & 0 & \cdots & 0 & \multicolumn{1}{|c}{1} & 0 & \cdots & 0 & 0 & \multicolumn{1}{|c}{0} & \cdots & 0 & \cdots \\ \cline{5-9}
& & & & \vdots & & & & \vdots & & & & \\
& G & & & 0 & & H & & 0 & & & I & \\
& & & & \vdots & & & & \vdots & & & & \\
\end{array}\right)
\end{equation*}
\end{document}
其他可能性包括:
- 减小字体大小
- 将负字距调整到
\cdot
s - 使用较短的
\Rightarrow
- 将整个内容放在两行上(参见卡莱尔先生的回答)
答案2
通过一些工作,我们可以删除所有不必要的空间:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\svdots}{%
\vbox{\baselineskip4\p@\lineskiplimit\z@\kern2\p@\hbox{.}\hbox{.}\hbox{.}}%
}
\makeatother
\begin{document}
\[
\left(
\begin{array}{*{3}{@{}c} @{} *{7}{c} @{\,} *{3}{c@{}}}
&&&& \vdots &&&& \vdots \\
& A &&& 0 && B && 0 &&& C \\
&&&& \svdots &&&& \svdots \\
\cline{5-9}
\cdots & 0 & \cdots & \multicolumn{1}{@{}c|}{0} & 0 & 0 & \cdots& 0 &
\multicolumn{1}{c|}{1} & 0 & \cdots & 0 & \cdots \\
\cline{6-8}
&&& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{0} &&& \multicolumn{1}{c|}{} &
\multicolumn{1}{c|}{0} \\
& D && \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\svdots} && E &
\multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\svdots} &&& F \\
&&& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{0} &&& \multicolumn{1}{c|}{} &
\multicolumn{1}{c|}{0} \\
\cline{6-8}
\cdots & 0 & \cdots & \multicolumn{1}{@{}c|}{0} & 1 & 0 & \cdots& 0 &
\multicolumn{1}{c|}{0} & 0 & \cdots & 0 & \cdots \\
\cline{5-9}
&&&& \vdots &&&& \vdots \\
& G &&& 0 && H && 0 &&& I \\
&&&& \svdots &&&& \svdots \\
\end{array}
\right)
\]
\end{document}
注意\svdots
纠正一些地方的垂直点。
答案3
没有tabular
做任何有用的事情,您可以用它array
来保存将每个条目放入数学中,但是在这里您可以将其删除并使用pmatrix
。
您可以减小字体和列间距,但这样看起来会很乱,阅读起来也很拥挤,所以我会换行。
\documentclass[a4paper]{amsart}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\usepackage[dutch]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\setcounter{MaxMatrixCols}{20}
\usepackage{graphicx}
\begin{document}
\noindent X\dotfill X
\begin{multline*}
\begin{pmatrix}
& & &\vdots & & & &\vdots & & & \\
&A & & 0 & & B& & 0& & C& \\
& & &\vdots & & & &\vdots & & & \\
\cline{4-8}
\cdots &0 &\cdots 0&\multicolumn{1}{|l}{0} & 0 & \cdots&0 & 1 &\multicolumn{1}{|l}{0\cdots} & 0&\cdots \\\cline{5-7}
& & & \multicolumn{1}{|l}{0} & \multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}&\multicolumn{1}{|l}{} & & \\
&D & & \multicolumn{1}{|l}{ \vdots } & \multicolumn{1}{|l}{} & E& &\multicolumn{1}{|l}{\vdots}& \multicolumn{1}{|l}{}& F& \\
& & & \multicolumn{1}{|l}{0} &\multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}& \multicolumn{1}{|l}{}& & \\
\cline{5-7}
\cdots &0 &\cdots 0 & \multicolumn{1}{|l}{1} & 0 & \cdots&0 & 0 &\multicolumn{1}{|l}{0 \cdots} & 0&\cdots \\ \cline{4-8}
& & & \vdots & & & & \vdots& & & \\
&G & & 0 & & H& & 0& & I& \\
& & & \vdots & & & & \vdots& & &
\end{pmatrix}\\{}
\Longrightarrow
\begin{pmatrix}
& & &\vdots & & & &\vdots & & & \\
&A & & 0 & & B& & 0& & C& \\
& & &\vdots & & & &\vdots & & & \\ \cline{4-8}
\cdots &0 &\cdots 0&\multicolumn{1}{|l}{0} & 0 & \cdots&0 & 1 &\multicolumn{1}{|l}{0\cdots} & 0&\cdots \\\cline{5-7}
& & & \multicolumn{1}{|l}{0} & \multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}&\multicolumn{1}{|l}{} & & \\
&D & & \multicolumn{1}{|l}{ \vdots } & \multicolumn{1}{|l}{} & E& &\multicolumn{1}{|l}{\vdots}& \multicolumn{1}{|l}{}& F& \\
& & & \multicolumn{1}{|l}{0} &\multicolumn{1}{|l}{} & & & \multicolumn{1}{|l}{0}& \multicolumn{1}{|l}{}& & \\ \cline{5-7}
\cdots &0 &\cdots 0 & \multicolumn{1}{|l}{1} & 0 & \cdots&0 & 0 &\multicolumn{1}{|l}{0 \cdots} & 0&\cdots \\ \cline{4-8}
& & & \vdots & & & & \vdots& & & \\
&G & & 0 & & H& & 0& & I& \\
& & & \vdots & & & & \vdots& & &
\end{pmatrix}
\end{multline*}
\end{document}