Skip to content

如何实现框内脚注?

如何实现框内脚注?

typst
#let notes = state("notes", ())
#let content-box(body) = block(
  stroke: 1pt + gray,
  inset: 8pt,
  {
    body
    parbreak()
    line()
    set text(0.8em)
    context for (i, e) in notes.get().enumerate(start: 1) [
      #super[#i] #e
      #parbreak()
    ]
    notes.update(())
  },
)
#let content-box-note(text) = {
  notes.update(s => {
    s.push(text)
    s
  })
  super(context notes.get().len())
}

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

#content-box[
  #lorem(5)#content-box-note[hello world]
  #lorem(5)#content-box-note[hello world]
  #lorem(5)
]
Typst compiled image
What do you think?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.5.1

基于 MIT 许可发布