Simple floating environment? #2211
Replies: 1 comment 15 replies
-
After a false start looking at the page builder, I believe that I have an approach that can work for my use case and may be possible to generalise to other use cases. I need to add two new properties on vboxes:
When the page builder has found the optimal breaking point, try to set the glue. If this fails as under-full or over-full (currently reported to the user, but not the caller in For an over-full page, is the last vbox floating? If so, try moving it one later in the queue and retry. Moving forward should collect other floating things (floats are not reordered with respect to each other), so you are actually searching for the next non-floating thing to move backwards. If the next non-floating thing is a float barrier, give up and use the best approach that you've found so far. If a frame is under-full, try the same approach if the next thing that has not been typeset is floating (try to things from after it backwards to fill up the current frame). This is nowhere near as good as implementing the dynamic programming model from the TeX papers (which I thought from @simoncozens talk, SILE already used for page breaking) but would give me something that would work, with the caveat that you can't have floats bigger than a page and floats can't contain footnotes (the latter is fixable, just work). Does this sound plausible? Am I missing anything about how SILE works that would cause problems here? |
Beta Was this translation helpful? Give feedback.
-
I'm currently using the figure and table things from resilient, but they appear as inline paragraphs. This causes two problems:
Good style requires that figures appear after the first reference to them. I can put each float in the source after the paragraph that contains the first reference, and I can manually move it down, but ideally the latter bit would be automated. The behaviour that I would like is to move paragraphs, but not other figures / tables / listings, up automatically to fill in the underfull page that is created if a floating thing needs to be moved to the next page. Is there a (moderately) simple way of doing this?
Beta Was this translation helpful? Give feedback.
All reactions