276

It's my first time working with a two-column document (declared as an argument to \documentclass) and I need to put in a very wide figure. The thing is, LaTeX puts it bounded by a column so it either (1) gets truncated, bleeding off the border or [right column] or (2) displays with an awkward text/line wrapping. Is there any way for me to get it to display the way \maketitle does, that is, at the top of the page (ideally) but at least spanning both columns and no awkward line wrapping?

BTW, I use the following code to display my figure:

\begin{figure}
    \centering
    \includegraphics[width=6in]{tictac.png}
    \caption{\textsf{The structure of our tic-tac-toe implementation.}}
    \label{fig:ds}
\end{figure}
1
  • 1
    If you do not want to make it complicated, simply under \usepackage{graphicx} you can \begin{figure*}[!ht] \centering \includegraphics{figures.png} \caption{Caption!} \label{fig:test} \end{figure*}
    – bim
    Commented Jan 24, 2021 at 14:13

1 Answer 1

366

You need to use the starred version * of the figure environment:

\documentclass[twocolumn]{article}
\usepackage[showframe]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
\lipsum[1-2]
\begin{figure*}
  \includegraphics[width=\textwidth,height=4cm]{tiger}
  \caption{This is a tiger.}
\end{figure*}
\lipsum[3-10]
\end{document}

enter image description here

This will usually flush the figure to the top of the following page, so there's not much control left to the user for movement. However, this may just be dependent on the user output.

In my opinion, you may be better off (for ease of use) with the multicol package. Then you can specify text (and sectional commands) in a multicols environment (with a mandatory argument specifying the number of columns), while specifying your figures in the usual way. The layout is different, since the content flows now with the multicols environment. However, this may also be user preference.

Here's a minimal working example:

\documentclass{article}
\usepackage[showframe]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{multicol}% http://ctan.org/pkg/multicols
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
\begin{multicols}{2}
  \lipsum[1-2]
\end{multicols}
\begin{figure*}[h]
  \includegraphics[width=\textwidth,height=4cm]{tiger}
  \caption{This is a tiger.}
\end{figure*}
\begin{multicols}{2}
  \lipsum[3-4]
\end{multicols}
\end{document}

enter image description here

10
  • 3
    Is there a reason you always include CTAN links of the packages?
    – doncherry
    Commented Oct 9, 2011 at 9:30
  • 15
    @doncherry: I've just grown use to that style since there are many new users to LaTeX on TeX.SX. If they copy and use code, they have a reference to the source of the package.
    – Werner
    Commented Oct 9, 2011 at 15:00
  • 2
    Alright ... I'm just not sure if a user who doesn't know how to retrieve a package from CTAN would be helped with a standard link to CTAN. We could think about two basic questions (one for each MiKTeX and TeX Live) explaining how to install a package, that you could refer to when necessary?
    – doncherry
    Commented Oct 9, 2011 at 15:13
  • 7
    @doncherry: The standard CTAN link provides a section called Getting it. This sheds some light on downloading/installation procedures for both MiKTeX & TeX Live. If someone is not capable of following these guidelines, I'm sure they'll post a question specific to this, which will solve the problem. They may even have MiKTeX's texify/pdftexify running to install packages on-the-fly (or use the recently released texliveonfly.py). Regardless, I thought it could only help.
    – Werner
    Commented Oct 9, 2011 at 15:27
  • 3
    Having lipsum in your code confused me, it worked with changing figure to figure*. Commented Sep 15, 2017 at 2:02

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