![elsarticle 中的横向表格超出页面范围](https://linux22.com/image/430166/elsarticle%20%E4%B8%AD%E7%9A%84%E6%A8%AA%E5%90%91%E8%A1%A8%E6%A0%BC%E8%B6%85%E5%87%BA%E9%A1%B5%E9%9D%A2%E8%8C%83%E5%9B%B4.png)
我有一张大桌子,这意味着我需要将 elsarticle 文档更改为横向。我遇到的问题是桌子超出了页面,我不知道如何解决这个问题。
MWE 如下:
\documentclass[final,10p,twocolumn,authoryear]{elsarticle}
\usepackage[a4paper,width=180mm,top=25mm,bottom=25mm]{geometry}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{landscape}
\begin{table*}
\caption[Caption.]{Caption.}
\label{label}
\begin{tabular}{ p{0.082\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} } \toprule
& \multicolumn{8}{c}{Something} & ~ \\
Something & \multicolumn{3}{c}{Something(2)} & \multicolumn{3}{c}{Something(1)} & \multicolumn{3}{c}{Something (0)} & Something \\
& Some & Some & Some & Some & Some & Some & Some & Some & Some & \\ \midrule
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\
\bottomrule
\end{tabular}
\end{table*}
\end{landscape}
\end{document}
答案1
我认为\begin{landscape}
页面布局有问题。发现页码放错了位置。
minipage
我会用里面的手动旋转表格rotatebox
。需要使用\centering
将表格放在页面中间。
检查这是否足以解决您的问题:
\documentclass[final,10p,twocolumn,authoryear]{elsarticle}
\usepackage[a4paper,width=180mm,top=25mm,bottom=25mm]{geometry}
%\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdflscape}
%\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{table*}
\centering
\rotatebox{90}{
\begin{minipage}{\textwidth}
\caption[Caption.]{Caption.}
\label{label}
\begin{tabular}{ p{0.082\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} } \toprule
& \multicolumn{8}{c}{Something} & ~ \\
Something & \multicolumn{3}{c}{Something(2)} & \multicolumn{3}{c}{Something(1)} & \multicolumn{3}{c}{Something (0)} & Something \\
& Some & Some & Some & Some & Some & Some & Some & Some & Some & \\ \midrule
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\
\bottomrule
\end{tabular}
\end{minipage}
}
\end{table*}
\end{document}
答案2
只需代替table
即可table*
:
\documentclass[final,10p,twocolumn,authoryear]{elsarticle}
\usepackage[a4paper,width=180mm,top=25mm,bottom=25mm]{geometry}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{landscape}
\begin{table}
\centering
\caption[Caption.]{Caption.}
\label{label}
\begin{tabular}{ p{0.082\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} } \toprule
& \multicolumn{8}{c}{Something} & ~ \\
Something & \multicolumn{3}{c}{Something(2)} & \multicolumn{3}{c}{Something(1)} & \multicolumn{3}{c}{Something (0)} & Something \\
& Some & Some & Some & Some & Some & Some & Some & Some & Some & \\ \midrule
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\
\bottomrule
\end{tabular}
\end{table}
\end{landscape}
\end{document}