Hi Jeremias, Thanks for your review!
Vincent, a comment on yours: For before-floats, you refer to best-fit and first-fit approaches. I'm not sure if it's really relevant here. If I'm not mistaken before-floats are pretty similar to footnotes which means you can probably take a lot from there. I think that first-fit only really helps when you get to side-floats.
Well, my understanding of before-floats makes me think that they may benefit from a total-fit algorithm. WRT footnotes, the difference is that a footnote must appear on the same page as its reference; this is a constraint that doesn't exist for before-floats, although it is best to place them as near their reference as possible, of course. When refering to first-fit/total-fit algorithms I had the paper "Pagination Reconsidered" referenced on the Wiki [1] in mind. To summarize quickly it is stated that placement of floats benefits from a better algorithm than first-fit, quite like for the computation of page breaks. In fact LaTeX uses a first-fit algorithm, which often leads to floats placed pages far from their reference. So I had the feeling that a total-fit algorithm could be applied to floats as well as to page breaks.
I think that user-configuration for best/first-fit doesn't help much. I rather think that FOP will have to find out itself whether it has to abandon best-fit so it can handle more complex features, i.e. switching to first-fit if it finds one of the following conditions: - side-float in the flow - page-masters with different available IPD in the flow - tables with auto table layout (when individual column widths are requested for each page)
That may be discussed. I remember of discussions on this list about the cost of a total-fit algorithm regarding time and memory consumption. IIRC there was stated that such an algorithm should be optional for rendering documents that don't need it, like invoices. That's why I was thinking of a config option. Regarding Fop automatically switching to the most appropriate algorithm, depending on the situation, I'm afraid of the complexity of such a behavior. That may be difficult to estimate which strategy is to be adopted, and when it should be decided that a given strategy has failed and that it should be switched to another one. But I may be wrong. Vincent [1] http://wiki.apache.org/xmlgraphics-fop/LiteratureLinks
