我一直在努力将一个大矩阵放在一页上,最后终于设法把它放进去了,尽管我不得不把条目做得很小。现在我想标记矩阵的行和列。关于如何做到这一点,已经有一个很好的答案:用字符标记矩阵的行。
但是,我使用的环境与该主题答案中使用的环境不同。由于我花了很长时间才将大型矩阵放在页面上,所以我不想从头开始。是否有一些代码可以让我在边缘添加标签,而只需对已有的内容进行微小改动?
现在看起来是这样的:
这是我目前拥有的代码:
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath} % for equation* and bmatrix environment
\usepackage{anyfontsize}
\setcounter{MaxMatrixCols}{20} % for the large matrices
\begin{document}
{\fontsize{4.9}{5.8}\selectfont % Fontsize may only come in 4pt and 5pt because there is a huge leap from 4.9 to 5
\noindent\hspace{-1.7in}\begin{minipage}{\dimexpr \textwidth+3.4in}
\begin{equation*}\setlength\arraycolsep{3pt}
\begin{pmatrix}
Lk(l_{1,1},l_{1,1}^{\#}) & Lk(l_{1,1},l_{1,2}^{\#}) & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & Lk(l_{1,1},l_{\frac{n}{2}-1,\frac{m}{2}-1}^{\#}) \\
Lk(l_{1,2},l_{1,1}^{\#}) & Lk(l_{1,2},l_{1,2}^{\#}) & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots &\vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & Lk(l_{1,\frac{m}{2}-1},l_{1,\frac{m}{2}-1}^{\#}) & Lk(l_{1,\frac{m}{2}-1},l_{2,1}^{\#}) & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & Lk(l_{2,1},l_{1,\frac{m}{2}-1}^{\#}) & Lk(l_{2,1},l_{2,1}^{\#}) & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & Lk(l_{2,\frac{m}{2}-1},l_{2,\frac{m}{2}-1}^{\#}) & Lk(l_{2,\frac{m}{2}-1},l_{2,2}^{\#}) & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & Lk(l_{2,2},l_{2,\frac{m}{2}-1}^{\#}) & Lk(l_{2,2},l_{2,2}^{\#}) & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & Lk(l_{\frac{n}{2}-2,\frac{m}{2}-2},l_{\frac{n}{2}-2,\frac{m}{2}-2}^{\#}) & Lk(l_{\frac{n}{2}-1,\frac{m}{2}-1},l_{\frac{n}{2}-1,\frac{m}{2}-2}^{\#}) \\
Lk(l_{\frac{n}{2}-1,\frac{m}{2}-1},l_{1,1}^{\#}) & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & Lk(l_{\frac{n}{2}-1,\frac{m}{2}-2},l_{\frac{n}{2}-1,\frac{m}{2}-1}^{\#}) & Lk(l_{\frac{n}{2}-1,\frac{m}{2}-1},l_{\frac{n}{2}-1,\frac{m}{2}-1}^{\#}) \\
\\
\end{pmatrix}
\end{equation*}
\end{minipage}\hspace{-1.7in}
}
\end{document}
对于您必须进行的所有水平滚动,我提前表示歉意:我不确定如何防止这种情况发生。
答案1
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath} % for equation* and bmatrix environment
\usepackage{anyfontsize}
\setcounter{MaxMatrixCols}{20} % for the large matrices
\begin{document}
I'm trying to figure out the pattern here.
You might consider a submatrix representation of the form
\begin{equation*}
\left( \begin{array}{c|c|c|c}
A(1,1) & A(1,2) & \cdots & A(1,m) \\
\hline
A(2,1) & A(2,2) & \cdots & A(2,m) \\
\hline
\vdots & \vdots & \ddots & \vdots \\
\hline
A(n,1) & A(n,2) & \cdots & A(n,m)
\end{array} \right)
\end{equation*}
where each $\frac{m}{2}-1\times \frac{m}{2}-1$ submatrix is given by
\begin{equation*}
\def\arraystretchfactor{1.2}
A(i,j) = \begin{pmatrix}
Lk(l_{i,1},l_{j,1}^{\#}) & Lk(l_{i,1},l_{j,2}^{\#}) & \cdots & Lk(l_{i,1},l_{j,\frac{m}{2}-1}^{\#}) \\
Lk(l_{i,2},l_{j,1}^{\#}) & Lk(l_{i,2},l_{j,2}^{\#}) & \cdots & Lk(l_{i,2},l_{j,\frac{m}{2}-1}^{\#}) \\
\vdots & \vdots & \ddots & \vdots \\
Lk(l_{i,\frac{m}{2}-1},l_{j,1}^{\#}) & Lk(l_{i,\frac{m}{2}-1},l_{j,2}^{\#}) & \cdots & Lk(l_{i,\frac{m}{2}-1},l_{j,\frac{m}{2}-1}^{\#})
\end{pmatrix}
\quad.
\end{equation*}
\end{document}
顺便说一句,在矩阵外部显示行和列索引是可能的(但很困难),但是使用子矩阵表示则不需要它。