Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout did not converge when printing a group heading causes outline to span another page. #82

Closed
Nevsor opened this issue Dec 4, 2024 · 2 comments
Milestone

Comments

@Nevsor
Copy link

Nevsor commented Dec 4, 2024

This code prevents the layout from converging:

#import "@preview/glossarium:0.5.1": make-glossary, register-glossary, print-glossary, gls
#let abbreviations = (
  (
    key: "Abbr",
    short: "Abbr",
    group: "Group"
  ),
)

#show: make-glossary
#register-glossary(abbreviations)

#set page(numbering: "1")

#v(22cm)
#outline()

#pagebreak()
#print-glossary(
    abbreviations,
    // show-all: true  // Uncommenting this makes the error disappear
  )

= Chapter
= Chapter
= Chapter
= Chapter

@Abbr
// #gls("Abbr") // Using this instead of or in addition to the previous line makes the error disappear

The reference to @Abbr causes the group heading to be printed and the outline to break into another page.
I believe that this somehow causes the group heading to not be printed in the next iteration and the outline to fit into one page again, because the page number of the outline repeats at the second page.

I traced the code to the line

let group-ref-counts = group-entries.map(count-refs)

and changing the line to

let group-ref-counts = (1,)

makes the error disappear. So I think that the reference counting is at fault here, but I don't know how to investigate this further.

@quachpas
Copy link
Collaborator

quachpas commented Dec 6, 2024

Thank you! Will take a look

@quachpas quachpas added this to the 0.5.3 milestone Dec 9, 2024
@quachpas quachpas added the bug label Dec 9, 2024
@quachpas quachpas removed the bug label Jan 27, 2025
@quachpas
Copy link
Collaborator

quachpas commented Feb 8, 2025

This is solved by 0.5.2 in 0af6b40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants