{"route":"/en-US-v0.14.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,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<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.14.1/assets/aba9b70776d538b28fb89148a20a8833.png\" alt=\"Preview\"></div></div>"}],"self":false,"params":[{"name":"typographic","details":[{"kind":"html","content":"<p>Whether to use subscript glyphs from the font if available.</p>\n<p>Ideally, subscripts glyphs are provided by the font (using the <code>subs</code>\nOpenType feature). Otherwise, Typst is able to synthesize subscripts by\nlowering and scaling down regular glyphs.</p>\n<p>When this is set to <code><span class=\"typ-key\">false</span></code>, synthesized glyphs will be used\nregardless of whether the font provides dedicated subscript glyphs. When\n<code><span class=\"typ-key\">true</span></code>, synthesized glyphs may still be used in case the font does not\nprovide the necessary subscript glyphs.</p>"},{"kind":"example","content":{"body":"<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.14.1/assets/786b89e1ca0f1dc21ba334ef18abd42c.png\" alt=\"Preview\"></div></div>","title":null}}],"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":[{"kind":"html","content":"<p>The downward baseline shift for synthesized subscripts.</p>\n<p>This only applies to synthesized subscripts. In other words, this has no\neffect if <code>typographic</code> is <code><span class=\"typ-key\">true</span></code> and the font provides the necessary\nsubscript glyphs.</p>\n<p>If set to <code><span class=\"typ-key\">auto</span></code>, the baseline is shifted according to the metrics\nprovided by the font, with a fallback to <code><span class=\"typ-num\">0.2em</span></code> in case the font does\nnot define the necessary metrics.</p>"}],"types":["auto","length"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"size","details":[{"kind":"html","content":"<p>The font size for synthesized subscripts.</p>\n<p>This only applies to synthesized subscripts. In other words, this has no\neffect if <code>typographic</code> is <code><span class=\"typ-key\">true</span></code> and the font provides the necessary\nsubscript glyphs.</p>\n<p>If set to <code><span class=\"typ-key\">auto</span></code>, the size is scaled according to the metrics provided\nby the font, with a fallback to <code><span class=\"typ-num\">0.6em</span></code> in case the font does not\ndefine the necessary metrics.</p>"}],"types":["auto","length"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"body","details":[{"kind":"html","content":"<p>The text to display in subscript.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}