1

How to properly insert a figure with width=\textwidth in a two-column article?

I use \documentclass[reprint, aps, superscriptaddress, pra]{revtex4-2} and I would like to insert a broad figure in the text in a given place or, at the beginning of the next page. I tried

\begin{figure*}[ht] ... \end{figure*}

but the figure places randomly in a text (after 3 or even 4 pages). I also tried something like this:

\onecolumngrid \begin{figure}[H] ... \end{figure} \twocolumngrid

but as a result, the text behaves strangely -- text wraps from left to right in the middle of the page.

  • you can not use h or H you can use t or p so mostly your option is removing p so making it more likely the float goes to the end of the document, so first remove the option, other than that hard to say without an example. the placement is never random, but with no code shown we can not debug – David Carlisle Jul 08 '22 at 15:12
  • You can use the strip environment, from the cuted package (sttools bundle), for that. – Bernard Jul 08 '22 at 19:01
  • See https://tex.stackexchange.com/a/636699/161015 – Simon Dispa Jul 08 '22 at 20:48
  • figure* should ordinarily place the figure at the top of the next page, and switching to \onecolumngrid or using a widetext environment then forcing figure placement does tend to work. It sounds like something specific is going on in your code which will need an example to diagnose. – Dai Bowen Jul 09 '22 at 16:00

1 Answers1

2

Like this:

enter image description here

Code:

\documentclass[twocolumn]{article}
\usepackage{lipsum,graphicx}
\usepackage{cuted}
\begin{document}
    \lipsum[1-2]
    \begin{strip}
        \centering
        \includegraphics[width=14cm]{graph sinus and cosinus.pdf}
    \end{strip}
\lipsum[3-4]
\end{document}
  • Thank you for the answer! However, my file has a conflict with this package. Could you tell me please if it can conflict with any of the packages from my list? Code: \documentclass[reprint, aps, superscriptaddress, pra]{revtex4-2} \usepackage{amsmath, amssymb, amsfonts} \usepackage{dsfont} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{xcolor} \usepackage{mathtools} \usepackage{float} \usepackage{physics} \usepackage{lipsum, graphicx} %\usepackage{cuted} \usepackage[caption=false]{subfig} – MightyPower Jul 09 '22 at 14:29
  • I have already tried with your revtex4-2 document class. But i dont find it! – Raffaele Santoro Jul 09 '22 at 15:10
  • 1
    revtex uses ltxgrid to do the layout which appears to clash with the default implementation cuted is expecting – Dai Bowen Jul 09 '22 at 15:53