From bb0e0894748e572b29957acefa661e5ed68d5a15 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 12 Oct 2024 14:01:31 +0200 Subject: Fix logical ordering of floats and footnotes (#5185) --- tests/ref/footnote-break-across-pages.png | Bin 5467 -> 5473 bytes tests/ref/footnote-nested-break-across-pages.png | Bin 0 -> 1324 bytes tests/ref/footnote-nested.png | Bin 2555 -> 2539 bytes tests/ref/issue-4966-figure-float-counter.png | Bin 0 -> 1127 bytes tests/ref/place-float-counter.png | Bin 683 -> 670 bytes tests/suite/layout/flow/footnote.typ | 7 +++++-- tests/suite/layout/flow/place.typ | 1 - tests/suite/model/figure.typ | 22 ++++++++++++++++++++++ 8 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 tests/ref/footnote-nested-break-across-pages.png create mode 100644 tests/ref/issue-4966-figure-float-counter.png (limited to 'tests') diff --git a/tests/ref/footnote-break-across-pages.png b/tests/ref/footnote-break-across-pages.png index 2d05fcd5..878227cb 100644 Binary files a/tests/ref/footnote-break-across-pages.png and b/tests/ref/footnote-break-across-pages.png differ diff --git a/tests/ref/footnote-nested-break-across-pages.png b/tests/ref/footnote-nested-break-across-pages.png new file mode 100644 index 00000000..889fb067 Binary files /dev/null and b/tests/ref/footnote-nested-break-across-pages.png differ diff --git a/tests/ref/footnote-nested.png b/tests/ref/footnote-nested.png index 501b257e..06617d98 100644 Binary files a/tests/ref/footnote-nested.png and b/tests/ref/footnote-nested.png differ diff --git a/tests/ref/issue-4966-figure-float-counter.png b/tests/ref/issue-4966-figure-float-counter.png new file mode 100644 index 00000000..9988baea Binary files /dev/null and b/tests/ref/issue-4966-figure-float-counter.png differ diff --git a/tests/ref/place-float-counter.png b/tests/ref/place-float-counter.png index 42d40ab5..3253fbab 100644 Binary files a/tests/ref/place-float-counter.png and b/tests/ref/place-float-counter.png differ diff --git a/tests/suite/layout/flow/footnote.typ b/tests/suite/layout/flow/footnote.typ index 945ae4d3..4cf49777 100644 --- a/tests/suite/layout/flow/footnote.typ +++ b/tests/suite/layout/flow/footnote.typ @@ -9,13 +9,16 @@ A#footnote[A] \ A #footnote[A] --- footnote-nested --- -// Currently, numbers a bit out of order if a nested footnote ends up in the -// same frame as another one. :( First \ Second #footnote[A, #footnote[B, #footnote[C]]] Third #footnote[D, #footnote[E]] \ Fourth #footnote[F] +--- footnote-nested-break-across-pages --- +#set page(height: 80pt) +A #footnote([I: ] + lines(6) + footnote[II]) +B #footnote[III] + --- footnote-entry --- // Test customization. #show footnote: set text(red) diff --git a/tests/suite/layout/flow/place.typ b/tests/suite/layout/flow/place.typ index f3b77118..ec27139f 100644 --- a/tests/suite/layout/flow/place.typ +++ b/tests/suite/layout/flow/place.typ @@ -165,7 +165,6 @@ C place(auto, float: true, block(width: 100%, height: 100%, fill: aqua)) ) - --- place-float-column-align-auto --- #set page(height: 150pt, columns: 2) #set place(auto, float: true, clearance: 10pt) diff --git a/tests/suite/model/figure.typ b/tests/suite/model/figure.typ index fbd0ab29..19e81116 100644 --- a/tests/suite/model/figure.typ +++ b/tests/suite/model/figure.typ @@ -267,3 +267,25 @@ HI#footnote.entry(clearance: 2.5em)[There] // Test that figure caption separator is synthesized correctly. #show figure.caption: c => test(c.separator, [#": "]) #figure(table[], caption: [This is a test caption]) + +--- issue-4966-figure-float-counter --- +#let c = context counter(figure.where(kind: image)).display() +#set align(center) + +#c + +#figure( + square(c), + placement: bottom, + caption: [A] +) + +#c + +#figure( + circle(c), + placement: top, + caption: [B] +) + +#c -- cgit v1.2.3