How to display footnotes at the end of a list rather than the page?

Hi all, new Typst user here, and getting on well so far. I have come across a situation where I have a list of bullet points, one of which needs footnote. I’d like that footnote to appear at the end of the list, rather than the bottom of the page, but cannot figure out how to do that. Been playing with blocks, but that hasn’t fixed the issue, and has created others instead. Is this actually possible?

James

1 Like

flaribbit once posted a solution on GitHub:


#let notes = state("notes", ())
#let content-box(body) = block(
  stroke: 1pt,
  width: 10cm,
  inset: 8pt,
  {
    body
    parbreak()
    context for (i, e) in notes.get().enumerate() {
      [#(i + 1) #e]
      parbreak()
    }
    notes.update(())
  },
)
#let content-box-note(text) = {
  notes.update(s => {
    s.push(text)
    s
  })
  context notes.get().len()
}

#content-box[
  #lorem(20)
  #content-box-note[hello world]
  #lorem(20)
]

#content-box[
  #lorem(20)
  #content-box-note[hello world]
  #lorem(20)
  #content-box-note[hello world]
]

Is this a thing? I’ve never heard of such footnotes. Which is also probably why Typst doesn’t support that, so you will have to rely on some custom function like the one @Y.D.X provided.

Thanks all. The reasoning is that the list is in a section, there a new heading soon after. If the footnote goes to the bottom on the page, rather than just under the list, then it just looks a bit odd as the new section splits it away from its location. I’ll get round it by just manually adding my own superscripts.

1 Like

I actually had to do a similar thing recently because page footnotes are not allowed, so I just added a line of text with a superscript under a table in a figure.

Also, if you found a solution post, be sure to mark it as such.

This seems to be somewhat common for tables, e.g. Wikipedia (list of Austrian governments). The footnotes follow the table and are not put at the bottom of the article.

btw @James_Hughes is there something specific preventing you from using the solution that @Y.D.X showed? If so, maybe we can refine it if we know what you need.