5

I have several images in a figure which can not come on a single page. The images near the bottom are trying to insert inside the bottom instead of going to the new page. I am using a package \raggedbottom because earlier I was facing the problem of unusual space between equation.

Please suggest me, how can I move the images to the next page which are near the bottom.

image

The black line above is the bottom of first page.

\begin{figure}[!ht]
\subfloat[Original image]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/assignPixels/img1/image1}}\\%%Org 
\subfloat[Layer-1, Subgraph-1]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L1_SG1}} 
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L1_VI}}  
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L1_Sal}}\\       
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L2_SG1}}%%Layer-2
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L2_SG2}}  
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L2_VI}}      
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L2_Sal}}\\           
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L3_SG1}}%%Layer-3
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L3_SG2}}  
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L3_SG5}}     
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L3_SG6}}\\   
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L3_VI}}  
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L3_Sal}}\\       
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L4_SG1}}%%Layer-4
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L4_SG2}}  
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L4_SG3}}     
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L4_SG8}} 
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L4_VI}}  
\subfloat[]{\includegraphics[width = 2in, height = 3cm, keepaspectratio]{bilder/concepts/GNGhierarchy/img1/L4_Sal}}
\caption{images}
\label{image}
\end{figure}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248
skm
  • 960
  • 2
    a figure is a box and never breaks, you need to split it up into smaller chunks – David Carlisle May 19 '15 at 10:20
  • @DavidCarlisle: But then the numbering of figures will get disturbed. Is there any way that I can start the numbering in sequence with the previous image and then I will write a final description. – skm May 19 '15 at 10:24
  • 2
    Not necessarily disturbed. You have shown no code (always a bad idea:-) so we don't know how you have done the sub-figure labels (a)--(t) but there are always ways of having a continuation figure that re-starts the sub captions so (say) (a)-(n) in the first and (o)-(t) in the second, but the details depend on what you have already. – David Carlisle May 19 '15 at 10:26
  • @DavidCarlisle: Sorry, I will update the code in a minute – skm May 19 '15 at 10:32
  • @DavidCarlisle: I have updated the code for putting this figure. Please let me know how can I split it while keeping the continuation of numbering. – skm May 19 '15 at 10:35
  • 2
    Package caption includes a \ContinuedFloat mechanism. – Johannes_B May 19 '15 at 10:40
  • @Johannes_B: that gives me an error: \ContinuedFloat outside float. – skm May 19 '15 at 10:47
  • Please be aware, that i have no idea where you placed it. I would guess outside a float. Simple fix, place in the float. I would need to open the doc. But then, a minimal working example, as already mentioned by @David is the quicker way to go. – Johannes_B May 19 '15 at 10:50
  • @Johannes_B: Ok, it has solved the problem. BUT, now the second part of image is in the middle of the page which should not happen. How can I bring it to the top so that it seem to be in continuation with the previous image. – skm May 19 '15 at 11:27
  • I thought i had left a comment on this yesterday, but apparently ... Here it is: How to place a float at the top of a floats-only page? – Johannes_B May 20 '15 at 13:26

1 Answers1

4

Your issue with placement here seem to resolve when using the following:

  1. Don't use a float. Instead, use the float package's [H] float specifier to set the float inside a minipage. This will give you preference over the (non-)float placement.

  2. Break the float manually at the desired location.

  3. Use \ContinuedFloat from the caption package to retain the existing \caption number.

enter image description here

\documentclass{article}

\usepackage{lipsum,graphicx,float}
\usepackage{subfig,caption}

\begin{document}

\lipsum[1-2]

\begin{figure}[H]
  \centering
  \setkeys{Gin}{width=2in,height=2cm,keepaspectratio}%
  \subfloat[Original image]{\includegraphics{example-image}} \\
  \subfloat[Layer-1]{\includegraphics{example-image-a}} 
  \subfloat[]{\includegraphics{example-image-b}}  
  \subfloat[]{\includegraphics{example-image-c}} \\
  \subfloat[]{\includegraphics{example-image-a}}%%Layer-2
  \subfloat[]{\includegraphics{example-image-b}}
  \subfloat[]{\includegraphics{example-image-c}}
  \subfloat[]{\includegraphics{example-image-a}}
  \caption{images}
\end{figure}

\begin{figure}[H]
  \ContinuedFloat\centering
  \setkeys{Gin}{width=2in,height=2cm,keepaspectratio}%
  \subfloat[]{\includegraphics{example-image-b}}%%Layer-3
  \subfloat[]{\includegraphics{example-image-c}}
  \subfloat[]{\includegraphics{example-image-a}}
  \subfloat[]{\includegraphics{example-image-b}}\\
  \subfloat[]{\includegraphics{example-image-c}}%%Layer-4
  \subfloat[]{\includegraphics{example-image-a}}
  \subfloat[]{\includegraphics{example-image-b}}
  \subfloat[]{\includegraphics{example-image-c}}\\
  \subfloat[]{\includegraphics{example-image-a}}%%Layer-5
  \subfloat[]{\includegraphics{example-image-b}}
  \subfloat[]{\includegraphics{example-image-c}}
  \subfloat[]{\includegraphics{example-image-a}}
  \caption{images}
\end{figure}

\end{document}

Placing the images using [H] removes the issue of the last page float being set vertically centred, since the float is set like regular text, which will end up at the top of the page.

Werner
  • 603,163