Fix footnote in columns

Fixes #1433
This commit is contained in:
Laurenz 2023-06-08 12:24:47 +02:00
parent a1b0a41883
commit 2b812259c2
3 changed files with 16 additions and 2 deletions

View File

@ -285,12 +285,16 @@ impl<'a> FlowLayouter<'a> {
}
.resolve(styles);
let is_columns = block.is::<ColumnsElem>();
// Temporarily delegerate rootness to the columns.
let is_root = self.root;
if is_root && block.is::<ColumnsElem>() {
self.root = false;
self.regions.root = true;
}
// Layout the block itself.
let sticky = BlockElem::sticky_in(styles);
let fragment = block.layout(vt, styles, self.regions)?;
self.regions.root = self.root && is_columns;
for (i, frame) in fragment.into_iter().enumerate() {
if i > 0
@ -305,6 +309,7 @@ impl<'a> FlowLayouter<'a> {
)?;
}
self.root = is_root;
self.regions.root = false;
self.last_was_par = false;

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,9 @@
// Test footnotes in columns, even those
// that are not enabled via `set page`.
---
#set page(height: 120pt)
#align(center, strong[Title])
#show: columns.with(2)
#lorem(3) #footnote(lorem(6))
Hello there #footnote(lorem(2))