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

Open
Nevsor opened this issue Dec 4, 2024 · 1 comment
Labels
bug Something isn't working
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 Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants