{"route":"/en-US-v0.13.1/reference/text/sub/","title":"Subscript","description":"Documentation for the `sub` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-typographic","name":"typographic","children":[]},{"id":"parameters-baseline","name":"baseline","children":[]},{"id":"parameters-size","name":"size","children":[]},{"id":"parameters-body","name":"body","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"sub","title":"Subscript","keywords":[],"oneliner":"Renders text in subscript.","element":true,"contextual":false,"deprecation":null,"details":"<p>Renders text in subscript.</p>\n<p>The text is rendered smaller and its baseline is lowered.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code>Revenue<span class=\"typ-func\">#</span><span class=\"typ-func\">sub</span><span class=\"typ-punct\">[</span>yearly<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/aba9b70776d538b28fb89148a20a8833.png\" alt=\"Preview\"></div></div>","example":null,"self":false,"params":[{"name":"typographic","details":"<p>Whether to prefer the dedicated subscript characters of the font.</p>\n<p>If this is enabled, Typst first tries to transform the text to subscript\ncodepoints. If that fails, it falls back to rendering lowered and shrunk\nnormal letters.</p>","example":"<div class=\"previewed-code\"><pre><code>N<span class=\"typ-func\">#</span><span class=\"typ-func\">sub</span><span class=\"typ-punct\">(</span>typographic<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>1<span class=\"typ-punct\">]</span>\nN<span class=\"typ-func\">#</span><span class=\"typ-func\">sub</span><span class=\"typ-punct\">(</span>typographic<span class=\"typ-punct\">:</span> <span class=\"typ-key\">false</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>1<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/786b89e1ca0f1dc21ba334ef18abd42c.png\" alt=\"Preview\"></div></div>","types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">true</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"baseline","details":"<p>The baseline shift for synthetic subscripts. Does not apply if\n<code>typographic</code> is true and the font has subscript codepoints for the\ngiven <code>body</code>.</p>","example":null,"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">0.2em</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"size","details":"<p>The font size for synthetic subscripts. Does not apply if\n<code>typographic</code> is true and the font has subscript codepoints for the\ngiven <code>body</code>.</p>","example":null,"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">0.6em</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"body","details":"<p>The text to display in subscript.</p>","example":null,"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}