提示:本教程存在过时问题,更详细教程请阅读 小蓝书Typst 中文社区导航 FAQ
注意:该中文文档为社区驱动的非官网文档,可能存在错译、漏译或过时等问题,请以官网文档 Documentation 为准,如发现错漏,也欢迎 您的贡献镜像)。Typst 非官方中文交流 QQ 群:793548390
Warning: the Chinese document is a community-driven non-official document, there may be mistranslation, omission or outdated problems, please refer to the official website documentation.
Typst 中文文档

footnote 元素
元素函数可以通过 set 和 show 规则进行样式自定义。

A footnote.

Includes additional remarks and references on the same page with footnotes. A footnote will insert a superscript number that links to the note at the bottom of the page. Notes are numbered sequentially throughout your document and can break across multiple pages.

To customize the appearance of the entry in the footnote listing, see footnote.entry. The footnote itself is realized as a normal superscript, so you can use a set rule on the super function to customize it.

Example

Check the docs for more details.
#footnote[https://typst.app/docs]
Preview

The footnote automatically attaches itself to the preceding word, even if there is a space before it in the markup. To force space, you can use the string #" " or explicit horizontal spacing.

By giving a label to a footnote, you can have multiple references to it.

You can edit Typst documents online.
#footnote[https://typst.app/app] <fn>
Checkout Typst's website. @fn
And the online app. #footnote(<fn>)
Preview

Note: Set and show rules in the scope where footnote is called may not apply to the footnote's content. See here for more information.

参数
参数是函数的输入,它们在函数名称后面的括号中传入。

numbering
str function
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

How to number footnotes.

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.

默认:"1"

查看示例
#set footnote(numbering: "*")

Footnotes:
#footnote[Star],
#footnote[Dagger]
Preview

body
label content
必需参数位置参数
位置参数按顺序传入,不带名称。

The content to put into the footnote. Can also be the label of another footnote this one should point to.

定义
函数和类型可以有与其关联的定义 (成员或方法)。可以使用 "." 操作符来访问调用它们。

entry

An entry in a footnote list.

This function is not intended to be called directly. Instead, it is used in set and show rules to customize footnote listings.

Note: Set and show rules for footnote.entry must be defined at the beginning of the document in order to work correctly. See here for more information.

查看示例
#show footnote.entry: set text(red)

My footnote listing
#footnote[It's down here]
has red text!
Preview

note
content
必需参数位置参数
位置参数按顺序传入,不带名称。

The footnote for this entry. It's location can be used to determine the footnote counter state.

查看示例
#show footnote.entry: it => {
  let loc = it.note.location()
  numbering(
    "1: ",
    ..counter(footnote).at(loc),
  )
  it.note.body
}

Customized #footnote[Hello]
listing #footnote[World! 🌏]
Preview

separator
content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

The separator between the document body and the footnote listing.

默认:line(length: 30%, stroke: 0.5pt)

查看示例
#set footnote.entry(
  separator: repeat[.]
)

Testing a different separator.
#footnote[
  Unconventional, but maybe
  not that bad?
]
Preview

clearance
length
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

The amount of clearance between the document body and the separator.

默认:1em

查看示例
#set footnote.entry(clearance: 3em)

Footnotes also need ...
#footnote[
  ... some space to breathe.
]
Preview

gap
length
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

The gap between footnote entries.

默认:0.5em

查看示例
#set footnote.entry(gap: 0.8em)

Footnotes:
#footnote[Spaced],
#footnote[Apart]
Preview

indent
length
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

The indent of each footnote entry.

默认:1em

查看示例
#set footnote.entry(indent: 0em)

Footnotes:
#footnote[No],
#footnote[Indent]
Preview