我有一张 26*26 的大方桌,我想把它显示在一页上。我想知道是否有办法将 \sidewaystable 和 \resizebox 结合起来。我试过了,但无法解决我的问题。你有什么建议吗?
\documentclass[a4paper,11pt, twoside, openright]{book}
\usepackage[english]{babel}
\usepackage[a4paper,top=3.5cm,bottom=3cm,left=3cm,right=3cm]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{caption}
\captionsetup{font=small}
\usepackage{topfront}
\usepackage{emptypage}
\usepackage{chngcntr}
\usepackage{rotating}
\begin{sidewaystable}
\resizebox{1\textwidth}{!}{
\begin{table}[h]
\tiny
\centering
\begin{table}[htbp]
\begin{tabular}{p{5em}rrrrrrrrrrrrrrrrrrrrrrrp{5em}r}
\multicolumn{1}{r}{} & \multicolumn{1}{p{5em}}{ddddddddd ddddddd} & \multicolumn{1}{p{5em}}{\% ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} & ddddddddddddddddddddddd & \multicolumn{1}{p{5em}}{ddddddddddddddddddddddd} \\
\multicolumn{1}{r}{} & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddd ddddddd & 1 & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
\% ddddddddddddddddddddddd & -0.0034 & 1 & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{p{5em}}{-0.5888} & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{p{5em}}{0.5819} & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{p{5em}}{0.1969} & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{p{5em}}{0.0722} & 1 & & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{p{5em}}{0.1455} & 1 & & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1 & & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{p{5em}}{-0.0579} & -0.0034 & -0.0034 & -0.0034 & 1 & \multicolumn{1}{r}{} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & \multicolumn{1}{r}{1} & \\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.1519 & 1 \\
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
}
\end{sidewaystable}
\end{document}
答案1
我非常怀疑您的读者是否会喜欢在一页纸上看到 25x25 的相关矩阵,并且字体大小极小。他们很可能会避开视线并匆忙跳到下一页...
但是,如果您有理由相信他们至少会欣赏排版工作,我建议您将第一行的所有 25 个标题标签逆时针旋转 90 度。(否则,标签会纠缠在一起。)并且,请加载包siunitx
并为 25 个(而不是 26 个)数据列使用该包的S
列类型。这样,数字就会在各自的小数点标记上对齐。
\documentclass[a4paper,11pt,twoside,openright]{book}
\usepackage[english]{babel}
\usepackage[top=3.5cm,bottom=3cm,hmargin=3cm]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{caption}
\captionsetup{font=small}
\usepackage{topfront}
\usepackage{emptypage}
\usepackage{chngcntr}
\usepackage{rotating} % for "sidewaystable" environment
\usepackage{siunitx} % for "S" column type
\begin{document}
\begin{sidewaystable}
\caption{25$\times$25 correlation matrix}
\label{tab:addlabel}
\resizebox{1\textwidth}{!}{%
\tiny
\setlength\tabcolsep{2pt} % default: 6pt
\begin{tabular}{@{} l *{24}{S[table-format=-1.4]}
S[table-format=-1.0] @{}}
& {\rotatebox{90}{ddddddddd ddddddd}} &
{\rotatebox{90}{\% ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} &
{\rotatebox{90}{ddddddddddddddddddddddd}} \\[1ex]
ddddddddd ddddddd & 1 \\
\% ddddddddddddddddddddddd & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.5888 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 0.5819 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 0.1969 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 0.0722 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 0.1455 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0579 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & 1\\
ddddddddddddddddddddddd & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.0034 & -0.1519 & 1\\
\end{tabular}%
}
\end{sidewaystable}
\end{document}