17

I am using a standard [twocolumn]{article} class, but want to insert a image that spans both columns. To do this I am using the figure* environment, but when I use the [H] option, my image disappears.

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{amssymb}
\usepackage{mhchem}
\usepackage{lipsum}

\usepackage{float}

%% Packages I've tried to use for work arounds
%%\usepackage{dblfloatfix}  % position images that span both columns
%%\usepackage{subcaption}
%%\usepackage{placeins}
%%\usepackage{afterpage}


\begin{document}

\title{Example Article}


%% main text
\section{Introduction}
\lipsum[1]

\newpage
\section{Results}
\lipsum[1]

\begin{figure*}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{images/file_name}
    \caption{caption}~\label{fig:figure1}
\end{figure*}

\clearpage

\section{Conclusions}
\lipsum[3-4]

\end{document}

The intro and results paragraphs are both short, so I want them at the top, with the image at the bottom spanning both columns. Any suggestions?

4
  • 1
    So your underlying question is: "You have a figure you want to place at the top of the first page that spans both columns in a twocolumn article." Correct? Does your Introduction section span only the first column, while your Results section span only the second column?
    – Werner
    May 4, 2017 at 5:53
  • @Werner, the intent is actually to have the image at the bottom, with a one paragraph intro at the top in the left column, and a one paragraph results paragraph at the top in the right column.
    – gghh3456
    May 4, 2017 at 18:13
  • @DavidCarlisle, they don't generate a warning for me, but for the purpose of this question, you can delete them.
    – gghh3456
    May 4, 2017 at 18:14
  • @DavidCarlisle, Edited.
    – gghh3456
    May 4, 2017 at 18:30

3 Answers 3

10

The two column figure* is only compatible with [tp]. There is a fix in dblfloatfix.sty to use [b] but that will put the figure on the bottom of next page. Still not compatible with [h]. The easiest way I can think of, if the columns look something in the example, is to place it yourself using a minipage. I have used \captionof from the caption package to get the caption.

\documentclass[final,5p,times,twocolumn]{article}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{amssymb}
\usepackage{mhchem}
\usepackage{lipsum}

\usepackage{float}
\usepackage{caption}%% To get \captionof

%% Packages I've tried to use for work arounds
%%\usepackage{dblfloatfix}  % position images that span both columns
%%\usepackage{subcaption}
%%\usepackage{placeins}
%%\usepackage{afterpage}

\begin{document}

\title{Example Article}
\maketitle

%% main text
\section{Introduction}
\lipsum[1]
See Figure~\ref{fig:figure1}.

\vfill
\noindent
\begin{minipage}{1.0\textwidth}
  \strut\newline
  \centering
  \includegraphics[width=0.8\textwidth,height=5cm]{example-image}
  \captionof{figure}{caption}\label{fig:figure1}
\end{minipage}

\newpage
\section{Results}
\lipsum[1]

% \begin{figure*}[tb]
%     \centering
%     \includegraphics[width=0.8\textwidth,height=5cm]{example-image}
%     \caption{caption}\label{fig:figure1}
% \end{figure*}

\clearpage
\section{Conclusions}
\lipsum[3-4]

\end{document}

enter image description here

3
  • This displays what I'm looking for! I had considered minipage, but was wondering if there were alternative ways to do this.
    – gghh3456
    May 4, 2017 at 18:15
  • This does work pretty well though. I would just note that I used \vfill before the \noindent starting the minipage block to force the image to the bottom.
    – gghh3456
    May 4, 2017 at 19:25
  • @gghh3456, That seems reasonable. I have updated accordingly.
    – StefanH
    May 4, 2017 at 20:04
9

You can try stfloats which will place the figure on the current page if it is defined in the first column.

\documentclass[twocolumn]{article}
\usepackage[showframe]{geometry}% 
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{stfloats}
\begin{document}
 \section{Introduction}
\lipsum[1]

\begin{figure*}[b]
  \includegraphics[width=\textwidth,height=4cm]{example-image}
  \caption{This is a example.}
\end{figure*}
\newpage
\section{Results}
\lipsum[1]


\lipsum[3-10]
\end{document}

enter image description here

3
  • @DavidCarlisle: The example above contains no \maketitle, so I ignored it. But if I add it to my example it works fine. May 4, 2017 at 8:51
  • Interesting. This certainly displays the page how I want, but I think a solution where I can keep the figure code in the correct place in the text code would be preferable.
    – gghh3456
    May 4, 2017 at 18:19
  • Well you will have to. LaTeX can't know that you want a short first column if the picture isn't there. The "minipage" solution from Stefan needs this too (and before you consider the "minipage" solution: make the result text a bit longer, e.g. with \lipsum[1-2] and check what happens.) May 4, 2017 at 19:19
8

To place a figure or table spanning both columns as with the [H] option, you can use the cuted package also from the sttools bundle, and the \captionof command:

\documentclass[twocolumn]{article}
\usepackage[utf8]{inputenc} 
\usepackage[showframe]{geometry}%
\usepackage{lipsum}
\usepackage{graphicx, caption}
\usepackage{cuted}

\begin{document}

 \section{Introduction}
\lipsum[1]

\begin{strip}
\centering
  \includegraphics[width=\textwidth]{Gauguin.png}

  \captionof{figure}{D'où venons-nous ? Que sommes-nous ? Où allons-nous ?.}
\end{strip}
\newpage
\section{Results}
\lipsum[1]

\lipsum[3-10]

\end{document} 

enter image description here

2
  • This is close, but it gives me problems in terms of text formatting. If I get rid of the \newpage command before my results section, then two problems arise: 1) The Results section isn't in a new column which is what I want 2) There's text below the image from the next section that I can't get rid of with \newpage / \clearapage. !Imgur However, if I do include \newpage, instead of starting it in the right column, it deletes the hangover from the previous section and starts it new in the left column. !Imgur
    – gghh3456
    May 4, 2017 at 19:14
  • This worked well for me for the ACM two-column conference template. Apr 7, 2022 at 3:53

You must log in to answer this question.

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