{"route":"/en-US-v0.14.1/reference/model/footnote/","title":"Footnote","description":"Documentation for the `footnote` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"accessibility","name":"Accessibility","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-numbering","name":"numbering","children":[]},{"id":"parameters-body","name":"body","children":[]}]},{"id":"definitions","name":"Definitions","children":[{"id":"definitions-entry","name":"Footnote Entry","children":[{"id":"definitions-entry-note","name":"note","children":[]},{"id":"definitions-entry-separator","name":"separator","children":[]},{"id":"definitions-entry-clearance","name":"clearance","children":[]},{"id":"definitions-entry-gap","name":"gap","children":[]},{"id":"definitions-entry-indent","name":"indent","children":[]}]}]}],"body":{"kind":"func","content":{"path":[],"name":"footnote","title":"Footnote","keywords":[],"oneliner":"A footnote.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>A footnote.</p>\n<p>Includes additional remarks and references on the same page with footnotes.\nA footnote will insert a superscript number that links to the note at the\nbottom of the page. Notes are numbered sequentially throughout your document\nand can break across multiple pages.</p>\n<p>To customize the appearance of the entry in the footnote listing, see\n<a href=\"/en-US-v0.14.1/reference/model/footnote/#definitions-entry\" title=\"`footnote.entry`\"><code>footnote.entry</code></a>. The footnote itself is realized as a normal superscript,\nso you can use a set rule on the <a href=\"/en-US-v0.14.1/reference/text/super/\" title=\"`super`\"><code>super</code></a> function to customize it. You can\nalso apply a show rule to customize only the footnote marker (superscript\nnumber) in the running text.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code>Check the docs for more details.\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span><span class=\"typ-link\">https://typst.app/docs</span><span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/46ec759f820fc0e90ea67d6ce7b5b1a4.png\" alt=\"Preview\"></div></div>\n<p>The footnote automatically attaches itself to the preceding word, even if\nthere is a space before it in the markup. To force space, you can use the\nstring <code><span class=\"typ-str\">#</span><span class=\"typ-str\">&quot; &quot;</span></code> or explicit <a href=\"/en-US-v0.14.1/reference/layout/h/\">horizontal spacing</a>.</p>\n<p>By giving a label to a footnote, you can have multiple references to it.</p>\n<div class=\"previewed-code\"><pre><code>You can edit Typst documents online.\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span><span class=\"typ-link\">https://typst.app/app</span><span class=\"typ-punct\">]</span> <span class=\"typ-label\">&lt;fn&gt;</span>\nCheckout Typst&#39;s website. <span class=\"typ-ref\">@fn</span>\nAnd the online app. <span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">(</span><span class=\"typ-label\">&lt;fn&gt;</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/c440921edaf4561cc5879a27a70e3c19.png\" alt=\"Preview\"></div></div>\n<p><em>Note:</em> Set and show rules in the scope where <code>footnote</code> is called may not\napply to the footnote's content. See <a href=\"https://github.com/typst/typst/issues/1467#issuecomment-1588799440\">here</a> for more information.</p>\n<h2 id=\"accessibility\">Accessibility</h2>\n<p>Footnotes will be read by Assistive Technology (AT) immediately after the\nspot in the text where they are referenced, just like how they appear in\nmarkup.</p>"}],"self":false,"params":[{"name":"numbering","details":[{"kind":"html","content":"<p>How to number footnotes. Accepts a\n<a href=\"/en-US-v0.14.1/reference/model/numbering/\">numbering pattern or function</a> taking a single number.</p>\n<p>By default, the footnote numbering continues throughout your document.\nIf you prefer per-page footnote numbering, you can reset the footnote\n<a href=\"/en-US-v0.14.1/reference/introspection/counter/\" title=\"counter\">counter</a> in the page <a href=\"/en-US-v0.14.1/reference/layout/page/#parameters-header\">header</a>. In the future, there might\nbe a simpler way to achieve this.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">footnote</span><span class=\"typ-punct\">(</span>numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;*&quot;</span><span class=\"typ-punct\">)</span>\n\nFootnotes:\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>Star<span class=\"typ-punct\">]</span>,\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>Dagger<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/9595205e7485a18731b013c2de7d09b.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["str","function"],"strings":[],"default":"<code><span class=\"typ-str\">&quot;1&quot;</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"body","details":[{"kind":"html","content":"<p>The content to put into the footnote. Can also be the label of another\nfootnote this one should point to.</p>"}],"types":["label","content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[{"path":["footnote"],"name":"entry","title":"Footnote Entry","keywords":[],"oneliner":"An entry in a footnote list.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>An entry in a footnote list.</p>\n<p>This function is not intended to be called directly. Instead, it is used in\nset and show rules to customize footnote listings.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> footnote<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">:</span> <span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>red<span class=\"typ-punct\">)</span>\n\nMy footnote listing\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>It&#39;s down here<span class=\"typ-punct\">]</span>\nhas red text!\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/39070e2c8c085851bcd6e717c5eba257.png\" alt=\"Preview\"></div></div>","title":null}},{"kind":"html","content":"<p><em>Note:</em> Footnote entry properties must be uniform across each page run (a\npage run is a sequence of pages without an explicit pagebreak in between).\nFor this reason, set and show rules for footnote entries should be defined\nbefore any page content, typically at the very start of the document.</p>"}],"self":false,"params":[{"name":"note","details":[{"kind":"html","content":"<p>The footnote for this entry. Its location can be used to determine\nthe footnote counter state.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> footnote<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">:</span> it <span class=\"typ-op\">=&gt;</span> <span class=\"typ-punct\">{</span>\n  <span class=\"typ-key\">let</span> loc <span class=\"typ-op\">=</span> it<span class=\"typ-punct\">.</span>note<span class=\"typ-punct\">.</span><span class=\"typ-func\">location</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-func\">numbering</span><span class=\"typ-punct\">(</span>\n    <span class=\"typ-str\">&quot;1: &quot;</span><span class=\"typ-punct\">,</span>\n    <span class=\"typ-op\">..</span><span class=\"typ-func\">counter</span><span class=\"typ-punct\">(</span>footnote<span class=\"typ-punct\">)</span><span class=\"typ-punct\">.</span><span class=\"typ-func\">at</span><span class=\"typ-punct\">(</span>loc<span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-punct\">)</span>\n  it<span class=\"typ-punct\">.</span>note<span class=\"typ-punct\">.</span>body\n<span class=\"typ-punct\">}</span>\n\nCustomized <span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>Hello<span class=\"typ-punct\">]</span>\nlisting <span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>World! 🌏<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/a484d77b028ceac481e5e778e1f529ef.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"separator","details":[{"kind":"html","content":"<p>The separator between the document body and the footnote listing.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> footnote<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">(</span>\n  separator<span class=\"typ-punct\">:</span> <span class=\"typ-func\">repeat</span><span class=\"typ-punct\">[</span>.<span class=\"typ-punct\">]</span>\n<span class=\"typ-punct\">)</span>\n\nTesting a different separator.\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>\n  Unconventional, but maybe\n  not that bad?\n<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/d8165b7e239fd7abba7e37be24cd8a87.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["content"],"strings":[],"default":"<code><span class=\"typ-func\">line</span><span class=\"typ-punct\">(</span>length<span class=\"typ-punct\">:</span> <span class=\"typ-num\">30%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span><span class=\"typ-punct\">,</span> stroke<span class=\"typ-punct\">:</span> <span class=\"typ-num\">0.5pt</span><span class=\"typ-punct\">)</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"clearance","details":[{"kind":"html","content":"<p>The amount of clearance between the document body and the separator.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> footnote<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">(</span>clearance<span class=\"typ-punct\">:</span> <span class=\"typ-num\">3em</span><span class=\"typ-punct\">)</span>\n\nFootnotes also need <span class=\"typ-escape\">...</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>\n  <span class=\"typ-escape\">...</span> some space to breathe.\n<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/8c623ff98c6ccf436a5f43239994bfa9.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">1em</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"gap","details":[{"kind":"html","content":"<p>The gap between footnote entries.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> footnote<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">(</span>gap<span class=\"typ-punct\">:</span> <span class=\"typ-num\">0.8em</span><span class=\"typ-punct\">)</span>\n\nFootnotes:\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>Spaced<span class=\"typ-punct\">]</span>,\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>Apart<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/dec820ba95d4ecbfdb3ba2984410d61d.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">0.5em</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"indent","details":[{"kind":"html","content":"<p>The indent of each footnote entry.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> footnote<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">(</span>indent<span class=\"typ-punct\">:</span> <span class=\"typ-num\">0em</span><span class=\"typ-punct\">)</span>\n\nFootnotes:\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>No<span class=\"typ-punct\">]</span>,\n<span class=\"typ-func\">#</span><span class=\"typ-func\">footnote</span><span class=\"typ-punct\">[</span>Indent<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/fb3904fde8d00e917a2933d395967783.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">1em</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[]}]}}}