Hi Hans (and all),
I have difficulties with [force,here] floats. Even if such floats are something a bit degraded, they occured in publication text and they should be handled correctly.
I am sorry I do not send a minimal example, but the minimal example from me would be XML + XML mapping + some included tex files and styles; and these together are really not minimal example... I hope I succeed with text description :-)
The description:
-- subject disallows page breaks after self and recommends page break before self (\goodbreak),
-- the first page fills up with title, subject A + paragraphs, second subject B + [force]-float,
-- which produces three pages: the *first* correctly ended (before subject B); the *second* with subject B only and the *third* with the [force]-float and the rest of the text.
This is bad, as the [force]-float should be placed immediately after subject B onto the same (second) page.
The tracing pages reports for this case, the ### lines are my comments:
...
% t=378.42076 plus 53.50006 minus 13.50006 g=526.37599 b=2111 p=0 c=2111#
% t=389.22081 plus 53.50006 minus 13.50006 g=526.37599 b=1681 p=0 c=1681#
% t=400.02086 plus 53.50006 minus 13.50006 g=526.37599 b=1314 p=0 c=1314#
% t=410.8209 plus 53.50006 minus 13.50006 g=526.37599 b=1005 p=2000 c=3005
% t=421.62096 plus 53.50006 minus 13.50006 g=526.37599 b=748 p=-500 c=248#
subject : - Ozna?ení a význam svorek
#### here the [force] float starts, it is a table, so ModulePins is used more times
figures : dimensions of img/ModulePins.pdf loaded from figurefile itself
figures : figureobject ModulePins.pdf is reused
figures : figureobject ModulePins.pdf is reused
floatblocks : order disturbed
% t=897.74492 plus 56.20007 minus 16.20007 g=526.37599 b=* p=-500 c=*
#### now the first page is too high -- and it will be break in c=248 (which is
#### \goodbreak before subject
interaction : pdftex code inserted
[1.1{d:/TeXLocal/Private/fonts/map/pdftex/updmap/pdftex.map}{d:/TeXLocal/Privat
e/fonts/map/private.map}{d:/TeXLocal/Private/fonts/map/adobe.map}{d:/TeXLocal/P
rivate/fonts/map/stormtype.map}{d:/TeXLocal/Private/fonts/map/microsoft.map}{d:
/TeXLocal/Private/fonts/map/suitcase.map}]
%% goal height=526.37599, max depth=3.19995
% t=465.13591 plus 40.0 g=526.37599 b=357 p=-500 c=-143#
#### the page 1 is flushed, 465 pts rests, this is subject B + [force]-float.
#### But \OTRONEdocheckiffloatfits finds the float cannot be placed and, moreover,
#### it prepares \goodbreak before it.
floatblocks : order disturbed
floatblocks : 3 saved
% t=465.13591 plus 40.0 g=526.37599 b=357 p=-500 c=-143#
% t=465.13591 plus 40.0 g=526.37599 b=357 p=0 c=357
subject : - Parametry modulu
% t=505.02203 plus 44.05002 minus 4.05002 g=526.37599 b=11 p=0 c=11
% t=530.67215 plus 45.40002 minus 5.40002 g=526.37599 b=50 p=0 c=50
% t=545.52222 plus 46.75003 minus 6.75003 g=526.37599 b=* p=0 c=*
[2.2]
#### This goodbreak leads to break candidate with cost=-143 and
#### HERE the second page is broken. And the float is saved and placed
#### now onto the third page.
floatblocks : 3 moved
%% goal height=526.37599, max depth=3.19995
% t=0.0 g=359.6518 b=10000 p=0 c=100000#
% t=30.78607 plus 41.35 minus 1.35 g=359.6518 b=10000 p=0 c=100000#
...
By tweaking into \OTRONEdocheckiffloatfits, I found there is the line:
% new per 31/5/2004, should be an option, only one column mode
which creates \goodbreak. But I seems to me this \goodbreak should be generated
only if there is a room for the float? It the room is not here -- which leads
to float save -- the break causes unexpected page breaks.
For second -- it seems to me the checking of room for float in described case
counts the float size twice -- the float is counted inside
\pagetotal of page material pending from the overfilled page 1 and
for second its dimension is counted again with second call.
For third -- the described behaviour saves float even if it can be correctly
placed in currently filled page, so the float is pulled up from [force,here]
positioning and it starts flow -- but this is not proper behaviour for such
float.
As a result, IMHO (which can be completly bad, I really do not known all the
consequencies and mechanisms of ConTeXt) it should be corrected using following
way:
1. \OTRONEdocheckiffloatfits (and maybe another OTR routines) should respect the
float is [force,here]. For such floats the routine *always* should set
\roomforfloattrue and *not to* generate \goodbreak, as [force,here] floats should
be left to be placed by normal page builder TeX mechanism.
2. \goodbreak in % new per 31/5... block should be generated only if the float
is placed -- if it is saved, the break corresponding to the float should not appear
without the float.
3. maybe implement the option for \goodbreak :-) But there I cannot say more,
because I do not know the primary motivation.
I experimented with \OTRONEdocheckiffloatfits in desribed case -- after forcing
the routine to set \roomforfloattrue and removing \goodbreak, the pages are break
*exactly* as one (and me too :-) expects:
% t=378.42076 plus 53.50006 minus 13.50006 g=526.37599 b=2111 p=0 c=2111#
% t=389.22081 plus 53.50006 minus 13.50006 g=526.37599 b=1681 p=0 c=1681#
% t=400.02086 plus 53.50006 minus 13.50006 g=526.37599 b=1314 p=0 c=1314#
% t=410.8209 plus 53.50006 minus 13.50006 g=526.37599 b=1005 p=2000 c=3005
% t=421.62096 plus 53.50006 minus 13.50006 g=526.37599 b=748 p=-500 c=248#
subject : - Ozna?ení a význam svorek
figures : dimensions of img/ModulePins.pdf loaded from figurefile itself
figures : figureobject ModulePins.pdf is reused
figures : figureobject ModulePins.pdf is reused
floatblocks : order disturbed
floatblocks : 3 placed
% t=618.06926 plus 58.90009 minus 18.90009 g=526.37599 b=* p=0 c=*
interaction : pdftex code inserted
#### the first page without float
[1.1{d:/TeXLocal/Private/fonts/map/pdftex/updmap/pdftex.map}{d:/TeXLocal/Privat
e/fonts/map/private.map}{d:/TeXLocal/Private/fonts/map/adobe.map}{d:/TeXLocal/P
rivate/fonts/map/stormtype.map}{d:/TeXLocal/Private/fonts/map/microsoft.map}{d:
/TeXLocal/Private/fonts/map/suitcase.map}]
%% goal height=526.37599, max depth=3.19995
% t=185.46025 plus 42.70001 minus 2.70001 g=526.37599 b=10000 p=0 c=100000#
% t=189.51028 plus 44.05002 minus 4.05002 g=526.37599 b=10000 p=-500 c=100000#
% t=189.51028 plus 44.05002 minus 4.05002 g=526.37599 b=10000 p=0 c=100000#
subject : - Parametry modulu
% t=229.39641 plus 48.10004 minus 8.10004 g=526.37599 b=10000 p=0 c=100000#
% t=255.04652 plus 49.45004 minus 9.45004 g=526.37599 b=10000 p=0 c=100000#
#### the second page including the float and the following text.
That is all,
have a nice day,
Martin