1

I am using the IEEE template to create a paper containing a table that spans the two columns and (almost) fits an entire page.

I have managed to add the table but latex leaves a large gap after the text by inserting it on the next page.

I know of the longtable package but it seems to not work in two column documents. This answer puts all the text inside a multicolumn environment.

Using table* was recommended in this answer which I have used but in the example given the text seems to complete the page without leaving any gaps.

How can I insert the table in one page and allow it to continue onto the next?

This is what I have tried so far:

\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{adjustbox, booktabs, longtable, tabularx, afterpage, xtab, multicol}

\begin{document}
    \IEEEraisesectionheading{\section{Introduction}\label{sec:introduction}}
    \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
    for IEEE Computer Society journal papers produced under \LaTeX\ using
    IEEEtran.cls version 1.8b and later.
    I wish you the best of success.

    \subsection{Subsection Heading Here}
    Subsection text here.

    \subsubsection{Subsubsection Heading Here}
    Subsubsection text here.

    \section{Conclusion}
    The conclusion goes here.

\appendix  %
    \input{tableIEEE}

    \clearpage
    \newpage

    \begin{thebibliography}{1}

        \bibitem{IEEEhowto:kopka}
            H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus
            0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.

    \end{thebibliography}

\end{document}
%\begingroup
    \begin{table*}[h]

        %\begin{center}
        \centering
        \caption{Summary of research papers about forecasting.}
        \begin{tabular} {p{3cm} c c p{5cm}}
        %\label{tab:table1}\\
            \toprule
            \textbf{Authors} & \textbf{Year} & \textbf{Methods} & \textbf{Comments}\\
            \toprule
            \citeauthor{Sindhu2006} & \citeyear{Sindhu2006} & Backpropagation and GA & \\
            \midrule
            \citeauthor{Zhang2008} & \citeyear{Zhang2008} & HsMM \\
            \midrule
            \citeauthor{Etemad-Shahidi2008} & \citeyear{Etemad-Shahidi2008} & Statistical models \\
            \midrule
            \citeauthor{Dong2010} & \citeyear{Dong2010} & Backpropagation and GA \\
            \midrule
            \citeauthor{Alegre-Sanahuja2014} & \citeyear{Alegre-Sanahuja2014} & Statistical models \\
            \midrule
            \citeauthor{Chretien2014} & \citeyear{Chretien2014} & --- & Surveys papers about Influenza forecasting. The methods
            used were 
            either Statistical or related to Epidemiology. \\
            \midrule
            \citeauthor{Singla2015} & \citeyear{Singla2015} & Statistical models & Patent, no experiments performed. \\
            \midrule
            \citeauthor{Kang2015} & \citeyear{Kang2015} & KNN & The KNN algorithm was used to predict malicious network traffic. \\
            \midrule
            \citeauthor{Prakash2016} & \citeyear{Prakash2016} & HMM & The flu was predicted through Twitter using HMM to process
            words 
            related to the flu. \\
            \midrule
            \citeauthor{Hsu2016} & \citeyear{Hsu2016} & Statistical models, ANN and SVM & AI better then statistics, SVM better 
            than ANN \\
            \midrule
            \citeauthor{Nguyen2018} & \citeyear{Nguyen2018} & FFN & Before running the experiments a Random Walk analysis was
            performed on
            the data. If the data was found to be a random walk there would be no reason to forecast it. \\
            \midrule
            \citeauthor{Lv2018} & \citeyear{Lv2018} & GRU & Predicted system call sequences as if they where natural language. 
            Strugled on longer system calls. \\
            \midrule
            \citeauthor{Shen2018} & \citeyear{Shen2018} & LSTM & Performance is reduced when handling imbalanced data. It cannot 
            discover zero-day attacks. \\
            \midrule
            \citeauthor{Fischer2018} & \citeyear{Fischer2018} & LSTM and time series & Concluded that LSTMs outperform Random
            Forest, 
            Deep Learning and Linear Regresion when forecasting market trends. \\
            \midrule
            \citeauthor{Xu2018} & \citeyear{Xu2018} & Statistical models & Used Privacy Rights Clearinghouse dataset. \\
            \midrule
            \citeauthor{Werner2018} & \citeyear{Werner2018} & ARIMA and Bayesian Networks & Predicting the intensity of attacks 
            can be easier using longer time ranges. ARIMA struggled with forecasts which were too large or too small. \\
            \midrule
            \citeauthor{Ghafir2019} & \citeyear{Ghafir2019} & HMM & HMM were used to predict the next step of an Advanced
            Persistent Threat.
            \\
            \midrule
            \citeauthor{George2019} & \citeyear{George2019} & --- & Focuses on data collection, cleaning and distribution. Also 
            sugests better data visualisation methods. \\
            \midrule
            \citeauthor{Scarpino2019} & \citeyear{Scarpino2019} & --- & Uses permutation entropy to determine if a desease 
            outbreak is predictable or not. \\
            \midrule
            \citeauthor{Meng2019} & \citeyear{Meng2019} & Statistical models & The Hill Equation was used as they modeled the 
            Android malware spread based on epidemiology. \\
            \bottomrule
            \end{tabular}
        %\end{center}
    \end{table*}
