0

I am just following this figure span to one column on double column page to span figures on a two-column page but the difference instead of pasting one figure I need to put two and three figures here.

This is code for pasting a figure by spanning two columns

\documentclass[twocolumn]{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage[demo]{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
\section{First section}
\lipsum[1-2]
\section{Second section}
\lipsum[3]
\begin{figure*}
  \includegraphics[width=\textwidth]{figure}
  \caption{This is a figure caption}
\end{figure*}
\lipsum[4]
\section{Last section}
\lipsum[5-10]
\end{document}

I want to this same but instead of one figure I want to put two and three figures. I tried this but it's not working. Can any one help?

 \begin{figure*}
  \includegraphics[width=\textwidth]{1.PNG}
  \caption{This is a figure caption}
  \includegraphics[width=\textwidth]{2.PNG}
  \caption{This is a figure caption}
\end{figure*}

see figure for clear requirements. enter image description here

please try to help instead of passing comments that it's already been answered. The existing one didn't help me that's why I posted this.

Bernard
  • 271,350
user12
  • 579
  • 2
    Is each image supposed to get its own caption, do you want a shared caption for all three images or do you want subcaptions with a shared caption? Although about tables rather than about images, the following may be useful: https://tex.stackexchange.com/a/597566/134144 – leandriis Aug 01 '21 at 08:04

1 Answers1

1

I propose this solution, based on the floatrow package:

\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{floatrow}
\DeclareFloatSeparators{Qquad}{\hskip4em}

\begin{document}

\section{First section} \lipsum[1-2]

\section{Second section} \lipsum[3] \begin{figure*}

\floatsetup{floatrowsep=Qquad} \begin{floatrow} \ffigbox[\FBwidth]{\caption{Ralph Steadman. Illustrations for \emph{Alice in Wonderland}}\label{Alice-Ralph}}{\includegraphics[scale=0.4]{AliceSteadman}} \ffigbox[\FBwidth]{\caption{Yuri Norstein. \emph{Hedgehog in the fog}}\label{Hedgehog}}{\includegraphics[scale=0.5]{Hedgehog-in-the-fog}}\hskip4em \ffigbox[\FBwidth]{\caption{Max Ernst. \emph{Euclid}}\label{Ernst}}{\includegraphics{Euclid}} \end{floatrow} \end{figure*} \lipsum[4]

\section{Last section} \lipsum[5-10]

\end{document}

enter image description here

Bernard
  • 271,350
  • Since both IEEE and floatrow use custom captions, this may not be a good idea. Don't mess with IEEE captions. – John Kormylo Aug 01 '21 at 15:45
  • @JohnKormylo: As far as I know, the only thing that floatrow does is to fix the caption width – Bernard Aug 01 '21 at 15:50
  • It can also move them to entirely different locations. See https://tex.stackexchange.com/questions/403661/how-to-prevent-floatrow-from-moving-the-caption (OTOH, I believe the floatbox was created specifically to overcome this problem.) – John Kormylo Aug 01 '21 at 15:54
  • @John they are using 2 figures in a row .. i need to place three figures – user12 Aug 01 '21 at 16:53
  • 1
    @Alex - What works for two tables will work for as many as will fit the page. – John Kormylo Aug 02 '21 at 03:07
  • three figures are working but its not working for four figures .. how to do this – user12 Aug 13 '21 at 15:55
  • 1
    @Alex: I had not seen your last comment, sorry. If your question is bout the floatrow environment, you can specify the number of figures in a row as an optional argument, like this: \begin{floatrow}[4] … \end{floatrow}. Of course, the sum of the widths of these figure must not exceed \textwidth. – Bernard Aug 31 '21 at 11:13