{"route":"/en-US-v0.14.1/reference/math/class/","title":"Class","description":"Documentation for the `class` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-class","name":"class","children":[]},{"id":"parameters-body","name":"body","children":[]}]}],"body":{"kind":"func","content":{"path":["math"],"name":"class","title":"Class","keywords":[],"oneliner":"Forced use of a certain math class.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Forced use of a certain math class.</p>\n<p>This is useful to treat certain symbols as if they were of a different\nclass, e.g. to make a symbol behave like a relation. The class of a symbol\ndefines the way it is laid out, including spacing around it, and how its\nscripts are attached by default. Note that the latter can always be\noverridden using <a href=\"/en-US-v0.14.1/reference/math/attach/#functions-limits\"><code>limits</code></a> and <a href=\"/en-US-v0.14.1/reference/math/attach/#functions-scripts\"><code>scripts</code></a>.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">let</span> loves <span class=\"typ-op\">=</span> math<span class=\"typ-punct\">.</span><span class=\"typ-func\">class</span><span class=\"typ-punct\">(</span>\n  <span class=\"typ-str\">&quot;relation&quot;</span><span class=\"typ-punct\">,</span>\n  sym<span class=\"typ-punct\">.</span>suit<span class=\"typ-punct\">.</span>heart<span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-math-delim\">$</span>x <span class=\"typ-pol\">loves</span> y <span class=\"typ-pol\">and</span> y <span class=\"typ-pol\">loves</span> 5<span class=\"typ-math-delim\">$</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/e3ed6eac7ab33197c87fb7cb4f0ff530.png\" alt=\"Preview\"></div></div>"}],"self":false,"params":[{"name":"class","details":[{"kind":"html","content":"<p>The class to apply to the content.</p>"}],"types":["str"],"strings":[{"string":"normal","details":"<p>The default class for non-special things.</p>"},{"string":"punctuation","details":"<p>Punctuation, e.g. a comma.</p>"},{"string":"opening","details":"<p>An opening delimiter, e.g. <code>(</code>.</p>"},{"string":"closing","details":"<p>A closing delimiter, e.g. <code>)</code>.</p>"},{"string":"fence","details":"<p>A delimiter that is the same on both sides, e.g. <code>|</code>.</p>"},{"string":"large","details":"<p>A large operator like <code>sum</code>.</p>"},{"string":"relation","details":"<p>A relation like <code>=</code> or <code>prec</code>.</p>"},{"string":"unary","details":"<p>A unary operator like <code>not</code>.</p>"},{"string":"binary","details":"<p>A binary operator like <code>times</code>.</p>"},{"string":"vary","details":"<p>An operator that can be both unary or binary like <code>+</code>.</p>"}],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"body","details":[{"kind":"html","content":"<p>The content to which the class is applied.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}