[Tex/LaTex] Removing the space in the page before appendix

appendixspacing

I am writing a paper in IEEE format, in two columns. I will include some large figures in the appendix, spanning two columns – wide but not long -, because in text placement of the figures spoil the organization of the paper. But, when I create the appendix, after references there is a huge blank space and the appendix goes to the next page. I am including a sample code to show the problem.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%2345678901234567890123456789012345678901234567890123456789012345678901234567890
%        1         2         3         4         5         6         7         8

\documentclass[conference,10pt]{IEEEtran}
\makeatletter
\def\ps@headings{%
\def\@oddhead{\mbox{}\scriptsize\rightmark \hfil \thepage}%
\def\@evenhead{\scriptsize\thepage \hfil \leftmark\mbox{}}%
\def\@oddfoot{}%
\def\@evenfoot{}}
\makeatother
\pagestyle{empty}


\usepackage{booktabs}

\usepackage{subfig}
\usepackage{comment}
\usepackage[]{algorithm2e}
\usepackage{balance} 
\usepackage{booktabs} 
\usepackage{subfig}

\usepackage{balance}


\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{blindtext}
\usepackage{wrapfig}
\usepackage{amsmath}
\usepackage[dvipsnames,svgnames,x11names]{xcolor}
\usepackage[final]{changes}
\definechangesauthor[color=BrickRed]{EE}
\usepackage{todonotes}
\setlength{\marginparwidth}{3cm}
\makeatletter
\setremarkmarkup{\todo[color=Changes@Color#1!20,size=\scriptsize]{#1: #2}}
\makeatother

\newcommand{\note}[2][]{\added[#1,remark={#2}]{}}

\IEEEoverridecommandlockouts      

\title{\LARGE \bf A long title comes here about lets say whales}

\author{\IEEEauthorblockN{
Author First\IEEEauthorrefmark{1},
Author Second\IEEEauthorrefmark{1},
Author Third\IEEEauthorrefmark{1}, 
Author Fourth \IEEEauthorrefmark{2} and
Author Fifth \IEEEauthorrefmark{1}}
\IEEEauthorblockA{\IEEEauthorrefmark{1}A University, City, State\\
Email: \{first, second, third, fifth\}@city.edu}
\IEEEauthorblockA{\IEEEauthorrefmark{2}Another University, City, State\\
Email: fourth@city.edu}}

\begin{document}



\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

\blindtext

\end{abstract}

\section{Conclusion}
\Blindtext
\Blindtext

\balance
\onecolumn
\section*{Appendix}

\Blindtext

\end{document}

I changed the content of the paper but am including all the packages I am using in it. As a side note, my large figures are the ones created with \minipage package.This is what I get, please note the large residual space before appendix.

EDIT TO THE CODE

I removed redundant package usage as much as possible for the creation of the problem, I just wanted others to know maybe if one of the packages I used makes that problem.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%2345678901234567890123456789012345678901234567890123456789012345678901234567890
%        1         2         3         4         5         6         7         8

\documentclass[conference,10pt]{IEEEtran}


\usepackage{balance}
\usepackage[english]{babel}
\usepackage{blindtext}
\IEEEoverridecommandlockouts      

\title{\LARGE \bf A long title comes here about lets say whales}

\author{\IEEEauthorblockN{
Author First\IEEEauthorrefmark{1},
Author Fourth \IEEEauthorrefmark{2} and
Author Fifth \IEEEauthorrefmark{1}}
\IEEEauthorblockA{\IEEEauthorrefmark{1}A University, City, State\\
Email: \{first, second, third, fifth\}@city.edu}
\IEEEauthorblockA{\IEEEauthorrefmark{2}Another University, City, State\\
Email: fourth@city.edu}}

\begin{document}
\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

\blindtext

\end{abstract}

\section{Conclusion}
\Blindtext
\Blindtext

\balance

\onecolumn

\section*{Appendix}

\Blindtext

\end{document}

Best Answer

This solution uses the command \shortpage to switch between \twocolumn and \onecolumn at a natural page boundary. It puts the formatted text into a savebox and dumps it all in one go. Whatever is left at the end of the page is processed using multicols.

\afterpage executes at the start of the next page, where \onecolumn will not create a new page. It also saves the remaining text from the previous page into \AP@partial.

\documentclass[conference,10pt]{IEEEtran}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{balance}

\usepackage{afterpage}
\usepackage{multicol}
\newsavebox{\shortpagebox}

\makeatletter
\newcommand{\shortpage}[1]% #1= \twocolumn text to wrap into \onecolumn page
{\par
  \setbox\shortpagebox=\vbox{\strut #1\par}%
  \afterpage{\onecolumn
    \begin{multicols}{2}
    \unvbox\AP@partial
    \end{multicols}}%
  \unvbox\shortpagebox
\par}
\makeatother

\IEEEoverridecommandlockouts      

\title{\LARGE \bf A long title comes here about lets say whales}

\author{\IEEEauthorblockN{
Author First\IEEEauthorrefmark{1},
Author Second\IEEEauthorrefmark{1},
Author Third\IEEEauthorrefmark{1}, 
Author Fourth \IEEEauthorrefmark{2} and
Author Fifth \IEEEauthorrefmark{1}}
\IEEEauthorblockA{\IEEEauthorrefmark{1}A University, City, State\\
Email: \{first, second, third, fifth\}@city.edu}
\IEEEauthorblockA{\IEEEauthorrefmark{2}Another University, City, State\\
Email: fourth@city.edu}}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

\blindtext

\end{abstract}

\section{Conclusion}
\Blindtext
\shortpage{\Blindtext}

\section*{Appendix}

\Blindtext

\end{document}
Related Question