{"route":"/en-US-v0.14.1/reference/text/smallcaps/","title":"Small Capitals","description":"Documentation for the `smallcaps` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"smallcaps-fonts","name":"Smallcaps fonts","children":[]},{"id":"smallcaps-headings","name":"Smallcaps headings","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-all","name":"all","children":[]},{"id":"parameters-body","name":"body","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"smallcaps","title":"Small Capitals","keywords":[],"oneliner":"Displays text in small capitals.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Displays text in small capitals.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code>Hello <span class=\"typ-escape\">\\</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">smallcaps</span><span class=\"typ-punct\">[</span>Hello<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/d860d23f8025b71987581bf155766bc1.png\" alt=\"Preview\"></div></div>\n<h2 id=\"smallcaps-fonts\">Smallcaps fonts</h2>\n<p>By default, this uses the <code>smcp</code> and <code>c2sc</code> OpenType features on the font.\nNot all fonts support these features. Sometimes, smallcaps are part of a\ndedicated font. This is, for example, the case for the <em>Latin Modern</em> family\nof fonts. In those cases, you can use a show-set rule to customize the\nappearance of the text in smallcaps:</p>\n<pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> <span class=\"typ-func\">smallcaps</span><span class=\"typ-punct\">:</span> <span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>font<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;Latin Modern Roman Caps&quot;</span><span class=\"typ-punct\">)</span>\n</code></pre>\n<p>In the future, this function will support synthesizing smallcaps from normal\nletters, but this is not yet implemented.</p>\n<h2 id=\"smallcaps-headings\">Smallcaps headings</h2>\n<p>You can use a <a href=\"/en-US-v0.14.1/reference/styling/#show-rules\">show rule</a> to apply smallcaps\nformatting to all your headings. In the example below, we also center-align\nour headings and disable the standard bold font.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">par</span><span class=\"typ-punct\">(</span>justify<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span>\n<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.&quot;</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> <span class=\"typ-func\">heading</span><span class=\"typ-punct\">:</span> <span class=\"typ-func\">smallcaps</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> <span class=\"typ-func\">heading</span><span class=\"typ-punct\">:</span> <span class=\"typ-key\">set</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> <span class=\"typ-func\">heading</span><span class=\"typ-punct\">:</span> <span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>\n  weight<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;regular&quot;</span>\n<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\">40</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/7f47b81d5cd6ecd285a78baa93a2efaa.png\" alt=\"Preview\"></div></div>"}],"self":false,"params":[{"name":"all","details":[{"kind":"html","content":"<p>Whether to turn uppercase letters into small capitals as well.</p>\n<p>Unless overridden by a show rule, this enables the <code>c2sc</code> OpenType\nfeature.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">smallcaps</span><span class=\"typ-punct\">(</span>all<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>UNICEF<span class=\"typ-punct\">]</span> is an\nagency of <span class=\"typ-func\">#</span><span class=\"typ-func\">smallcaps</span><span class=\"typ-punct\">(</span>all<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>UN<span class=\"typ-punct\">]</span>.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/f26ae448d07a9e76c623cf95561882ad.png\" alt=\"Preview\"></div></div>","title":null}}],"types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">false</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"body","details":[{"kind":"html","content":"<p>The content to display in small capitals.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}