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

Footnote numbering increments with subslides #165

Open
TakodaS opened this issue May 8, 2024 · 10 comments
Open

Footnote numbering increments with subslides #165

TakodaS opened this issue May 8, 2024 · 10 comments

Comments

@TakodaS
Copy link

TakodaS commented May 8, 2024

#slide[
  #one-by-one[
    One#footnote[Numbering starts at 1.]
  ][ footnote numbering increases... ]
]

With each subslide, the footnote numbering increments. Typst's footnote documentation says the following:

By default, the footnote numbering continues throughout your document. If you prefer per-page footnote numbering, you can reset the footnote counter in the page header. In the future, there might be a simpler way to achieve this.

However, since polylux implements new pages using pagebreak I'm not sure how to fix this.

@TakodaS TakodaS changed the title Footnote numbering increases Footnote numbering increments with subslides May 8, 2024
@AnnLIU15
Copy link

AnnLIU15 commented May 9, 2024

To reset the footnote counter in the page header according to the Typst documentation, you can simply modify the content of the slide in xxxx.typ. This adjustment might resolve your issue. However, be aware that the footnote content could appear before its corresponding citation.

For instance, you might download simple.typ and import it locally into your main.typ using the directive #import "libs/simple.typ": *. Then, modify the import statements as follows:

// previous
#import "../logic.typ"
// after modifying
#import "@preview/polylux:0.3.1": *
#import logic:*

Next, insert counter(footnote).update(0) after if sections == () [] else { deco-format(sections.last().body) } on line 52. This change should address the issue where "Footnote numbering increments with subslides".

1715236722693

The output is shown in the following image:

image

@andreasKroepelin
Copy link
Owner

This is known problem and has been discussed extensively elsewhere. It is indeed something that cannot be solved nicely by Polylux without Typst offering some "state freezing".

We can of course discuss whether it makes sense to just always start the footnote counter from 1 on every slide...

@TakodaS
Copy link
Author

TakodaS commented May 9, 2024

@AnnLIU15 This would have be be repeated on a theme-by-theme basis which is not great. I think the only real solution would be to refactor the code so that logic.typ:polylux-slide implements page rather than pagebreak. That way, page header options can be manipulated directly and will hopefully futureproof polylux against any changes.

@andreasKroepelin Can you explain the advantages of using pagebreak rather than just making a list of new pages and joining them to create subslides?

Or, alternatively, put in a feature request in Typst to add some more options in page break. Thoughts?

@andreasKroepelin
Copy link
Owner

I don't think there was a reason to use pagebreak rather than multiple pages 🤔 We could try using the latter, I guess...

@TakodaS
Copy link
Author

TakodaS commented May 9, 2024

I have tried implementing this, but ran into the problem that I need to replicate the weak: true argument of pagebreak using page. By inserting a weak pagebreak, i think typst runs over the code again and removes any blank slides that are generated by polylux. Without this, page(body) will generate a load of blank slides.

@andreasKroepelin
Copy link
Owner

Ah yeah that's probably the reason why I used pagebreak then.

@tapyu
Copy link

tapyu commented May 25, 2024

It is indeed something that cannot be solved nicely by Polylux without Typst offering some "state freezing".

Is there any prospective about it?

@Narcha
Copy link

Narcha commented May 30, 2024

We can of course discuss whether it makes sense to just always start the footnote counter from 1 on every slide...

I'd be very much in favor of this, at least as a temporary workaround. Currently, I have to add #counter(footnote).update(0) to the top of every slide that uses footnotes and subslides.

@tapyu
Copy link

tapyu commented May 30, 2024

Is there an opened issue in Typst addressing this topic? If no, it should be opened.

@Narcha
Copy link

Narcha commented May 30, 2024

Is there an opened issue in Typst addressing this topic? If no, it should be opened.

#67
typst/typst#1841

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

5 participants