我正在为我的表使用这个代码:
\begin{sidewaystable}
{\small
\begin{tabular}{cccccccccccccccccc}
\toprule
\multicolumn{3}{l}{\texttt{Table 2}} \\
&&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16 \\
1&Data&1.0000 \\
2&Data&0.7685&1.0000 \\
3&Data&0.9929&0.6870&1.0000 \\
4&Data&-0.0216&0.0756&-0.0386&1.0000 \\
5&Data&0.1682&0.1553&0.1622&0.0823&1.0000 \\
6&Data&0.1066&0.1323&0.0965&0.7434&0.6545&1.0000 \\
7&Data&-0.1570&-0.0477&-0.1694&0.3213&0.2427&0.2640&1.0000 \\
8&Data&0.0039&0.1275&-0.0192&0.1459&0.2015&0.0787&0.8274&1.0000 \\
9&Data&-0.1124&-0.1614&-0.0977&0.0818&0.1552&0.2830&-0.5384&-0.6937&1.0000 \\
10&Data&0.1127&0.1826&0.0941&0.1503&0.1684&0.0683&0.8447&0.9113&-0.8103&1.0000 \\
11&Data&0.1331&0.2704&0.1009&0.1211&0.2973&0.0971&0.5977&0.6733&-0.6123&0.6838&1.0000 \\
12&Data&-0.2886&-0.1881&-0.2928&0.0119&-0.4912&-0.3414&-0.3289&-0.2965&0.0121&-0.3776&0.0198&1.0000 \\
13&Data&0.2114&0.1480&0.2126&-0.3154&-0.0074&-0.1077&-0.4319&-0.3966&0.3685&-0.4816&-0.4054&-0.0652&1.0000 \\
14&Data&0.5222&0.5811&0.4851&0.1099&-0.2678&-0.1150&-0.1544&0.0488&-0.1829&0.1368&0.1757&0.0065&-0.0244&1.0000 \\
15&Data&0.0968&0.1313&0.0855&0.1132&0.6050&0.3705&0.7226&0.5990&-0.3787&0.6492&0.6104&-0.4678&-0.2440&-0.2391&1.0000 \\
16&Data&-0.1973&-0.2324&-0.1809&-0.2069&0.2431&0.09601&-0.0418&-0.1090&0.2863&-0.1926&-0.2749&-0.2090&0.2203&-0.3292&0.0386&1.0000 \\
\bottomrule
\end{tabular}
}
\end{sidewaystable}
但是表格从第 11 列开始就被截断了。我也在使用,\usepackage{fullpage}
因为我需要 1 英寸的边距。我也尝试过使用pdflscape
包,但是按照这个问题这一策略也不成功。
答案1
如果小数位数始终相同,请将表格大小调整为线宽并使用右对齐列。调整大小后总是适合边距:
\documentclass{article}
\usepackage{rotating,booktabs}
\def\MC#1{\multicolumn{1}{c}{#1}}
\begin{document}
\begin{sidewaystable}
\caption{Correlations}
\medskip
\resizebox{\linewidth}{!}{%
\tabcolsep=2pt
\begin{tabular}{@{}*{17}r@{}}\toprule
&\MC1&\MC2&\MC3&\MC4&\MC5&\MC6&\MC7&\MC8&\MC9&\MC{10}&\MC{11}&\MC{12}&\MC{13}&\MC{14}&\MC{15}&\MC{16} \\
1&1.0000 \\
2&0.7685&1.0000 \\
3&0.9929&0.6870&1.0000 \\
4&-0.0216&0.0756&-0.0386&1.0000 \\
5&0.1682&0.1553&0.1622&0.0823&1.0000 \\
6&0.1066&0.1323&0.0965&0.7434&0.6545&1.0000 \\
7&-0.1570&-0.0477&-0.1694&0.3213&0.2427&0.2640&1.0000 \\
8&0.0039&0.1275&-0.0192&0.1459&0.2015&0.0787&0.8274&1.0000 \\
9&-0.1124&-0.1614&-0.0977&0.0818&0.1552&0.2830&-0.5384&-0.6937&1.0000 \\
10&0.1127&0.1826&0.0941&0.1503&0.1684&0.0683&0.8447&0.9113&-0.8103&1.0000 \\
11&0.1331&0.2704&0.1009&0.1211&0.2973&0.0971&0.5977&0.6733&-0.6123&0.6838&1.0000 \\
12&-0.2886&-0.1881&-0.2928&0.0119&-0.4912&-0.3414&-0.3289&-0.2965&0.0121&-0.3776&0.0198&1.0000 \\
13&0.2114&0.1480&0.2126&-0.3154&-0.0074&-0.1077&-0.4319&-0.3966&0.3685&-0.4816&-0.4054&-0.0652&1.0000 \\
14&0.5222&0.5811&0.4851&0.1099&-0.2678&-0.1150&-0.1544&0.0488&-0.1829&0.1368&0.1757&0.0065&-0.0244&1.0000 \\
15&0.0968&0.1313&0.0855&0.1132&0.6050&0.3705&0.7226&0.5990&-0.3787&0.6492&0.6104&-0.4678&-0.2440&-0.2391&1.0000 \\
16&-0.1973&-0.2324&-0.1809&-0.2069&0.2431&0.0960&-0.0418&-0.1090&0.2863&-0.1926&-0.2749&-0.2090&0.2203&-0.3292&0.0386&1.0000 \\
\bottomrule
\end{tabular}}
\end{sidewaystable}
\end{document}
如果你需要更多的空间到页面顶部,你可以说
\resizebox{\dimexpr \linewidth+2cm\relax}{!}{%
...
答案2
我认为您应该进行的主要调整是减少 的值\tabcolsep
,该宏的值等于列间空白宽度的(一半)。您还可以删除第二列,该列反复包含“数据”,对吗?最后,我将使用该dcolumn
包将所有正数和负数的小数点对齐。
另一种可能性:显示相关矩阵的主对角线是不必要的,因为它1
在构造上包含 s。删除所有这些1.0000
将让您保存表中的整列(以及一行)。
这是修改后的 MWE 的结果(它没有实现不显示主对角线的想法):
\documentclass{article}
\usepackage{fullpage,rotating,booktabs,dcolumn}
\newcolumntype{.}{D{.}{.}{4}} %% 4 digits after decimal point
\setlength\tabcolsep{3pt}
\begin{document}
\begin{sidewaystable}
\caption{Correlations}
\medskip
\small
\begin{tabular}{@{}r*{16}{.}@{}}
\toprule
&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16 \\
1&1.0000 \\
2&0.7685&1.0000 \\
3&0.9929&0.6870&1.0000 \\
4&-0.0216&0.0756&-0.0386&1.0000 \\
5&0.1682&0.1553&0.1622&0.0823&1.0000 \\
6&0.1066&0.1323&0.0965&0.7434&0.6545&1.0000 \\
7&-0.1570&-0.0477&-0.1694&0.3213&0.2427&0.2640&1.0000 \\
8&0.0039&0.1275&-0.0192&0.1459&0.2015&0.0787&0.8274&1.0000 \\
9&-0.1124&-0.1614&-0.0977&0.0818&0.1552&0.2830&-0.5384&-0.6937&1.0000 \\
10&0.1127&0.1826&0.0941&0.1503&0.1684&0.0683&0.8447&0.9113&-0.8103&1.0000 \\
11&0.1331&0.2704&0.1009&0.1211&0.2973&0.0971&0.5977&0.6733&-0.6123&0.6838&1.0000 \\
12&-0.2886&-0.1881&-0.2928&0.0119&-0.4912&-0.3414&-0.3289&-0.2965&0.0121&-0.3776&0.0198&1.0000 \\
13&0.2114&0.1480&0.2126&-0.3154&-0.0074&-0.1077&-0.4319&-0.3966&0.3685&-0.4816&-0.4054&-0.0652&1.0000 \\
14&0.5222&0.5811&0.4851&0.1099&-0.2678&-0.1150&-0.1544&0.0488&-0.1829&0.1368&0.1757&0.0065&-0.0244&1.0000 \\
15&0.0968&0.1313&0.0855&0.1132&0.6050&0.3705&0.7226&0.5990&-0.3787&0.6492&0.6104&-0.4678&-0.2440&-0.2391&1.0000 \\
16&-0.1973&-0.2324&-0.1809&-0.2069&0.2431&0.0960&-0.0418&-0.1090&0.2863&-0.1926&-0.2749&-0.2090&0.2203&-0.3292&0.0386&1.0000 \\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}
附录:另一种节省空间的方法是打印更少的相关数字。问问自己:是否绝对有必要显示小数点后 4 位数字?或者您现在这样做是因为这是生成相关矩阵的软件的默认设置?尝试重新制作小数点后只有 3 位数字的表格;您可能会发现它的可读性因此而大幅提升。当然,您还需要调整.
列类型的定义,将其改为\newcolumntype{.}{D{.}{.}{3}}
。