0

I have a single large picture that shows up early in a two-column document that needs to span both columns. I am inserting the figure like:

\begin{figure*}[btp]
    \centering
    \includegraphics[width=\textwidth]{my_figure}
    \caption{Some caption}
    \label{fig:my-fig}
\end{figure*}

I have several other single-column figures that come after this one in the same section along with a bunch of text. Single-column figures are inserted with something like:

\begin{figure}[!hbt]
    \centering
    \includegraphics[width=\columnwidth]{other_figure}
    \caption{Some other caption}
    \label{fig:my-other-fig}
\end{figure}

LaTeX waits to draw the large figure until the next page, and then draws all of the other figures for this section after it. I have tried every permutation of hbtp arguments I can think of for the large figure. I would love it if I could figure out how to put the smaller floats in the text columns as they fit while allowing the larger float to go after them even though that figure is defined before them.

I know I can use the floats package and force my smaller figures to show up where they are defined with [H], but I'd like to still allow them to float as needed. Is there some way to tell LaTeX to be OK with breaking insert order for a specific float?

5
  • Welcome to tex.sx. I'm sure there's an existing question that addresses this, but a quick answer is that if something has already been set to the page where the large figure is referenced, it can't be set until a later page. The input for a figure must appear before the page on which it is to be set, so moving the input for your figure earlier in the source may be sufficient. (This may not be a good solution if it would set the figure before its reference.) Feb 8, 2022 at 18:36
  • Try with just begin{figure*} \centering ... Feb 8, 2022 at 19:41
  • 1
    figures are always output in order, change the order in the source if needed, also \begin{figure}[!hbt] prevents the figures being placed on a float page so makes them going to the end of document more likely. or move the double column figure earlier in the source so it is output before the single column ones, it doesn't matter exactly where you put it anywhere before thepage you want it to appear Feb 8, 2022 at 22:04
  • @DavidCarlisle So there's no way to force LaTeX to ignore the queue order for drawing images? Or specify a separate queue for a particular image or set of images? Seems like something on the backend that should be controllable.
    – Engineero
    Feb 9, 2022 at 16:52
  • 2
    oh you can easily have a separate queue, the \newflloat macro from float package lets you make another (although it's only two or three lines with core latex definitions), but they are typset at point of source so if they float out of order they will appear in the final document numbered out of sequence which will be weird and confusing, just moving the double float one earlier (or, protentially later) in the source usually has the desired effect, moving it earlier keeps the numbering but makes it come out earlier, moving it later makes it get a later number, so it depends what you need Feb 9, 2022 at 17:22

1 Answer 1

1

The basic idea is to number single column figures 1,2,3,... and two column Figures A,B,C... using separate counters. Using newfloat, the default is to produce separate lists for single column figures and two column Figures, but you can use \addcontentsline to include the two column figures in the \listoffigures in the order they are printed.

\documentclass[twocolumn,letterpaper]{article}
\usepackage{newfloat}
\DeclareFloatingEnvironment[name=Figure,
  listname={Two Column Figures},
  fileext=lo2f,
  placement=tp]{Figure}
\renewcommand{\theFigure}{\Alph{Figure}}

\usepackage{lipsum}% MWE only

\begin{document}
\listoffigures

\listofFigures
\clearpage

\begin{Figure*}
  \rule{\textwidth}{1in}
  \caption{2 column figure}
  \addcontentsline{lof}{figure}{\string\numberline{\theFigure}%
    {2 column figure}}% add to \listoffigures
\end{Figure*}

\lipsum[1-6]% adjust to test ordering

\begin{figure}[t]
  \rule{\columnwidth}{1in}
  \caption{Top}
\end{figure}

\begin{figure}[b]
  \rule{\columnwidth}{1in}
  \caption{Bottom}
\end{figure}

\begin{figure}[p]
  \rule{\columnwidth}{3in}
  \caption{Page}
\end{figure}

\lipsum[8-16]

\end{document}

You must log in to answer this question.

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