{"route":"/en-US-v0.14.1/reference/model/outline/","title":"Outline","description":"Documentation for the `outline` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"alternative-outlines","name":"Alternative outlines","children":[]},{"id":"styling-the-outline","name":"Styling the outline","children":[{"id":"entry-spacing","name":"Entry Spacing","children":[]},{"id":"building-an-entry","name":"Building An Entry","children":[]}]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-title","name":"title","children":[]},{"id":"parameters-target","name":"target","children":[]},{"id":"parameters-depth","name":"depth","children":[]},{"id":"parameters-indent","name":"indent","children":[]}]},{"id":"definitions","name":"Definitions","children":[{"id":"definitions-entry","name":"Outline Entry","children":[{"id":"definitions-entry-level","name":"level","children":[]},{"id":"definitions-entry-element","name":"element","children":[]},{"id":"definitions-entry-fill","name":"fill","children":[]},{"id":"definitions-entry-definitions","name":"Definitions","children":[{"id":"definitions-entry-definitions-indented","name":"Indented","children":[{"id":"definitions-entry-definitions-indented-prefix","name":"prefix","children":[]},{"id":"definitions-entry-definitions-indented-inner","name":"inner","children":[]},{"id":"definitions-entry-definitions-indented-gap","name":"gap","children":[]}]},{"id":"definitions-entry-definitions-prefix","name":"Prefix","children":[]},{"id":"definitions-entry-definitions-inner","name":"Inner","children":[]},{"id":"definitions-entry-definitions-body","name":"Body","children":[]},{"id":"definitions-entry-definitions-page","name":"Page","children":[]}]}]}]}],"body":{"kind":"func","content":{"path":[],"name":"outline","title":"Outline","keywords":["Table of Contents","toc"],"oneliner":"A table of contents, figures, or other elements.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>A table of contents, figures, or other elements.</p>\n<p>This function generates a list of all occurrences of an element in the\ndocument, up to a given <a href=\"/en-US-v0.14.1/reference/model/outline/#parameters-depth\"><code>depth</code></a>. The element's numbering\nand page number will be displayed in the outline alongside its title or\ncaption.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">heading</span><span class=\"typ-punct\">(</span>numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;1.&quot;</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= Introduction</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">5</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= Methods</span>\n<span class=\"typ-heading\">== Setup</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">10</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/2f8dbcfcc2a5c0869ffd07d1406ee6b0.png\" alt=\"Preview\"></div></div>\n<h2 id=\"alternative-outlines\">Alternative outlines</h2>\n<p>In its default configuration, this function generates a table of contents.\nBy setting the <code>target</code> parameter, the outline can be used to generate a\nlist of other kinds of elements than headings.</p>\n<p>In the example below, we list all figures containing images by setting\n<code>target</code> to <code>figure<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>kind<span class=\"typ-punct\">:</span> image<span class=\"typ-punct\">)</span></code>. Just the same, we could have set\nit to <code>figure<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>kind<span class=\"typ-punct\">:</span> table<span class=\"typ-punct\">)</span></code> to generate a list of tables.</p>\n<p>We could also set it to just <code>figure</code>, without using a <a href=\"/en-US-v0.14.1/reference/foundations/function/#definitions-where\"><code>where</code></a>\nselector, but then the list would contain <em>all</em> figures, be it ones\ncontaining images, tables, or other material.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span>\n  title<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">[</span>List of Figures<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n  target<span class=\"typ-punct\">:</span> figure<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>kind<span class=\"typ-punct\">:</span> image<span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">figure</span><span class=\"typ-punct\">(</span>\n  <span class=\"typ-func\">image</span><span class=\"typ-punct\">(</span><span class=\"typ-str\">&quot;tiger.jpg&quot;</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  caption<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">[</span>A nice figure!<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/2b41608abfcce886ce9e5c454e9468c8.png\" alt=\"Preview\"></div></div>\n<h2 id=\"styling-the-outline\">Styling the outline</h2>\n<p>At the most basic level, you can style the outline by setting properties on\nit and its entries. This way, you can customize the outline's\n<a href=\"/en-US-v0.14.1/reference/model/outline/#parameters-title\">title</a>, how outline entries are\n<a href=\"/en-US-v0.14.1/reference/model/outline/#parameters-indent\">indented</a>, and how the space between an entry's text and\nits page number should be <a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry-fill\">filled</a>.</p>\n<p>Richer customization is possible through configuration of the outline's\n<a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry\">entries</a>. The outline generates one entry for each outlined\nelement.</p>\n<h3 id=\"entry-spacing\">Spacing the entries</h3>\n<p>Outline entries are <a href=\"/en-US-v0.14.1/reference/layout/block/\">blocks</a>, so you can adjust the spacing between\nthem with normal block-spacing rules:</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> outline<span class=\"typ-punct\">.</span>entry<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>\n  level<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1</span>\n<span class=\"typ-punct\">)</span><span class=\"typ-punct\">:</span> <span class=\"typ-key\">set</span> <span class=\"typ-func\">block</span><span class=\"typ-punct\">(</span>above<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1.2em</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= About ACME Corp.</span>\n<span class=\"typ-heading\">== History</span>\n<span class=\"typ-heading\">=== Origins</span>\n<span class=\"typ-heading\">= Products</span>\n<span class=\"typ-heading\">== ACME Tools</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/e05b998d9a6ae5807b6352756f823b6c.png\" alt=\"Preview\"></div></div>\n<h3 id=\"building-an-entry\">Building an outline entry from its parts</h3>\n<p>For full control, you can also write a transformational show rule on\n<code>outline.entry</code>. However, the logic for properly formatting and indenting\noutline entries is quite complex and the outline entry itself only contains\ntwo fields: The level and the outlined element.</p>\n<p>For this reason, various helper functions are provided. You can mix and\nmatch these to compose an entry from just the parts you like.</p>\n<p>The default show rule for an outline entry looks like this<sup class=\"footnote-reference\"><a href=\"#1\">1</a></sup>:</p>\n<pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> outline<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-func\">link</span><span class=\"typ-punct\">(</span>\n  it<span class=\"typ-punct\">.</span>element<span class=\"typ-punct\">.</span><span class=\"typ-func\">location</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  it<span class=\"typ-punct\">.</span><span class=\"typ-func\">indented</span><span class=\"typ-punct\">(</span>it<span class=\"typ-punct\">.</span><span class=\"typ-func\">prefix</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span> it<span class=\"typ-punct\">.</span><span class=\"typ-func\">inner</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n</code></pre>\n<ul>\n<li>\n<p>The <a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry-definitions-indented\"><code>indented</code></a> function takes an optional\nprefix and inner content and automatically applies the proper indentation\nto it, such that different entries align nicely and long headings wrap\nproperly.</p>\n</li>\n<li>\n<p>The <a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry-definitions-prefix\"><code>prefix</code></a> function formats the element's\nnumbering (if any). It also appends a supplement for certain elements.</p>\n</li>\n<li>\n<p>The <a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry-definitions-inner\"><code>inner</code></a> function combines the element's\n<a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry-definitions-body\"><code>body</code></a>, the filler, and the\n<a href=\"/en-US-v0.14.1/reference/model/outline/#definitions-entry-definitions-page\"><code>page</code> number</a>.</p>\n</li>\n</ul>\n<p>You can use these individual functions to format the outline entry in\ndifferent ways. Let's say, you'd like to fully remove the filler and page\nnumbers. To achieve this, you could write a show rule like this:</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> outline<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-func\">link</span><span class=\"typ-punct\">(</span>\n  it<span class=\"typ-punct\">.</span>element<span class=\"typ-punct\">.</span><span class=\"typ-func\">location</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-comment\">// Keep just the body, dropping</span>\n  <span class=\"typ-comment\">// the fill and the page.</span>\n  it<span class=\"typ-punct\">.</span><span class=\"typ-func\">indented</span><span class=\"typ-punct\">(</span>it<span class=\"typ-punct\">.</span><span class=\"typ-func\">prefix</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span> it<span class=\"typ-punct\">.</span><span class=\"typ-func\">body</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= About ACME Corp.</span>\n<span class=\"typ-heading\">== History</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/1f3ff9aa7aff1ec866e0bc1e9ba7f289.png\" alt=\"Preview\"></div></div>\n<div class=\"footnote-definition\" id=\"1\"><sup class=\"footnote-definition-label\">1</sup>\n<p>The outline of equations is the exception to this rule as it does not\nhave a body and thus does not use indented layout.</p>\n</div>"}],"self":false,"params":[{"name":"title","details":[{"kind":"html","content":"<p>The title of the outline.</p>\n<ul>\n<li>When set to <code><span class=\"typ-key\">auto</span></code>, an appropriate title for the\n<a href=\"/en-US-v0.14.1/reference/text/text/#parameters-lang\">text language</a> will be used.</li>\n<li>When set to <code><span class=\"typ-key\">none</span></code>, the outline will not have a title.</li>\n<li>A custom title can be set by passing content.</li>\n</ul>\n<p>The outline's heading will not be numbered by default, but you can\nforce it to be with a show-set rule:\n<code><span class=\"typ-key\">show</span> <span class=\"typ-func\">outline</span><span class=\"typ-punct\">:</span> <span class=\"typ-key\">set</span> <span class=\"typ-func\">heading</span><span class=\"typ-punct\">(</span>numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;1.&quot;</span><span class=\"typ-punct\">)</span></code></p>"}],"types":["none","auto","content"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"target","details":[{"kind":"html","content":"<p>The type of element to include in the outline.</p>\n<p>To list figures containing a specific kind of element, like an image or\na table, you can specify the desired kind in a <a href=\"/en-US-v0.14.1/reference/foundations/function/#definitions-where\"><code>where</code></a>\nselector. See the section on <a href=\"/en-US-v0.14.1/reference/model/outline/#alternative-outlines\">alternative outlines</a>\nfor more details.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span>\n  title<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">[</span>List of Tables<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n  target<span class=\"typ-punct\">:</span> figure<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>kind<span class=\"typ-punct\">:</span> table<span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">figure</span><span class=\"typ-punct\">(</span>\n  <span class=\"typ-func\">table</span><span class=\"typ-punct\">(</span>\n    columns<span class=\"typ-punct\">:</span> <span class=\"typ-num\">4</span><span class=\"typ-punct\">,</span>\n    <span class=\"typ-punct\">[</span>t<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> <span class=\"typ-punct\">[</span>1<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> <span class=\"typ-punct\">[</span>2<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> <span class=\"typ-punct\">[</span>3<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n    <span class=\"typ-punct\">[</span>y<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> <span class=\"typ-punct\">[</span>0.3<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> <span class=\"typ-punct\">[</span>0.7<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> <span class=\"typ-punct\">[</span>0.5<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  caption<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">[</span>Experiment results<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/f680ff60eff769a37ce5c022c5e04fda.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["label","selector","location","function"],"strings":[],"default":"<code>heading</code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"depth","details":[{"kind":"html","content":"<p>The maximum level up to which elements are included in the outline. When\nthis argument is <code><span class=\"typ-key\">none</span></code>, all elements are included.</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\">heading</span><span class=\"typ-punct\">(</span>numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;1.&quot;</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span>depth<span class=\"typ-punct\">:</span> <span class=\"typ-num\">2</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= Yes</span>\nTop-level section.\n\n<span class=\"typ-heading\">== Still</span>\nSubsection.\n\n<span class=\"typ-heading\">=== Nope</span>\nNot included.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/7d811f81352691b1f4b246dc30a79217.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["none","int"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"indent","details":[{"kind":"html","content":"<p>How to indent the outline's entries.</p>\n<ul>\n<li>\n<p><code><span class=\"typ-key\">auto</span></code>: Indents the numbering/prefix of a nested entry with the\ntitle of its parent entry. If the entries are not numbered (e.g., via\n<a href=\"/en-US-v0.14.1/reference/model/heading/#parameters-numbering\">heading numbering</a>), this instead simply inserts\na fixed amount of <code><span class=\"typ-num\">1.2em</span></code> indent per level.</p>\n</li>\n<li>\n<p><a href=\"/en-US-v0.14.1/reference/layout/relative/\">Relative length</a>: Indents the entry by the specified\nlength per nesting level. Specifying <code><span class=\"typ-num\">2em</span></code>, for instance, would\nindent top-level headings by <code><span class=\"typ-num\">0em</span></code> (not nested), second level\nheadings by <code><span class=\"typ-num\">2em</span></code> (nested once), third-level headings by <code><span class=\"typ-num\">4em</span></code>\n(nested twice) and so on.</p>\n</li>\n<li>\n<p><a href=\"/en-US-v0.14.1/reference/foundations/function/\">Function</a>: You can further customize this setting with a\nfunction. That function receives the nesting level as a parameter\n(starting at 0 for top-level headings/elements) and should return a\n(relative) length. For example, <code>n <span class=\"typ-op\">=&gt;</span> n <span class=\"typ-op\">*</span> <span class=\"typ-num\">2em</span></code> would be equivalent\nto just specifying <code><span class=\"typ-num\">2em</span></code>.</p>\n</li>\n</ul>"},{"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\">heading</span><span class=\"typ-punct\">(</span>numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;I-I.&quot;</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span>title<span class=\"typ-punct\">:</span> <span class=\"typ-key\">none</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">line</span><span class=\"typ-punct\">(</span>length<span class=\"typ-punct\">:</span> <span class=\"typ-num\">100%</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span>indent<span class=\"typ-punct\">:</span> <span class=\"typ-num\">3em</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= Software engineering technologies</span>\n<span class=\"typ-heading\">== Requirements</span>\n<span class=\"typ-heading\">== Tools and technologies</span>\n<span class=\"typ-heading\">=== Code editors</span>\n<span class=\"typ-heading\">== Analyzing alternatives</span>\n<span class=\"typ-heading\">= Designing software components</span>\n<span class=\"typ-heading\">= Testing and integration</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/a83e9e2a7da65576576b7b22388124c5.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["auto","relative","function"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[{"path":["outline"],"name":"entry","title":"Outline Entry","keywords":[],"oneliner":"Represents an entry line in an outline.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Represents an entry line in an outline.</p>\n<p>With show-set and show rules on outline entries, you can richly customize\nthe outline's appearance. See the\n<a href=\"/en-US-v0.14.1/reference/model/outline/#styling-the-outline\">section on styling the outline</a> for details.</p>"}],"self":false,"params":[{"name":"level","details":[{"kind":"html","content":"<p>The nesting level of this outline entry. Starts at <code><span class=\"typ-num\">1</span></code> for top-level\nentries.</p>"}],"types":["int"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"element","details":[{"kind":"html","content":"<p>The element this entry refers to. Its location will be available\nthrough the <a href=\"/en-US-v0.14.1/reference/foundations/content/#definitions-location\"><code>location</code></a> method on the content\nand can be <a href=\"/en-US-v0.14.1/reference/model/link/\">linked</a> to.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"fill","details":[{"kind":"html","content":"<p>Content to fill the space between the title and the page number. Can be\nset to <code><span class=\"typ-key\">none</span></code> to disable filling.</p>\n<p>The <code>fill</code> will be placed into a fractionally sized box that spans the\nspace between the entry's body and the page number. When using show\nrules to override outline entries, it is thus recommended to wrap the\nfill in a <a href=\"/en-US-v0.14.1/reference/layout/box/\" title=\"`box`\"><code>box</code></a> with fractional width, i.e.\n<code><span class=\"typ-func\">box</span><span class=\"typ-punct\">(</span>width<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1fr</span><span class=\"typ-punct\">,</span> it<span class=\"typ-punct\">.</span>fill<span class=\"typ-punct\">)</span></code>.</p>\n<p>When using <a href=\"/en-US-v0.14.1/reference/layout/repeat/\" title=\"`repeat`\"><code>repeat</code></a>, the <a href=\"/en-US-v0.14.1/reference/layout/repeat/#parameters-gap\"><code>gap</code></a> property can be useful\nto tweak the visual weight of the fill.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> outline<span class=\"typ-punct\">.</span><span class=\"typ-func\">entry</span><span class=\"typ-punct\">(</span>fill<span class=\"typ-punct\">:</span> <span class=\"typ-func\">line</span><span class=\"typ-punct\">(</span>length<span class=\"typ-punct\">:</span> <span class=\"typ-num\">100%</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">outline</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= A New Beginning</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/ef524710c756d05f113284640dc3f53b.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["none","content"],"strings":[],"default":"<code><span class=\"typ-func\">repeat</span><span class=\"typ-punct\">(</span>body<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">[</span>.<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span> gap<span class=\"typ-punct\">:</span> <span class=\"typ-num\">0.15em</span><span class=\"typ-punct\">)</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[{"path":["entry"],"name":"indented","title":"Indented","keywords":[],"oneliner":"A helper function for producing an indented entry layout: Lays out a prefix and the rest of the entry in an indent-aware way.","element":false,"contextual":true,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>A helper function for producing an indented entry layout: Lays out a\nprefix and the rest of the entry in an indent-aware way.</p>\n<p>If the parent outline's <a href=\"/en-US-v0.14.1/reference/model/outline/#parameters-indent\"><code>indent</code></a> is <code><span class=\"typ-key\">auto</span></code>, the\ninner content of all entries at level <code>N</code> is aligned with the prefix of\nall entries at level <code>N + 1</code>, leaving at least <code>gap</code> space between the\nprefix and inner parts. Furthermore, the <code>inner</code> contents of all entries\nat the same level are aligned.</p>\n<p>If the outline's indent is a fixed value or a function, the prefixes are\nindented, but the inner contents are simply offset from the prefix by\nthe specified <code>gap</code>, rather than aligning outline-wide. For a visual\nexplanation, see <a href=\"/en-US-v0.14.1/reference/model/outline/#parameters-indent\" title=\"`outline.indent`\"><code>outline.indent</code></a>.</p>"}],"self":true,"params":[{"name":"prefix","details":[{"kind":"html","content":"<p>The <code>prefix</code> is aligned with the <code>inner</code> content of entries that\nhave level one less.</p>\n<p>In the default show rule, this is just <code>it.prefix()</code>, but it can be\nfreely customized.</p>"}],"types":["none","content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"inner","details":[{"kind":"html","content":"<p>The formatted inner content of the entry.</p>\n<p>In the default show rule, this is just <code>it.inner()</code>, but it can be\nfreely customized.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"gap","details":[{"kind":"html","content":"<p>The gap between the prefix and the inner content.</p>"}],"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">0.5em</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["entry"],"name":"prefix","title":"Prefix","keywords":[],"oneliner":"Formats the element's numbering (if any).","element":false,"contextual":true,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Formats the element's numbering (if any).</p>\n<p>This also appends the element's supplement in case of figures or\nequations. For instance, it would output <code>1.1</code> for a heading, but\n<code>Figure 1</code> for a figure, as is usual for outlines.</p>"}],"self":true,"params":[],"returns":["none","content"],"scope":[]},{"path":["entry"],"name":"inner","title":"Inner","keywords":[],"oneliner":"Creates the default inner content of the entry.","element":false,"contextual":true,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Creates the default inner content of the entry.</p>\n<p>This includes the body, the fill, and page number.</p>"}],"self":true,"params":[],"returns":["content"],"scope":[]},{"path":["entry"],"name":"body","title":"Body","keywords":[],"oneliner":"The content which is displayed in place of the referred element at its entry in the outline.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>The content which is displayed in place of the referred element at its\nentry in the outline. For a heading, this is its\n<a href=\"/en-US-v0.14.1/reference/model/heading/#parameters-body\"><code>body</code></a>; for a figure a caption and for equations, it is\nempty.</p>"}],"self":true,"params":[],"returns":["content"],"scope":[]},{"path":["entry"],"name":"page","title":"Page","keywords":[],"oneliner":"The page number of this entry's element, formatted with the numbering set for the referenced page.","element":false,"contextual":true,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>The page number of this entry's element, formatted with the numbering\nset for the referenced page.</p>"}],"self":true,"params":[],"returns":["content"],"scope":[]}]}]}}}