%\endgroup

Which produces the following output: enter image description here

As you can see the first page has space for part of the table but it is created on the next page. How can I place the table on the first page and let it continue to the second page followed by the references section?

9
  • table* should be the answer but as you have neither shown your input nor your output it is hard to guess why that is not working for you.. Commented Mar 14, 2020 at 15:07
  • See if tex.stackexchange.com/questions/474333/… can help you.
    – Zarko
    Commented Mar 14, 2020 at 15:14
  • 1
    Your MWE doesn't reproduce showed result (missing is table). LaTeX normally anticipate that the float size on page occupy max. 70% of text space. If it is bigger, it is pushed on own page. This rule you can change with \renewcommand{\textfraction}{0.07}. See tex.stackexchange.com/questions/475850/…`.
    – Zarko
    Commented Mar 14, 2020 at 16:05
  • Could you please clarify: Your question title sais "multi-page table" while the question itself mentions a table that "fits an entire page".
    – leandriis
    Commented Mar 14, 2020 at 16:15
  • 1
    Splitting the table into tow tabular*s as suggested here is most likely the way to go since longtable (that would be required for pagebreaks inside oof tables) does not cooperate well with twocolumn.
    – leandriis
    Commented Mar 14, 2020 at 16:29

2 Answers 2

0

Welcome to TeX.SE!

Try the following:

\documentclass[journal,compsoc]{IEEEtran} % 10pt font size is default size
\usepackage{booktabs, tabularx} % not used package is removed
\usepackage{stfloats}   % new, for placement floats at bottom of page

\begin{document}
    \IEEEraisesectionheading{\section{Introduction}\label{sec:introduction}}
    \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
    for IEEE Computer Society journal papers produced under \LaTeX\ using
    IEEEtran.cls version 1.8b and later.
    I wish you the best of success.

    \subsection{Subsection Heading Here}
    Subsection text here.

    \subsubsection{Subsubsection Heading Here}
    Subsubsection text here.

    \section{Conclusion}
    The conclusion goes here.

\appendix  %
    \begin{table*}[b] % placement option ([b]) has sense due to stfloats package
\caption{Summary of research papers about forecasting.}
\label{tab:table1}
\begin{tabularx}{\linewidth}{@{} l l l X @{}} % changed table environment
    \toprule
\textbf{Authors} & \textbf{Year} & \textbf{Methods} & \textbf{Comments}\\
    \midrule
\citeauthor{Sindhu2006} & \citeyear{Sindhu2006} & Backpropagation and GA & \\
    \midrule
\citeauthor{Zhang2008} & \citeyear{Zhang2008} & HsMM \\
    \midrule
\citeauthor{Etemad-Shahidi2008} & \citeyear{Etemad-Shahidi2008} & Statistical models \\
    \midrule
\citeauthor{Dong2010} & \citeyear{Dong2010} & Backpropagation and GA \\
    \midrule
\citeauthor{Alegre-Sanahuja2014} & \citeyear{Alegre-Sanahuja2014} & Statistical models \\
    \midrule
\citeauthor{Chretien2014} & \citeyear{Chretien2014} & --- & Surveys papers about Influenza forecasting. The methods
used were
either Statistical or related to Epidemiology. \\
    \midrule
