You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Simon Pepping <sp...@leverkruid.eu> on 2006/08/15 21:51:52 UTC

Some comments on improving the algorithm for before-floats

Vincent,

Your proposal to improve the algorithm for the placement of footnotes
and before-floats sounds fine. A few comments.

'Ideally there would be a configuration setting telling which ratio of
the page should be filled with normal content; if this ratio is null
then pages only made of out-of-line objects would be allowed.' I think
this may be split into several configuration settings:
- The minimum amount of normal content on a page.
- Whether float pages are allowed. Even when the minimum amount is not
  zero, the user may set this to true.
- The minimum amount of float content on a float page before it may be
  considered feasible. Only relying on the normal demerits calculation
  for the stretch or shrink may be too restrictive.
In fact, these are configuration parameters in LaTeX.

Regarding the demerits for deferred out-of-line objects, a simple
multiplication with the page difference produces a linear
relation. This may be too weak, and a squared or steeper relation may
be preferable.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.eu

Re: Some comments on improving the algorithm for before-floats

Posted by Simon Pepping <sp...@leverkruid.eu>.
On Wed, Aug 16, 2006 at 10:31:06AM +0200, Vincent Hennebert wrote:
> Hi Simon,
> 
> Ok, I've taken out my LaTeX book again to be sure I understand you.
> 
> >Vincent,
> >
> >Your proposal to improve the algorithm for the placement of footnotes
> >and before-floats sounds fine. A few comments.
> >
> >'Ideally there would be a configuration setting telling which ratio of
> >the page should be filled with normal content; if this ratio is null
> >then pages only made of out-of-line objects would be allowed.' I think
> >this may be split into several configuration settings:
> >- The minimum amount of normal content on a page.
> 
> OK. This corresponds to the \textfraction parameter, right?

Right.

> >- Whether float pages are allowed. Even when the minimum amount is not
> >  zero, the user may set this to true.
> 
> OK. ...mmmh, found no dedicated LaTeX parameter for that.
> \floatpagefraction=0?

No, there is no such parameter in LaTeX. It is always allowed, subject
to the setting of the following parameter.

> >- The minimum amount of float content on a float page before it may be
> >  considered feasible. Only relying on the normal demerits calculation
> >  for the stretch or shrink may be too restrictive.
> 
> Moreover, if the figures are made of images, there is likely to be few
> shrink/stretch.
> This is also the \floatpagefraction parameter? Actually I don't really
> understand this parameter. At least, I don't understand its interest:
> this means that underfull float-only pages are acceptable? This looks
> weird to me.

Indeed, \floatpagefraction. You hardly ever can fill a page with
floats for 100%. With this parameter the user indicates that he is
satisfied with a page of floats which is say filled for 70%. If a work
contains many floats, this may be a nicer solution than having a long
queue of floats which can only be published on a much later page. For
example, you have 8 floats called in consecutive paragraphs, each
taking 35% of a page. If you place text below the floats, more floats
are called. A page of floats filled 70% will solve that problem.

> But as it would be easy to implement, I can do it. Related question:
> would footnotes be allowed on float-only pages, or only before-floats?
> This may be useful for books with many many footnotes. But for other
> books this can look weird. WDYT? Another config parameter?

I guess you can do that. Most people would not consider that to be a
floats page, but a page with text which happens to have only
footnotes. In terms of FO's regions, it is indeed a floats page.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.eu

Re: Some comments on improving the algorithm for before-floats

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Simon,

Ok, I've taken out my LaTeX book again to be sure I understand you.

> Vincent,
>
> Your proposal to improve the algorithm for the placement of footnotes
> and before-floats sounds fine. A few comments.
>
> 'Ideally there would be a configuration setting telling which ratio of
> the page should be filled with normal content; if this ratio is null
> then pages only made of out-of-line objects would be allowed.' I think
> this may be split into several configuration settings:
> - The minimum amount of normal content on a page.

OK. This corresponds to the \textfraction parameter, right?


> - Whether float pages are allowed. Even when the minimum amount is not
>   zero, the user may set this to true.

OK. ...mmmh, found no dedicated LaTeX parameter for that.
\floatpagefraction=0?


> - The minimum amount of float content on a float page before it may be
>   considered feasible. Only relying on the normal demerits calculation
>   for the stretch or shrink may be too restrictive.

Moreover, if the figures are made of images, there is likely to be few
shrink/stretch.
This is also the \floatpagefraction parameter? Actually I don't really
understand this parameter. At least, I don't understand its interest:
this means that underfull float-only pages are acceptable? This looks
weird to me.

But as it would be easy to implement, I can do it. Related question:
would footnotes be allowed on float-only pages, or only before-floats?
This may be useful for books with many many footnotes. But for other
books this can look weird. WDYT? Another config parameter?


> In fact, these are configuration parameters in LaTeX.
>
> Regarding the demerits for deferred out-of-line objects, a simple
> multiplication with the page difference produces a linear
> relation. This may be too weak, and a squared or steeper relation may
> be preferable.

No. Period.

Ok, some explanations ;-) This would break the property of optimal
substructure which makes the dynamic programming approach work. In his
thesis, Plass proved that using a squared function leads to an
NP-complete problem. In "Pagination Reconsidered", Brüggeman-Klein et
al. showed that using a linear function is nearer to a human's feelings,
is solvable by dynamic programming, and gives satisfying results. So
I think we may go with it.


> Regards, Simon

Thank you,
Vincent