双栏纸表格

双栏纸表格

如何将下表放在两栏的纸张中:

\documentclass[final,5p,times,twocolumn]{elsarticle}
\bibliographystyle{elsarticle-num}
\usepackage{lineno,hyperref}
\modulolinenumbers[5]
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage{pgfplots}
\usepackage{rotating}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.14}
\usepackage{algorithmic}
\usepackage[linesnumbered,ruled]{algorithm2e}
%%%%to remove the footer
\makeatletter
\def\ps@pprintTitle{%
 \let\@oddhead\@empty
 \let\@evenhead\@empty
 \def\@oddfoot{}%
 \let\@evenfoot\@oddfoot}
\journal{Journal of \LaTeX\ Templates}
                                    % needed if you want to
\def\checkmark{\tikz\fill[scale=0.3](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}                                                    % use the \thanks command
\newtheorem{definition}{\textbf{Definition}}
\newtheorem{proposition}{\textbf{Proposition}}
\newtheorem{theorem}{\textbf{Theorem}}
\newtheorem{example}{\textbf{Example}}
% See the \addtolength command later in the file to balance the column lengths 
% on the last page of the document
\usepackage{multirow}

\usepackage{booktabs,lipsum,makecell,amsmath}

\usepackage{subfigure}
\usepackage{lipsum}
\usepackage{color,soul}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\comm}[1]{\textcolor{blue}{\noindent #1}}
\newcommand{\alert}[1]{\textcolor{magenta}{\noindent$\Rightarrow$ #1}}
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\magenta}[1]{\textcolor{magenta}{#1}}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\wajdi}[1]{\hl{\footnote{\hl{Wajdi: #1}}}}

\usepackage{lipsum}
\usetikzlibrary{arrows, positioning, shadows}

\begin{document}
\begin{frontmatter}
\title{\LARGE \bf
test
}
\begin{abstract}

\end{abstract}

\begin{keyword}
bla vla
\end{keyword}

    \begin{table}[hp]
    \begin{sideways}
    \begin{tabular}{rlrrrrrrr}
      \hline
     & X & MASHvstRap & MASHvsBEEML & tRapvsBEEML & frequency & Mash\_mean & BEEML\_mean & tRap\_mean \\ 
      \hline
    1 & ETS & 8.95e-04 & 7.35e-04 & 4.78e-06 &  10 & 0.52 & 0.67 & 0.30 \\ 
      11 & ZnF\_C2H2 & 7.08e-21 & 2.09e-02 & 1.70e-26 &  54 & 0.55 & 0.64 & 0.25 \\ 
      10 & Zn2Cys6 & 4.94e-04 & 5.50e-02 & 3.52e-06 &  17 & 0.38 & 0.61 & 0.13 \\ 
      8 & IRF & 1.16e-06 & 6.65e-02 & 5.54e-08 &  10 & 0.52 & 0.62 & 0.28 \\ 
      2 & FH & 1.27e-05 & 8.61e-02 & 5.20e-07 &  10 & 0.53 & 0.66 & 0.27 \\ 
      3 & HLH & 2.49e-05 & 1.31e+00 & 4.27e-05 &  13 & 0.61 & 0.74 & 0.26 \\ 
      4 & HMG & 8.73e-33 & 1.41e+00 & 3.49e-08 &  44 & 0.55 & 0.48 & 0.12 \\ 
      12 & ZnF\_C4 & 2.92e-06 & 1.92e+00 & 1.03e-07 &  10 & 0.66 & 0.73 & 0.27 \\ 
      9 & unknown & 3.15e-27 & 1.96e+00 & 5.38e-21 & 121 & 0.44 & 0.49 & 0.16 \\ 
      5 & Homeo & 1.69e-164 & 6.26e+00 & 2.35e-75 & 158 & 0.72 & 0.73 & 0.17 \\ 
      7 & Homeo, POU & 3.12e-12 & 7.36e+00 & 5.21e-12 &  11 & 0.69 & 0.70 & 0.18 \\ 
      6 & Homeo  & 9.82e-13 & 9.73e+00 & 1.21e-05 &  19 & 0.67 & 0.65 & 0.14 \\ 
       \hline
         9 & unknown & 3.15e-27 & 1.96e+00 & 5.38e-21 & 121 & 0.44 & 0.49 & 0.16 \\ 
      5 & Homeo & 1.69e-164 & 6.26e+00 & 2.35e-75 & 158 & 0.72 & 0.73 & 0.17 \\ 
      7 & Homeo, POU & 3.12e-12 & 7.36e+00 & 5.21e-12 &  11 & 0.69 & 0.70 & 0.18 \\ 
      6 & Homeo  & 9.82e-13 & 9.73e+00 & 1.21e-05 &  19 & 0.67 & 0.65 & 0.14 \\ 
       \hline  9 & unknown & 3.15e-27 & 1.96e+00 & 5.38e-21 & 121 & 0.44 & 0.49 & 0.16 \\ 
      5 & Homeo & 1.69e-164 & 6.26e+00 & 2.35e-75 & 158 & 0.72 & 0.73 & 0.17 \\ 
      7 & Homeo, POU & 3.12e-12 & 7.36e+00 & 5.21e-12 &  11 & 0.69 & 0.70 & 0.18 \\ 
      6 & Homeo  & 9.82e-13 & 9.73e+00 & 1.21e-05 &  19 & 0.67 & 0.65 & 0.14 \\ 
       \hline
    \end{tabular}
    \end{sideways}
    \end{table}

\end{document}

我收到以下错误:

(no line number):
This is BibTeX, Version 0.99d (TeX Live 2016/Debian)
Capacity: max_strings=100000, hash_size=100000, hash_prime=85009
The top-level auxiliary file: elsarticle-template-1-num.aux
The style file: elsarticle-num.bst
Illegal, another \bibstyle command---line 73 of file elsarticle-template-1-num.aux
 : \bibstyle
 :          {IEEEtran}
I'm skipping whatever remains of this command
Database file #1: IEEEabrv.bib
Database file #2: elsevier.bib
Warning--I didn't find a database entry for "Papadakis2016"
You've used 5 entries,
            2937 wiz_defined-function locations,
            1226 strings with 16429 characters,
and the built_in function-call counts, 1679 in all, are:
= -- 155
> -- 47
< -- 2
+ -- 19
- -- 14
* -- 101
:= -- 231
add.period$ -- 5
call.type$ -- 5
change.case$ -- 5
chr.to.int$ -- 0
cite$ -- 5
duplicate$ -- 61
empty$ -- 191
format.name$ -- 18
if$ -- 437
int.to.chr$ -- 0
int.to.str$ -- 5
missing$ -- 5
newline$ -- 23
num.names$ -- 5
pop$ -- 37
preamble$ -- 1
purify$ -- 0
quote$ -- 0
skip$ -- 119
stack$ -- 0
substring$ -- 98
swap$ -- 20
text.length$ -- 2
text.prefix$ -- 0
top$ -- 0
type$ -- 0
warning$ -- 0
while$ -- 14
width$ -- 6
write$ -- 48
(There was 1 error message)

如果插入上述代码,表格只会输出整个第二列。我需要表格位于整个页面中。

答案1

  • 你的文档的序言真是一团糟......
  • 下面,在我的 mwe 中,我尝试清理它:
    • hyperref包必须位于序言的最后
    • 该包subfigure已过时。请使用subfigsubcaption代替。有关详细信息,请参阅其文档
    • 尝试根据序言中的包的用途对其进行分组(数学相关、表格相关等)。
  • 要让表格占据整个页面,您应该使用sidewaystable而不是浮动table和的组合sideways。由于您有两列文档,因此您应该使用sidewaystable*与浮动环境类似的工作方式table*(表格使用两列文本)

以下 mwe 在 overleaf 中运行正常,没有任何错误:

\documentclass[final,5p,times,twocolumn]{elsarticle}
\bibliographystyle{elsarticle-num}
\usepackage{lineno}
\modulolinenumbers[5]
\usepackage{amsmath, amsthm}
\usepackage{pgfplots}
\usetikzlibrary{arrows, positioning, shadows}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.14}
\usepackage{rotating}

\usepackage{booktabs, makecell, multirow}
\usepackage{siunitx}  % new, added for the second table example

%\usepackage{subfigure} obsolete, use "subfig" or "subcaption" instead
\usepackage{verbatim}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{hyperref}

\usepackage{lipsum}

\begin{sidewaystable*}
\begin{tabular}{rlrrrrrrr}
  \hline
 & X & MASHvstRap & MASHvsBEEML & tRapvsBEEML & frequency & Mash\_mean & BEEML\_mean & tRap\_mean \\
  \hline
1 & ETS & 8.95e-04 & 7.35e-04 & 4.78e-06 &  10 & 0.52 & 0.67 & 0.30 \\
  11 & ZnF\_C2H2 & 7.08e-21 & 2.09e-02 & 1.70e-26 &  54 & 0.55 & 0.64 & 0.25 \\
  10 & Zn2Cys6 & 4.94e-04 & 5.50e-02 & 3.52e-06 &  17 & 0.38 & 0.61 & 0.13 \\
  8 & IRF & 1.16e-06 & 6.65e-02 & 5.54e-08 &  10 & 0.52 & 0.62 & 0.28 \\
  2 & FH & 1.27e-05 & 8.61e-02 & 5.20e-07 &  10 & 0.53 & 0.66 & 0.27 \\
  3 & HLH & 2.49e-05 & 1.31e+00 & 4.27e-05 &  13 & 0.61 & 0.74 & 0.26 \\
  4 & HMG & 8.73e-33 & 1.41e+00 & 3.49e-08 &  44 & 0.55 & 0.48 & 0.12 \\
  12 & ZnF\_C4 & 2.92e-06 & 1.92e+00 & 1.03e-07 &  10 & 0.66 & 0.73 & 0.27 \\
  9 & unknown & 3.15e-27 & 1.96e+00 & 5.38e-21 & 121 & 0.44 & 0.49 & 0.16 \\
  5 & Homeo & 1.69e-164 & 6.26e+00 & 2.35e-75 & 158 & 0.72 & 0.73 & 0.17 \\
  7 & Homeo, POU & 3.12e-12 & 7.36e+00 & 5.21e-12 &  11 & 0.69 & 0.70 & 0.18 \\
  6 & Homeo  & 9.82e-13 & 9.73e+00 & 1.21e-05 &  19 & 0.67 & 0.65 & 0.14 \\
   \hline
     9 & unknown & 3.15e-27 & 1.96e+00 & 5.38e-21 & 121 & 0.44 & 0.49 & 0.16 \\
  5 & Homeo & 1.69e-164 & 6.26e+00 & 2.35e-75 & 158 & 0.72 & 0.73 & 0.17 \\
  7 & Homeo, POU & 3.12e-12 & 7.36e+00 & 5.21e-12 &  11 & 0.69 & 0.70 & 0.18 \\
  6 & Homeo  & 9.82e-13 & 9.73e+00 & 1.21e-05 &  19 & 0.67 & 0.65 & 0.14 \\
   \hline  9 & unknown & 3.15e-27 & 1.96e+00 & 5.38e-21 & 121 & 0.44 & 0.49 & 0.16 \\
  5 & Homeo & 1.69e-164 & 6.26e+00 & 2.35e-75 & 158 & 0.72 & 0.73 & 0.17 \\
  7 & Homeo, POU & 3.12e-12 & 7.36e+00 & 5.21e-12 &  11 & 0.69 & 0.70 & 0.18 \\
  6 & Homeo  & 9.82e-13 & 9.73e+00 & 1.21e-05 &  19 & 0.67 & 0.65 & 0.14 \\
   \hline
\end{tabular}
\end{sidewaystable*}

在此处输入图片描述

不过,我宁愿按如下方式写您的表格:

\begin{sidewaystable*}
\begin{tabular}{@{}
                rl
           *{3}{S[table-format=1.2e3]}
                S[table-format=3.0]
                S[table-format=1.2]
           *{3}{S[table-format=1.2]}
                @{}}
  \hline
 & X & {MASHvstRap} & {MASHvsBEEML} & {tRapvsBEEML} & {frequency} & {Mash\_mean} & {BEEML\_mean} & {tRap\_mean} \\
  \hline
% table body is the same as in mwe above
  \hline
\end{tabular}
\end{sidewaystable*}

这使:

在此处输入图片描述

相关内容