\citeauthor{Singla2015} & \citeyear{Singla2015} & Statistical models & Patent, no experiments performed. \\
    \midrule
\citeauthor{Kang2015} & \citeyear{Kang2015} & KNN & The KNN algorithm was used to predict malicious network traffic. \\
\midrule
\citeauthor{Prakash2016} & \citeyear{Prakash2016} & HMM & The flu was predicted through Twitter using HMM to process
words
related to the flu. \\
    \midrule
\citeauthor{Hsu2016} & \citeyear{Hsu2016} & Statistical models, ANN and SVM & AI better then statistics, SVM better
than ANN \\
    \midrule
\citeauthor{Nguyen2018} & \citeyear{Nguyen2018} & FFN & Before running the experiments a Random Walk analysis was
performed on
the data. If the data was found to be a random walk there would be no reason to forecast it. \\
    \midrule
\citeauthor{Lv2018} & \citeyear{Lv2018} & GRU & Predicted system call sequences as if they where natural language.
Strugled on longer system calls. \\
    \midrule
\citeauthor{Shen2018} & \citeyear{Shen2018} & LSTM & Performance is reduced when handling imbalanced data. It cannot
discover zero-day attacks. \\
    \midrule
\citeauthor{Fischer2018} & \citeyear{Fischer2018} & LSTM and time series & Concluded that LSTMs outperform Random Forest,
Deep Learning and Linear Regresion when forecasting market trends. \\
    \midrule
\citeauthor{Xu2018} & \citeyear{Xu2018} & Statistical models & Used Privacy Rights Clearinghouse dataset. \\
    \midrule
\citeauthor{Werner2018} & \citeyear{Werner2018} & ARIMA and Bayesian Networks & Predicting the intensity of attacks
can be easier using longer time ranges. ARIMA struggled with forecasts which were too large or too small. \\
    \midrule
\citeauthor{Ghafir2019} & \citeyear{Ghafir2019} & HMM & HMM were used to predict the next step of an Advanced
Persistent Threat.
\\
    \midrule
\citeauthor{George2019} & \citeyear{George2019} & --- & Focuses on data collection, cleaning and distribution. Also
sugests better data visualisation methods. \\
    \midrule
\citeauthor{Scarpino2019} & \citeyear{Scarpino2019} & --- & Uses permutation entropy to determine if a desease
outbreak is predictable or not. \\
    \midrule
\citeauthor{Meng2019} & \citeyear{Meng2019} & Statistical models & The Hill Equation was used as they modeled the
Android malware spread based on epidemiology. \\
    \bottomrule
\end{tabularx}
    \end{table*}

    \clearpage
    \begin{thebibliography}{1}
\bibitem{IEEEhowto:kopka}
    H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus
    0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.
    \end{thebibliography}

\end{document}

in above code are missed packages for citing bibliography, since you not provide in your MWE. However, forcing compilation gives the following result:

enter image description here

If in your real document is not enough space on the page, where it is inserted into text, than the table will appear on the next page (bottom, for appear on the top, remove table placement option [b]). In the case, that th ext after point of table insertion is so short that on page is left some empty space, than try to split table into two parts as is shown in this answer.

2
  • It seems that the table is too big to fit in the same page as the text but this helped me get the 'Appendix' title and the table on the same page which is good! The problem now is that as the table is aced at the bottom of the page there is a large gap between the 'Appendix' and the table. I have tried repositioning the table with h, h!, t and removing the argument, but none of these worked. Do you know how to place the table slightly upwards on the page?
    – Marcus
    Commented Mar 14, 2020 at 18:13
  • @Marcus, with lack of information about your document, we can only guess what is the best measure to fix your problem. It seems that the worth to consider answer given in link at bottom of answer.
    – Zarko
    Commented Mar 14, 2020 at 18:19
0

Try along the lines:

\documentclass[twocolumn,...]{...}
\usepackage{stfloats}
...
\begin{document}
Lots of text in many pages and two columnns
\begin{figure*}[b] % put the fullwidth figure at the bottom of the page
% the graphic
\end{figure*}
Maybe more text.
\end{document}

Read the stfloats package documentation (texdoc stfloats) for more information.

You must log in to answer this question.

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