我有这个矩阵,它太大了,无法容纳在一页(A4 纸)中。我该如何将其放置在一页中?
\[A = \begin{bmatrix}
%C1
m &\sum_{i = 1}^{m}{x_{i1}^{C_1}} &\cdots &\sum_{i = 1}^{m}{x_{iq}^{C_1}} &0 &\cdots &0 &0 &\cdots &0\\
\sum_{i = 1}^{m}{x_{i1}^{C_1}} &\sum_{i = 1}^{m}{(x_{i1}^{C_1})^2} &\cdots &\sum_{i = 1}^{m}{x_{iq}^{C_1}x_{i1}^{C_1}} &0 &\cdots &0 &0 &\cdots &0 \\
\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots\\
\sum_{i = 1}^{m}{x_{i1}^{C_1}x_{iq}^{C_1}} &\sum_{i = 1}^{m}{(x_{i1}^{C_1})^2x_{iq}^{C_1}} &\cdots &\sum_{i = 1}^{m}{(x_{iq}^{C_1})^2} &0 &\cdots &0 &0 &\cdots &0\\
%C2
0 &\cdots &0 &m &\sum_{i = 1}^{m}{x_{i1}^{C_2}} &\cdots &\sum_{i = 1}^{m}{x_{iq}^{C_2}} &0 &\cdots &0\\
0 &\cdots &0 &\sum_{i = 1}^{m}{x_{i1}^{C_2}} &\sum_{i = 1}^{m}{(x_{i1}^{C_2})^2} &\cdots &\sum_{i = 1}^{m}{x_{iq}^{C_2}x_{i1}^{C_2}} &0 &\cdots &0\\
\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots\\
0 &\cdots &0 &\sum_{i = 1}^{m}{x_{i1}^{C_2}x_{iq}^{C_2}} &\sum_{i = 1}^{m}{(x_{i1}^{C_2})^2x_{iq}^{C_2}} &\cdots &\sum_{i = 1}^{m}{(x_{iq}^{C_2})^2} &0 &\cdots &0\\
%R
0 &0 &\cdots &0 &\cdots &0 &m &\sum_{i = 1}^{m}{x_{i1}^{R}} &\cdots &\sum_{i = 1}^{m}{x_{iq}^{R}}\\
0 &0 &\cdots &0 &\cdots &0 &\sum_{i = 1}^{m}{x_{i1}^{R}}& \sum_{i = 1}^{m}{(x_{i1}^{R})^2} &\cdots &\sum_{i = 1}^{m}{x_{iq}^{R}x_{i1}^{R}}\\
\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots \\
0 &0 &\cdots &0 &\cdots &0 &\sum_{i = 1}^{m}{x_{i1}^{R}x_{iq}^{R}} &\sum_{i = 1}^{m}{(x_{i1}^{R})^2x_{iq}^{R}} &\cdots &\sum_{i = 1}^{m}{(x_{iq}^{R})^2}
\label{eq:matrix_A}
\end{bmatrix}\]
答案1
假设边距为 2.5 厘米,字体大小为 10pt,则只需省略所有求和极限(因为它们都是相同的,所以在矩阵中明确说明极限不会提供任何关键信息......)并将列间空白量减少 50% 左右。
\documentclass{article}
\usepackage{amsmath}
\usepackage[a4paper,margin=2.5cm]{geometry}
\begin{document}
\[
\setlength\arraycolsep{2.5pt} % default: 5pt
\renewcommand\arraystretch{1.33} % more relaxed vertical spacing
A = \begin{bmatrix}
%C1
m &\sum x_{i1}^{C_1} &\cdots &\sum x_{iq}^{C_1} &0 &\cdots &0 &0 &\cdots &0\\
\sum x_{i1}^{C_1} &\sum (x_{i1}^{C_1})^2 &\cdots &\sum x_{iq}^{C_1}x_{i1}^{C_1} &0 &\cdots &0 &0 &\cdots &0 \\
\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots\\
\sum x_{i1}^{C_1}x_{iq}^{C_1} &\sum (x_{i1}^{C_1})^2x_{iq}^{C_1} &\cdots &\sum (x_{iq}^{C_1})^2 &0 &\cdots &0 &0 &\cdots &0\\
%C2
0 &\cdots &0 &m &\sum x_{i1}^{C_2} &\cdots &\sum x_{iq}^{C_2} &0 &\cdots &0\\
0 &\cdots &0 &\sum x_{i1}^{C_2} &\sum (x_{i1}^{C_2})^2 &\cdots &\sum x_{iq}^{C_2}x_{i1}^{C_2} &0 &\cdots &0\\
\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots\\
0 &\cdots &0 &\sum x_{i1}^{C_2}x_{iq}^{C_2} &\sum (x_{i1}^{C_2})^2x_{iq}^{C_2} &\cdots &\sum (x_{iq}^{C_2})^2 &0 &\cdots &0\\
%R
0 &0 &\cdots &0 &\cdots &0 &m &\sum x_{i1}^{R} &\cdots &\sum x_{iq}^{R}\\
0 &0 &\cdots &0 &\cdots &0 &\sum x_{i1}^{R}& \sum (x_{i1}^{R})^2 &\cdots &\sum x_{iq}^{R}x_{i1}^{R}\\
\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots \\
0 &0 &\cdots &0 &\cdots &0 &\sum x_{i1}^{R}x_{iq}^{R} &\sum (x_{i1}^{R})^2x_{iq}^{R} &\cdots &\sum (x_{iq}^{R})^2
\label{eq:matrix_A} % huh?!
\end{bmatrix}
\]
\end{document}
答案2
我可以借助两个技巧将您的矩阵放在页面上:
- 对于方程式我使用较小的字体
- 使用来自包 \changepage` 的宏,
\adjustwidth
我扩大了矩阵的水平空间 - 因此它突出到外部文本边缘(如果这不允许,那么我的建议将对您没有帮助:-()
代码:
\documentclass[]{article}
\usepackage{mathtools}
\newcommand\sumim{\sum\limits_{i=1}^{m}}
\usepackage[a4paper,showframe]{geometry}
\usepackage[strict]{changepage}
\begin{document}
\begin{adjustwidth}{}{-\marginparwidth}\small
\[A = \begin{bmatrix}
%C1
m &\sumim{x_{i1}^{C_1}} &\cdots &\sumim{x_{iq}^{C_1}} &0 &\cdots &0 &0 &\cdots &0\\
\sumim{x_{i1}^{C_1}} &\sumim{(x_{i1}^{C_1})^2} &\cdots &\sumim{x_{iq}^{C_1}x_{i1}^{C_1}} &0 &\cdots &0 &0 &\cdots &0 \\
\vdots &\vdots &\ddots &\vdots &\vdots &\vdots &\vdots &\vdots &\ddots &\vdots\\
\sumim{x_{i1}^{C_1}x_{iq}^{C_1}} &\sumim{(x_{i1}^{C_1})^2x_{iq}^{C_1}} &\cdots &\sumim{(x_{iq}^{C_1})^2} &0 &\cdots &0 &0 &\cdots &0\\
%C2
0 &\cdots &0 &m &\sumim{x_{i1}^{C_2}} &\cdots &\sumim{x_{iq}^{C_2}} &0 &\cdots &0\\
0 &\cdots &0 &\sumim{x_{i1}^{C_2}} &\sumim{(x_{i1}^{C_2})^2} &\cdots &\sumim{x_{iq}^{C_2}x_{i1}^{C_2}} &0 &\cdots &0\\
\vdots &\vdots &\ddots &\vdots &\vdots &\vdots &\vdots &\vdots &\ddots &\vdots\\
0 &\cdots &0 &\sumim{x_{i1}^{C_2}x_{iq}^{C_2}} &\sumim{(x_{i1}^{C_2})^2x_{iq}^{C_2}} &\cdots &\sumim{(x_{iq}^{C_2})^2} &0 &\cdots &0\\
%R
0 &0 &\cdots &0 &\cdots &0 &m &\sumim{x_{i1}^{R}} &\cdots &\sumim{x_{iq}^{R}}\\
0 &0 &\cdots &0 &\cdots &0 &\sumim{x_{i1}^{R}}& \sumim{(x_{i1}^{R})^2} &\cdots &\sumim{x_{iq}^{R}x_{i1}^{R}}\\
\vdots &\vdots &\vdots &\ddots &\vdots &\vdots &\vdots &\vdots &\ddots &\vdots \\
0 &0 &\cdots &0 &\cdots &0 &\sumim{x_{i1}^{R}x_{iq}^{R}} &\sumim{(x_{i1}^{R})^2x_{iq}^{R}} &\cdots &\sumim{(x_{iq}^{R})^2}
\end{bmatrix}\]
\end{adjustwidth}
\end{document}
ddots
我尝试在我认为应该使用它的地方进行介绍。
选项 showframe 仅用于显示页面布局。实际使用时必须将其省略。结果是: