You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text show rule sometimes not applied in footnotes #1467
While using a show "text": "replacement" rule, I discovered that it is sometimes not applied in a footnote.
Adding / removing a pagebreak or unrelated text seems to influence whether that bug triggers.
Interesting.
Can you please elaborate on the technical background of this issue?
I want to understand how footnotes work and in which cases show rules are applied to footnotes.
Having the inner workings of the issue in mind provides me with confidence that my document is working as intended.
Right now the behavior seems very magical / random to me and I fear my document will break at unrelated future changes.
The footnote's entry is layouted with the styles common to the whole flow of content it is contained in (the whole document or the closest parent column container). A show rule at the beginning of the document is shared by all content and thus applies to the flow. If just a single word is before the show rule, the show rule is not shared anymore and thus not lifted upwards and does not apply to the flow and, by extension, not to the footnotes. Spaces and blank lines before the show rules are fine because they are trimmed away. Not saying that this behaviour is ideal in this case, but that's how it works, currently.
there is the concept of Flow during layouting (could not find it in the docs tho)
a new Flow seems to be started:
at document start
after #pagebreak() (I was not able to get a new Flow after an automatic pagebreak)
after #page
in a multi-column document, maybe at columns (I have not tried that)
footnotes are styled in the context of its containing Flow, which might not necessarily be the context that is in scope when #footnote is called
When a show rule is defined at the correct position and scope, it is lifted up to be valid inside the whole Flow
Footnotes, and document layouting in general, are very difficult to make intuitive. This issue is where one of the internal abstractions leak a bit, but with your explanation the behavior makes sense to me and seems reasonable.
Thanks for typst :)
I would close it as "working as intended" for now, but that doesn't mean no improvement is possible here. More that it's not an actionable issue as-is.
Activity
laurmaedje commentedon Jun 12, 2023
Same reason as #1348
raphCode commentedon Jun 13, 2023
Interesting.
Can you please elaborate on the technical background of this issue?
I want to understand how footnotes work and in which cases show rules are applied to footnotes.
Having the inner workings of the issue in mind provides me with confidence that my document is working as intended.
Right now the behavior seems very magical / random to me and I fear my document will break at unrelated future changes.
laurmaedje commentedon Jun 13, 2023
The footnote's entry is layouted with the styles common to the whole flow of content it is contained in (the whole document or the closest parent column container). A show rule at the beginning of the document is shared by all content and thus applies to the flow. If just a single word is before the show rule, the show rule is not shared anymore and thus not lifted upwards and does not apply to the flow and, by extension, not to the footnotes. Spaces and blank lines before the show rules are fine because they are trimmed away. Not saying that this behaviour is ideal in this case, but that's how it works, currently.
raphCode commentedon Jun 13, 2023
Thank you.
To rephrase (maybe helpful for others):
#pagebreak()(I was not able to get a new Flow after an automatic pagebreak)#page#footnoteis calledFootnotes, and document layouting in general, are very difficult to make intuitive. This issue is where one of the internal abstractions leak a bit, but with your explanation the behavior makes sense to me and seems reasonable.
Thanks for typst :)
(Should we close this or keep it open?)
laurmaedje commentedon Jun 13, 2023
Exactly!
I would close it as "working as intended" for now, but that doesn't mean no improvement is possible here. More that it's not an actionable issue as-is.
raphCode commentedon Jun 13, 2023
Alright!
I opened a PR that includes the information in the docs, that might be helpful I think.
#1484
Make all text substitutions global