1

I have the challenge of needing to start a clean page in a two-column (Xe)LaTeX document, yet without the fush semantics of \clearpage.

Consider the following example, which is the closest I got to achieving the desired output:

\afterpage
{
    \clearpage
    \begin{tikzpicture}[remember picture,overlay,x=\paperwidth,y=\paperheight]%
        ...
    \end{tikzpicture}
    \clearpage
}

This waits until the current page has ended, and then fills in a tikzpicture, such that I can draw on an empty following page. After this drawing, the regular document resumes - just like pasting a picture page into the regular document.

However, the following problems exist:

  • Due to the \clearpage, the above code forces all prior floats to be flushed. This is actually undesired since I have plenty of floats and I don't want the tikzpicture to interfere with the placement. I would like to avoid the flushing.
  • If I replace \clearpage with \newpage, I can avoid the flushing but this approach is unsuitable for a two-column document, since there \newpage changes its meaning to starting a new column.
  • If I replace \clearpage with \newpage~\newpage I must always make sure to only trigger it after even columns.
  • If I remove the first \clearpage, the tikzpicture actually does start on a new page as desired; however, the subsequent document content is placed below the tikzpicture.

I assume that two different solution approaches may be possible but I did not manage to succeed with either one:

  • Find a two-column \clearpage without flush
  • Use \afterpage{\tikz{...}\magic\newpage~\newpage} where \magic assures that no other content appears on the page.

Any suggestions or thoughts would be most appreciated.

2
  • 2
    the full documentation of \afterpage in a two column document is "This implementation does not work in two column mode" (page 1 of texdoc afterpage} Commented Jul 28, 2023 at 19:38
  • @DavidCarlisle You think people read footnotes?
    – cfr
    Commented Jul 29, 2023 at 1:21

1 Answer 1

1

The \null is because you can't have two \newpages (or \newcolumns) in a row.

\documentclass[twocolumn]{article}
\usepackage{lipsum}

\let\newcolumn=\newpage
\makeatletter
\renewcommand{\newpage}{\if@firstcolumn\newcolumn\null\fi \newcolumn}
\makeatother

\begin{document}
\lipsum[1]

\newpage
\lipsum[2]
\end{document}
1
  • 1
    \nell -> \null?
    – cfr
    Commented Jul 29, 2023 at 3:06

You must log in to answer this question.

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