1

I'm writing this text, and I have some images which I would like to put in the text. I am using

\usepackage{subfig}
\usepackage{float}

in my preamble, so I can force the figures to stay where I want, instead of go flying. Now, I'm trying to put three images at once, but they stay in one page all together, wasting good space from the previous page. Breaking everything into two environments figure makes the labelling (a), (b), (c) go away. I want to keep this labelling. Also, removing the [H] does not help. What do I do?

Code:

\begin{figure}[H] 

\centering 

\subfloat[A aplicação de Gauss no
 $R^3$.]{\includegraphics[scale =
 0.7]{Imagens_L3/Capitulo_7/Mapa_de_Gauss_R3}}

\subfloat[A aplicação de Gauss de uma superfície tipo
 espaço]{\includegraphics[scale =
 0.7]{Imagens_L3/Capitulo_7/Mapa_de_Gauss_Sitter}}

\subfloat[A aplicação de Gauss de uma superfície tipo
 tempo.]{\includegraphics[scale =
 0.7]{Imagens_L3/Capitulo_7/Mapa_de_Gauss_PH}}

\end{figure}

How it is now:

enter image description here

4
  • You need \ContinuedFloat from caption package, I hope.
    – user11232
    Apr 4, 2015 at 6:36
  • Well I'm working with figures and having similar troubles I found better results using heavy weapons instead the float and subfig packages. I use the standaloneclass for get the arrangements of figures that I need using inside the table or array environments. Finally the packages afterpageand placeinslet me get better control of the float images. I don't know if this can help you. Try to improve your question with a complete MWE.
    – Aradnix
    Apr 4, 2015 at 8:24
  • What do you want? All thee pictures on one page or seperate pictures on seperate pages? If it's in one figure environment then it's a float (see en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions) and the float object will stay together. Apr 4, 2015 at 8:33
  • 1
    Instead of subfig, try subcaption. It works much better with package hyperref.
    – Johannes_B
    Apr 4, 2015 at 9:29

1 Answer 1

2

You can use \ContinuedFloat from caption package and for subfigures, use subcaption package.

\documentclass{article}
\usepackage{graphicx}

\usepackage{caption}
\usepackage{subcaption}
\DeclareCaptionLabelFormat{continued}{#1~#2 (Cont.)}
\captionsetup[ContinuedFloat]{labelformat=continued}

\begin{document}
\begin{figure}
\centering
      \begin{subfigure}{\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{}
      \end{subfigure}
      \begin{subfigure}{\linewidth}
        \includegraphics[width=\linewidth]{example-image-b}
        \caption{}
      \end{subfigure}
      \caption{Some figure and its caption}
\end{figure}
\begin{figure}
\ContinuedFloat
\centering
      \begin{subfigure}{\linewidth}
        \includegraphics[width=\linewidth]{example-image-c}
        \caption{}
      \end{subfigure}
      \begin{subfigure}{\linewidth}
        \includegraphics[width=\linewidth]{example-image}
        \caption{}
      \end{subfigure}
      \caption{Some figure and its caption}
\end{figure}

\end{document}

enter image description here

7
  • I read before that you should not use the package captiontogether with subfig, you have to choose one of both, and in this case caption allows good results.
    – Aradnix
    Apr 4, 2015 at 16:27
  • @Aradnix Not exactly. For details, see the section 4.1 of subfig manual. :-)
    – user11232
    Apr 4, 2015 at 16:30
  • @Harish \ContinuedFloat did what I wanted, thanks. I couldn't use the packages subfig and subcaption at the same time, though. I kept subfig since I've got so many other imagens in the text, and it would be too much trouble adjusting everything. The packages subfig and caption do work together. Any thoughts?
    – Ivo Terek
    Apr 5, 2015 at 20:37
  • @IvoTerek They do work together. But in future, it is better to use subcaption as there are places where subfig may not be compatible.
    – user11232
    Apr 5, 2015 at 22:34
  • 1
    @IvoTerek Sorry. I wrote the above for caption and subfig. subcaption and subfig aren't comfortable with each other.
    – user11232
    Apr 5, 2015 at 22:40

You must log in to answer this question.

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