From the description, your first float/graphic after the section must be simply too large to fit together with the section onto the page. That explains why with [H]
you end up with a page containing only the section title. The [H]
means do the float 100% "here and if it doesn't fit then move it to the next page (and everything following it with it). So it doesn't behave like a float but sticks to the sequencial order of the text.
The reason that with real floats you get fairly empty pages, is that LaTeX will (most likely) generate a number of float pages and those are allowed to be fairly empty by default. See the discussion of the float algorithm here.
Now to really see what TeX does under its bonnet, try a little tracing:
\documentclass{article}
\tracingonline1 % show tracing on the terminal
\tracingpages1 % show what the page breaker does
\begin{document}
\section{A}
\pagebreak[1] % allow a break here for testing
\parbox{6cm}{Picture too high\rule{1pt}{.98\textheight}}
\parbox{6cm}{Picture ok\rule{1pt}{.5\textheight}}
\end{document}
If you run the above then you will get the following tracing output:
%% goal height=550.0, max depth=5.0
% t=0.0 g=550.0 b=10000 p=0 c=100000#
% t=19.90276 plus 0.86108 g=550.0 b=10000 p=-51 c=100000#
% t=556.84485 plus 1.86108 g=550.0 b=* p=0 c=*
[1{c:/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
%% goal height=550.0, max depth=5.0
% t=535.9421 g=550.0 b=10000 p=0 c=100000#
% t=811.9421 plus 1.0 g=550.0 b=* p=0 c=*
[2]
%% goal height=550.0, max depth=5.0
% t=270.0 g=550.0 b=10000 p=0 c=100000#
% t=275.0 plus 1.0fil g=550.0 b=0 p=-10000 c=-10000#
[3]
%% goal height=550.0, max depth=5.0
% t=0.0 g=550.0 b=10000 p=0 c=100000#
% t=10.0 g=550.0 b=10000 p=-10001 c=-10001#
(./tmp2.aux)
%% goal height=550.0, max depth=5.0
% t=0.0 g=550.0 b=10000 p=0 c=100000#
% t=10.0 g=550.0 b=10000 p=0 c=100000#
% t=10.0 plus 1.0fill g=550.0 b=0 p=-1073741824 c=-1073741824#
It is not really difficult to read once you understand the basics:
%% goal height=550.0, max depth=5.0
% t=0.0 g=550.0 b=10000 p=0 c=100000#
LaTeX is trying to make a page with a goal height of 550pt. The second line means that so far the target size (t=...
) is 0pt (we are at the top of the page) the goal (g=...
) is still 550 (surprise :-) and it has found a breakpoint with penalty (p=..
) and if it would break there the badness (b=...
) would be 10000 in other words awful. The cost (c=...
) to use this breakpoint is also given (how it is calculated we can ignore here) and a #
at the end means that so far this is the best break point seen and will be used if nothing better comes along.
Now we will get for each breakpoint on the page such a line with a single %
in front.
% t=19.90276 plus 0.86108 g=550.0 b=10000 p=-51 c=100000#
So this line was due to the \pagebreak[1]
command which is using a penalty of -51. The target point is now 19.9pts down the page, ie we are after our heading. You can also see that t=
now includes a "plus" component, depending on the material on the page you might also see "minus" showing up, in that case TeX would be able to squeeze things a bit.
The result is still awful, but TeX also marked the line with #
i.e., it will use this breakpoint if nothing better comes along.
% t=556.84485 plus 1.86108 g=550.0 b=* p=0 c=*
This line now shows a huge increase in t=
which is our first \parbox
. And now you see that t
exceeds g
and since there is no minus component the page is overfull. As a result TeX marked the badness and the cost with *
meaning "impossible" and now goes backwards to find the best breakpoint seen and that is our break in the trace line before.
Thus the box moves to the next page.
%% goal height=550.0, max depth=5.0
% t=535.9421 g=550.0 b=10000 p=0 c=100000#
% t=811.9421 plus 1.0 g=550.0 b=* p=0 c=*
[2]
Here we see it again: the first % t=
line shows the breakpoint after the first "picture" and as you can see, TeX thinks this is ugly still (15 points of free room) so it tries to add the second parbox and the break after the second one is what we see as the second line. But this is now way too much so ...
Summary:
If you add these tracing commands to your document you can see what TeX was trying to do and how it decided on one point or the other. And that should give you an idea if your graphics isn't too large after all (and 1pt too large is too large).
Using \enlargethispage
as suggested could help you to avoid problems in certain situations and squeeze things onto a page even if they do not quite fit.
\raggedbottom
for your first pass. you may have to resort to manual page breaks to avoid breaks after section headings.\raggedbottom
,\nopagebreak
s and\linebreak
s without floats, but it still is a little weird that it would rather leave almost an entire page blank after the first section instead of shifting the next section onto it (\nopagebreak
didn't work there). @egreg No, I don't need captions, just the images.\hrule
and then\newpage
. insert another\hrule
after tee next section heading plus graphic. you can then measure from the top of the sectino heading to the rule, and add whatever is the default space above a section heading. this is how much space latex thinks it needs. place the first page on top of a "full" page (a page processed without\raggedbottom
) and see how much space is available. it should be less than what's needed.