# large space between section header and content

I'm using an external file to add appendices to my thesis. The external file called (supplement.tex) contains a huge list of figures similar to this.

     \subsection{Testing}
\begin{figure}[H]
\includegraphics[width=0.4\textwidth]{fig.pdf}
\end{figure}


and I call this file in my main text like that:

\appendix
%\bookmarksetupnext{level=-1}

%\setcounter{tocdepth}{-1}
\chapter{Chapter1}
\label{app:chap1}
\section{General supplements}
\input{supplement1}


everything works fine and I can see the figures in the appendix of the thesis but the problem is that the space between the subsection title and the figure and the figure and the next subsection is huge. When I try to remove [H] from the figure, I get this error:

LaTeX Error: Too many unprocessed floats.

any idea how to easily solve this?

• H inevitably produces large white spaces. As it turns off the float mechanism which is designed to avoid that. the morefloats package might work for you depending on why you are using so many floats, if an earlier error is getting the floats stuck you may be using up an arbitrarily large float stack. – David Carlisle Nov 28 '14 at 11:22
• Do you need to use the figure environment for them at all? – cfr Nov 28 '14 at 13:52
• the package you suggested have some limitations. And I get an error that I'm above the maximum. @cfr no but even when I remove this, the space still appears. – ifreak Nov 28 '14 at 14:16
• If you don't need captions, remove the figure environment. I also think your pictures are a bit too big to fit on the page with the section heading. Try \includegraphics[width=0.4\textwidth,height=.7\textheight,keepaspectraio]{fig.pdf} (play a bit with the height). You can place an fbox around the figure and check, if there is any white space you didn't notice yet. – Johannes_B Nov 28 '14 at 15:38
• If you do need captions, but not floats, you can use one of the packages which supports captions outside floats. – cfr Nov 28 '14 at 17:31