mirror of
https://github.com/typst/typst
synced 2025-05-15 01:25:28 +08:00
Put floats back above footnotes instead of below (#5204)
This commit is contained in:
parent
92d6c2fc88
commit
fe43e27750
@ -634,6 +634,23 @@ impl<'a, 'b> Insertions<'a, 'b> {
|
|||||||
|
|
||||||
output.push_frame(Point::with_y(self.top_size), inner);
|
output.push_frame(Point::with_y(self.top_size), inner);
|
||||||
|
|
||||||
|
// We put floats first and then footnotes. This differs from what LaTeX
|
||||||
|
// does and is a little inconsistent w.r.t column vs page floats (page
|
||||||
|
// floats are below footnotes because footnotes are per column), but
|
||||||
|
// it's what most people (including myself) seem to intuitively expect.
|
||||||
|
// We experimented with the LaTeX ordering in 0.12.0-rc1, but folks were
|
||||||
|
// surprised and considered this strange. In LaTeX, it can be changed
|
||||||
|
// with `\usepackage[bottom]{footmisc}`. We could also consider adding
|
||||||
|
// configuration in the future.
|
||||||
|
for (placed, frame) in self.bottom_floats {
|
||||||
|
offset_bottom += placed.clearance;
|
||||||
|
let x = placed.align_x.position(size.x - frame.width());
|
||||||
|
let y = offset_bottom;
|
||||||
|
let delta = placed.delta.zip_map(size, Rel::relative_to).to_point();
|
||||||
|
offset_bottom += frame.height();
|
||||||
|
output.push_frame(Point::new(x, y) + delta, frame);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(frame) = self.footnote_separator {
|
if let Some(frame) = self.footnote_separator {
|
||||||
offset_bottom += config.footnote.clearance;
|
offset_bottom += config.footnote.clearance;
|
||||||
let y = offset_bottom;
|
let y = offset_bottom;
|
||||||
@ -648,15 +665,6 @@ impl<'a, 'b> Insertions<'a, 'b> {
|
|||||||
output.push_frame(Point::with_y(y), frame);
|
output.push_frame(Point::with_y(y), frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (placed, frame) in self.bottom_floats {
|
|
||||||
offset_bottom += placed.clearance;
|
|
||||||
let x = placed.align_x.position(size.x - frame.width());
|
|
||||||
let y = offset_bottom;
|
|
||||||
let delta = placed.delta.zip_map(size, Rel::relative_to).to_point();
|
|
||||||
offset_bottom += frame.height();
|
|
||||||
output.push_frame(Point::new(x, y) + delta, frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
output
|
output
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Loading…
x
Reference in New Issue
Block a user