I have got an issue with using the \afterpage command in combination with the IEEEtran document class. I have got a large table that I want to put on a landscape page and let the other text 'wrap around' that table as suggested here on stack exchange. However, using \afterpage{\input{table.tex}} does not put the landscape page with the table after a page is done, but after the first 'column' is done, so to say. For clarification I added an image Image of the problem where \afterpage{\input{table.tex}} does not input the landscape table after the whole page is full

My desired formatting is shown in this picture, where the table is put after a fully filled page Desired formatting

Other variantions of the commands that I have tried

  • \afterpage{\clearpage \input{table.tex}}
  • \afterpage{\newpage\input{table.tex}}
  • \afterpage{\clearpage} \afterpage{\input{table.tex}}

I think I am unaware of how some aspects of the IEEE and afterpage package work.

This is my file in which I include all packages

\documentclass[a4paper, 10 pt]{IEEEtran} 


\addtolength{\headheight}{1.8 cm}
\addtolength{\headsep}{.2 cm}


\usepackage{dsfont,latexsym,cite, comment, graphicx,color}
\usepackage{url, hyperref}

\newcommand{\goodgap}{%for subfigure package





This is my file in which I have the table that I want to put on a landscape page. Note, I have removed the contents




\begin{tabular}{M{2.5cm} M{3cm} M{4cm} M{3.5cm} M{2.5cm} M{3.5cm} M{4cm} M{1.2cm} M{1.0cm}} \toprule



%% ITEMS %%




Thanks in advance for your help!

  • 1
    the afterpage package documentation explicitly states that it does not work in two column mode (and even in one column mode is somewhat speculative and I'd be wary of using it in a published document) – David Carlisle Jan 8 '20 at 16:35
  • Try \makeatletter\afterpage{\if@firstcolumn\input{...}\else\afterpage{\input{...}}\fi}\makeatother You might want to use \onecolumn and \twocolumn around the landscape. – John Kormylo Jan 8 '20 at 19:48
  • It would probably be easier to use sidewaystable (rotating package) or even a table* [p] with \rotatebox (graphicx package) and a minipage. – John Kormylo Jan 9 '20 at 5:01
  • @JohnKormylo this works, great! Thanks for your input. using \onecolumn was not necessary for it to work, btw. – Nathan Jan 9 '20 at 9:32

Credits to John Kormylo

Using \makeatletter\afterpage{\if@firstcolumn \else\afterpage{\input{table.tex}}\fi}\makeatother will yield the desired result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.