1

how can put the following table in a two column paper:

\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}

i get the following error:

(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)

If insert the above code, the table outputs only in the whole second column. I need the table to be in whole page.

1
  • please provide mwe (minimal working example)!
    – Zarko
    Aug 10, 2018 at 21:23

1 Answer 1

2
  • the preamble of your document is a real mess ...
  • below in my mwe i try to clean-up it:
    • the hyperref package had to be last in preamble
    • the package subfigure is obsolete. use subfig or subcaption instead. for details see their documentation
    • try group packages in preamble regarding to their purpose (math related, table related, etc).
  • to have table over whole page you should use sidewaystable instead of combination of float table and sideways. since you have two column document, you should use sidewaystable* which works similar as table* float environment (table use both columns of text)

the following mwe works in overleaf without any error:

\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*}

enter image description here

however, i would rather write your table as follows.:

\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*}

which gives:

enter image description here

8
  • in overleaf isnt working Aug 10, 2018 at 21:13
  • isn't working is no information. you should say what is error. also you should provide complete document begining with \documentclass{...} and ending with \end{document} that i can provide complete mwe (minimal working example). in my latex installation works.
    – Zarko
    Aug 10, 2018 at 21:23
  • i updated the code in the question. please check Aug 10, 2018 at 21:34
  • @bib, i tested my code in overleaf too. it also works there as expected
    – Zarko
    Aug 10, 2018 at 21:35
  • It is working for me in a new project in overleaf. But my project i get the above error Aug 10, 2018 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .