6

The problem can be replicated (I hope) with the following MWE:

\documentclass[twocolumn]{revtex4-1}

\usepackage{tikz}

\begin{document}

\begin{figure*}
    \includegraphics[width=\linewidth]{example-image-a}
\end{figure*}
\clearpage

Some (or none) text

\end{document}

What happens is that the error Output routine didn't use all of \box255. [] is given, the image does not appear, and some blank pages are inserted instead.

The error doesn't show up changing most of the details in the above MWE. For example, it doesn't happen if:

  1. revtex is not used, or even if just the twocolumn option is not given
  2. The package graphicx is used instead of tikz to provide \includegraphics
  3. figure is used instead of figure*.

The problem still appears if:

  1. Instead of \clearpage I use \FloatBarrier,
  2. The \clearpage command is before instead of after the figure*,
  3. revtex4 is used instead of revtex4-1.

However, I need all of these elements in my actual document. The case in which I experience the above is a long (around 10 pages) paper, written in revtex4-1, in which I need to flush a long series of space-consuming wide-text figures before the bibliography. I however find myself completely unable to do so due to the above problem. I need the tikz package because the figures are partly built via tikz commands. I need the figures to be printed before the bibliography because if I don't explicitly impose so they end up scattered in the middle of various pieces of bibliography.

I tried a wide variety of combinations of solutions, but none worked. The best workaround I found was to have all the images printed after the bibliography, but that also is not acceptable because I also need to have an appendix after the bibliography, and I cannot have the images printed after also all the appendices, nor I want them scattered around the text of the appendices. Does anyone have an idea of what is going on here?

EDIT

David Carlisle's fix works on the above MWE. When used on a case with two figures, each composed of a pair of minipages, the dimensions of the second one are somehow changed with the fix. See the following new MWE:

\documentclass[twocolumn]{revtex4-1}

\usepackage{tikz}

\begin{document}

\begin{figure*}
    \begin{minipage}[b]{\columnwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
    \begin{minipage}[b]{\columnwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
\end{figure*}

\begin{figure*}
    \begin{minipage}[b]{\columnwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
    \begin{minipage}[b]{\columnwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
\end{figure*}

\clearpage

Some (or none) text

\end{document}

which results after using the fix suggested in enter image description here

1 Answer 1

5

I have no idea, but...

\documentclass[twocolumn]{revtex4-1}

\usepackage{tikz}

\begin{document}

\makeatletter\onecolumngrid@push\makeatother
\begin{figure*}
    \includegraphics[width=\linewidth]{example-image-a}
\end{figure*}
\clearpage
\makeatletter\onecolumngrid@pop\makeatother


Some (or none) text

\end{document}

You need to account for \columnwidth changing meaning when you locally switch to one column (actually \columnwidth was probably wrong anyway as you were not separating your minipages by columnsep).

\documentclass[twocolumn]{revtex4-1}

\usepackage{tikz}

\begin{document}

\makeatletter\onecolumngrid@push\makeatother
\begin{figure*}
    \begin{minipage}[b]{.5\textwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
    \begin{minipage}[b]{.5\textwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
\end{figure*}

\begin{figure*}
    \begin{minipage}[b]{.5\textwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
    \begin{minipage}[b]{.5\textwidth}
            \includegraphics[width=\columnwidth]{example-image-a}
    \end{minipage}%
\end{figure*}

\clearpage
\makeatletter\onecolumngrid@pop\makeatother

Some (or none) text

\end{document}
9
  • this solves the problem in the posted MWE. Unfortunately, it doesn't in my actual case, and in the MWE as soon as a second figure is added. See edited MWE. By the way, I like to try (and always fail) to understand what's going under the hood, but I cannot find where \onecolumngrid@push is defined. I don't find it in source2e nor in the code for revtex (where is used but not defined it seems)
    – glS
    Commented Nov 22, 2017 at 21:25
  • actually, on second try it actually does work in the sense that the error disappears (I was putting \clearpage outside of the two commands). However, now my figures' sizes were completely changed. I'll try to come out with a MWE replicating this
    – glS
    Commented Nov 22, 2017 at 21:31
  • see the updated example. The workaround doesn't work if there are two figure* each composed of a pair of minipages... LaTeX really puzzles me sometimes
    – glS
    Commented Nov 22, 2017 at 21:37
  • it's from ltxgrid.sty in the revtex directory, I just guessed by the name of the command and the fact that revtex uses it to wrap longtable that it might help here.I'll ty your new example.... @glS Commented Nov 22, 2017 at 21:38
  • @glS see update Commented Nov 22, 2017 at 21:46

You must log in to answer this question.

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