{"route":"/en-US-v0.14.1/reference/math/variants/","title":"Variants","description":"Documentation for the variants functions.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"functions","name":"Functions","children":[{"id":"functions-serif","name":"Serif","children":[{"id":"functions-serif-body","name":"body","children":[]}]},{"id":"functions-sans","name":"Sans Serif","children":[{"id":"functions-sans-body","name":"body","children":[]}]},{"id":"functions-frak","name":"Fraktur","children":[{"id":"functions-frak-body","name":"body","children":[]}]},{"id":"functions-mono","name":"Monospace","children":[{"id":"functions-mono-body","name":"body","children":[]}]},{"id":"functions-bb","name":"Blackboard Bold","children":[{"id":"functions-bb-body","name":"body","children":[]}]},{"id":"functions-cal","name":"Calligraphic","children":[{"id":"functions-cal-body","name":"body","children":[]}]},{"id":"functions-scr","name":"Script Style","children":[{"id":"functions-scr-body","name":"body","children":[]}]}]}],"body":{"kind":"group","content":{"name":"variants","title":"Variants","details":"<p>Alternate typefaces within formulas.</p>\n<p>These functions are distinct from the <a href=\"/en-US-v0.14.1/reference/text/text/\" title=\"`text`\"><code>text</code></a> function because math fonts\ncontain multiple variants of each letter.</p>","functions":[{"path":["math"],"name":"serif","title":"Serif","keywords":["mathrm"],"oneliner":"Serif (roman) font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Serif (roman) font style in math.</p>\n<p>This is already the default.</p>"}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["math"],"name":"sans","title":"Sans Serif","keywords":["mathsf"],"oneliner":"Sans-serif font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Sans-serif font style in math.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-math-delim\">$</span> <span class=\"typ-func\">sans</span><span class=\"typ-punct\">(</span>A B C<span class=\"typ-punct\">)</span> <span class=\"typ-math-delim\">$</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/407ec97977e50acfb00a33fc9e4056ad.png\" alt=\"Preview\"></div></div>","title":null}}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["math"],"name":"frak","title":"Fraktur","keywords":["mathfrak"],"oneliner":"Fraktur font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Fraktur font style in math.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-math-delim\">$</span> <span class=\"typ-func\">frak</span><span class=\"typ-punct\">(</span>P<span class=\"typ-punct\">)</span> <span class=\"typ-math-delim\">$</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/7bc5e4240760597643a9b5acf7819e79.png\" alt=\"Preview\"></div></div>","title":null}}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["math"],"name":"mono","title":"Monospace","keywords":["mathtt"],"oneliner":"Monospace font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Monospace font style in math.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-math-delim\">$</span> <span class=\"typ-func\">mono</span><span class=\"typ-punct\">(</span>x + y = z<span class=\"typ-punct\">)</span> <span class=\"typ-math-delim\">$</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/55d904edd40fbf32537bb0710d91dc9f.png\" alt=\"Preview\"></div></div>","title":null}}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["math"],"name":"bb","title":"Blackboard Bold","keywords":["mathbb"],"oneliner":"Blackboard bold (double-struck) font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Blackboard bold (double-struck) font style in math.</p>\n<p>For uppercase latin letters, blackboard bold is additionally available\nthrough <a href=\"/en-US-v0.14.1/reference/symbols/sym/\">symbols</a> of the form <code>NN</code> and <code>RR</code>.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-math-delim\">$</span> <span class=\"typ-func\">bb</span><span class=\"typ-punct\">(</span>b<span class=\"typ-punct\">)</span> <span class=\"typ-math-delim\">$</span>\n<span class=\"typ-math-delim\">$</span> <span class=\"typ-func\">bb</span><span class=\"typ-punct\">(</span>N<span class=\"typ-punct\">)</span> = <span class=\"typ-pol\">NN</span> <span class=\"typ-math-delim\">$</span>\n<span class=\"typ-math-delim\">$</span> f: <span class=\"typ-pol\">NN</span> <span class=\"typ-escape\">-&gt;</span> <span class=\"typ-pol\">RR</span> <span class=\"typ-math-delim\">$</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/eeab38b02d476b4bcefc48bf7678c7b9.png\" alt=\"Preview\"></div></div>","title":null}}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["math"],"name":"cal","title":"Calligraphic","keywords":["mathcal","chancery"],"oneliner":"Calligraphic (chancery) font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Calligraphic (chancery) font style in math.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code>Let <span class=\"typ-math-delim\">$</span><span class=\"typ-func\">cal</span><span class=\"typ-punct\">(</span>P<span class=\"typ-punct\">)</span><span class=\"typ-math-delim\">$</span> be the set of <span class=\"typ-escape\">...</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/92ac6bdff36119c06add06619087c88f.png\" alt=\"Preview\"></div></div>","title":null}},{"kind":"html","content":"<p>This is the default calligraphic/script style for most math fonts. See\n<a href=\"/en-US-v0.14.1/reference/math/variants/#functions-scr\"><code>scr</code></a> for more on how to get the other style (roundhand).</p>"}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]},{"path":["math"],"name":"scr","title":"Script Style","keywords":["mathscr","roundhand"],"oneliner":"Script (roundhand) font style in math.","element":false,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Script (roundhand) font style in math.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-math-delim\">$</span><span class=\"typ-func\">scr</span><span class=\"typ-punct\">(</span>L<span class=\"typ-punct\">)</span><span class=\"typ-math-delim\">$</span> is not the set of linear\nmaps <span class=\"typ-math-delim\">$</span><span class=\"typ-func\">cal</span><span class=\"typ-punct\">(</span>L<span class=\"typ-punct\">)</span><span class=\"typ-math-delim\">$</span>.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/ff0806462518fc754f49fbae8043ab79.png\" alt=\"Preview\"></div></div>","title":null}},{"kind":"html","content":"<p>There are two ways that fonts can support differentiating <code>cal</code> and <code>scr</code>.\nThe first is using Unicode variation sequences. This works out of the box\nin Typst, however only a few math fonts currently support this.</p>\n<p>The other way is using <a href=\"/en-US-v0.14.1/reference/text/text/#parameters-features\">font features</a>. For example, the\nroundhand style might be available in a font through the\n<em><a href=\"/en-US-v0.14.1/reference/text/text/#parameters-stylistic-set\">stylistic set</a> 1</em> (<code>ss01</code>) feature. To use it in\nTypst, you could then define your own version of <code>scr</code> like in the example\nbelow.</p>"},{"kind":"example","content":{"body":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">let</span> <span class=\"typ-func\">scr</span><span class=\"typ-punct\">(</span>it<span class=\"typ-punct\">)</span> <span class=\"typ-op\">=</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>\n  stylistic-set<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-math-delim\">$</span><span class=\"typ-func\">cal</span><span class=\"typ-punct\">(</span><span class=\"typ-pol\">it</span><span class=\"typ-punct\">)</span><span class=\"typ-math-delim\">$</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\nWe establish <span class=\"typ-math-delim\">$</span><span class=\"typ-func\">cal</span><span class=\"typ-punct\">(</span>P<span class=\"typ-punct\">)</span> <span class=\"typ-escape\">!=</span> <span class=\"typ-func\">scr</span><span class=\"typ-punct\">(</span>P<span class=\"typ-punct\">)</span><span class=\"typ-math-delim\">$</span>.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/ef22b570a55967020c8bd88b99f68c16.png\" alt=\"Preview\"></div></div>","title":"Recreation using stylistic set 1"}}],"self":false,"params":[{"name":"body","details":[{"kind":"html","content":"<p>The content to style.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}],"global_attributes":[]}}}