[Tex/LaTex] \newpage stays in right column

page-breakingrevtextwo-column

I am using RevTEX 4.1 with the following parameters:

\documentclass[aps,prb,reprint]{revtex4-1}

This gives a two-column layout with a balanced two-column bibliography at the end. I would like to add an appendix with code listings and figures after the bibliography. After trying out several ways of using \pagebreak, \newpage and \clearpage and some odd combinations of switching to \onecolumngrid and back, I found this neat macro to actually get the page break without messing with the balanced bibliography.

However, whichever way I use for the page break, the new page starts in the right column. It's as if the page break would not reset the column in which to typeset.

Is this a known behavior/problem that I am just unable to google? Am I totally misunderstanding something about LaTeX's two-page concept?

PS: Oddly enough, if I add a figure of a certain size after the section heading on the new page, it seems to push things back into the left column. But this only happens if I choose the size of the figure such that it fits in one column, but it's caption does not (and place it with h!).

MWE:

\documentclass[aps,prb,reprint]{revtex4-1}
\usepackage{lipsum}

\makeatletter
\newcommand*{\balancecolsandclearpage}{%
  \close@column@grid
  \clearpage
  \twocolumngrid
}
\makeatother

\begin{document}

\lipsum[1-4]

\balancecolsandclearpage

This text is in the right column.

%\begin{figure}[h!]%
%test
%\caption{test}%
%\label{}%
%\end{figure}

\end{document}

Any other way of breaking the page while keeping the balanced columns (like \onecolumngrid\newpage\twocolumngrid) leads to the same behavior. Now if you uncomment that float, the This text is in the right column will move to the left column and the float will appear in the right column. This behavior is slightly different from my actual project, because there this only happens for a certain height of the float. But I think if I just could find out why the normal text continues in the right column in the first place that should solve my problem anyway.

Best Answer

I don't quite understand what causes the problem, but apparently it has something to do with the fact that your text is a single line which cannot be accomodated in two columns, and somehow TeX decides that, since it has to go in a single column, better to the right.

As soon as you add a second line to that page, the problem vanishes (although the result is far from optimal, imho:

\documentclass[aps,prb,reprint]{revtex4-1}
\usepackage{lipsum}
\makeatletter
\newcommand*{\balancecolsandclearpage}{%
  \close@column@grid
  \cleardoublepage
  \twocolumngrid
}
\makeatother
\begin{document}
\lipsum[1-4]
\balancecolsandclearpage

This text is in the right column. But I added more text so that at least two 
lines are required.
\end{document}

Result

The problem gets solved if you put a \clearpage after the contents of the last page:

\documentclass[aps,prb,reprint]{revtex4-1}
\usepackage{lipsum}
\makeatletter
\newcommand*{\balancecolsandclearpage}{%
  \close@column@grid
  \cleardoublepage
  \twocolumngrid
}
\makeatother
\begin{document}
\lipsum[1-4]
\balancecolsandclearpage

This text is in the right column. But I added more text so that at least two 
lines are required.
\clearpage
\end{document}

Solution

It also works when there is a single line, like in your original question. Perhaps it could be a good idea to put \AtEndDocument{\clearpage} in your preamble.