我正在尝试创建一个相当长的表格,采用elsarticle.cls
两列布局。但是,我找不到合适的选项来拆分我的表格,以便它可以放在一页上并使用两列设置。我提供了这个例子:
\documentclass[5p]{elsarticle}
\usepackage{array}
\usepackage{booktabs}
\usepackage{float}
\usepackage{ragged2e}
\newcommand{\Title}[1]{\justifying\caption{#1}}
\newcommand{\Source}[1]{\caption*{\justifying\textbf{Source:} #1}}
\newcommand{\Note}[1]{\caption*{\justifying\textbf{Note:} #1}}
\begin{document}
%----------------------------------
\begin{frontmatter}
\title{Two column tables in elsarticle document class}
\author{A. J. Lee}
\begin{abstract}
This document asks how to break tables in two column documents.
\end{abstract}
\end{frontmatter}
%----------------------------------
\section{Introduction}
See table
\begin{table}[H]
\centering
\begin{tabular}{p{1cm} p{1cm} p{5cm}}
% Header
\toprule
\textbf{Item} &
\textbf{Code} &
% Content
\textbf{Description} \\
\midrule
% Content
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
\bottomrule
\end{tabular}
\Title{Table}
\Source{Own creation}
\Note{This is an example}
\end{table}
由于这是双列布局,因此我无法使用该longtable
包。另外,supertabular
由于我创建了一些新命令,所以我没有使用该包:\Title
、\Source
和\Note
,并且选项中没有地方放置它们,supertabular
并且保持相同的外观(我猜)。
这是我的 pdf 结果:
答案1
您可以使用该包获得类似的结果supertabular
:
\documentclass[5p]{elsarticle}
\usepackage{array}
\usepackage{booktabs}
\usepackage{float}
\usepackage{ragged2e}
\usepackage{supertabular}
\begin{document}
\begin{frontmatter}
\title{Two column tables in elsarticle document class}
\author{A. J. Lee}
\begin{abstract}
This document asks how to break tables in two column documents.
\end{abstract}
\end{frontmatter}
\section{Introduction}
See table
\begin{center}
\tablehead{%
\toprule
\textbf{Item} &
\textbf{Code} &
\textbf{Description} \\
\midrule}
\bottomcaption{Table caption}
\begin{supertabular}{p{1cm} p{1cm} p{5cm}}
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
\bottomrule
\end{supertabular}
\justifying
\textbf{Source:} Here is the source of the table
\textbf{Notes:} Here are some table notes
\end{center}
\end{document}
答案2
我的问题的解决方案基于 @leandriss 自己的解决方案。我只是 (1) 在我的标题中添加了一些选项,使它们看起来更好,(2) 使用了更多的supertabular
包选项,以及 (3) 使用了一个空table
环境,其中包含表格末尾包[H]
中的选项并进行了一些调整。我分享代码:float
\vspace
\documentclass[authoryear,5p]{elsarticle}
\usepackage{array}
\usepackage{booktabs}
\usepackage{float}
\usepackage{ragged2e}
\usepackage{supertabular}
\usepackage[skip = 2pt,
font = footnotesize,
label font = bf,
justification = justified]{caption} % Etiquetas
\captionsetup{justification = justified,
singlelinecheck = false} % Alinear etiquetas a la izquierda.
\newcommand{\Title}[1]{\caption{#1}}
\newcommand{\Source}[1]{\caption*{\justifying\textbf{Fuente:} #1}}
\newcommand{\Note}[1]{\caption*{\justifying\textbf{Nota:} #1}}
\begin{document}
%----------------------------------
\begin{frontmatter}
\title{Two column tables in elsarticle document class}
\author{A. J. Lee}
\begin{abstract}
This document asks how to break table in two column documents.
\end{abstract}
\end{frontmatter}
%----------------------------------
\section{Introduction}
See table: \ref{tab:1}.
\begin{center}
% Main Header
\tablefirsthead{%
\toprule
\textbf{Item} &
\textbf{Code} &
\textbf{Description} \\
\midrule
}
% Tail
\tabletail{%
\midrule
\multicolumn{3}{l}{\emph{cotinue}} \\
\midrule
}
% Head
\tablehead{%
\midrule
\multicolumn{3}{l}{\emph{cotinue}} \\
\midrule
}
% Last Tail
\tablelasttail{%
\bottomrule
}
\begin{supertabular}{p{1cm} p{1cm} p{5cm}}
% Content
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
A & 777 & Some random stuff \\
\end{supertabular}
\end{center} \vspace{-16pt}
\begin{table}[H]
\Title{Table}
\label{tab:1}
\Source{Own creation}
\Note{This is an example}
\end{table}
\end{document}
这是最终的结果: