{"route":"/en-US-v0.13.1/reference/text/smartquote/","title":"Smartquote","description":"Documentation for the `smartquote` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"syntax","name":"Syntax","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-double","name":"double","children":[]},{"id":"parameters-enabled","name":"enabled","children":[]},{"id":"parameters-alternative","name":"alternative","children":[]},{"id":"parameters-quotes","name":"quotes","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"smartquote","title":"Smartquote","keywords":[],"oneliner":"A language-aware quote that reacts to its context.","element":true,"contextual":false,"deprecation":null,"details":"<p>A language-aware quote that reacts to its context.</p>\n<p>Automatically turns into an appropriate opening or closing quote based on\nthe active <a href=\"/en-US-v0.13.1/reference/text/text/#parameters-lang\">text language</a>.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code>&quot;This is in quotes.&quot;\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>lang<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;de&quot;</span><span class=\"typ-punct\">)</span>\n&quot;Das ist in Anführungszeichen.&quot;\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>lang<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;fr&quot;</span><span class=\"typ-punct\">)</span>\n&quot;C&#39;est entre guillemets.&quot;\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/761ad48d2c02ddc1fc5485afa655abcf.png\" alt=\"Preview\"></div></div>\n<h2 id=\"syntax\">Syntax</h2>\n<p>This function also has dedicated syntax: The normal quote characters\n(<code>'</code> and <code>&quot;</code>). Typst automatically makes your quotes smart.</p>","example":null,"self":false,"params":[{"name":"double","details":"<p>Whether this should be a double quote.</p>","example":null,"types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">true</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"enabled","details":"<p>Whether smart quotes are enabled.</p>\n<p>To disable smartness for a single quote, you can also escape it with a\nbackslash.</p>","example":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">smartquote</span><span class=\"typ-punct\">(</span>enabled<span class=\"typ-punct\">:</span> <span class=\"typ-key\">false</span><span class=\"typ-punct\">)</span>\n\nThese are &quot;dumb&quot; quotes.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/ca479e14f027381340c262d7483c53a8.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":"alternative","details":"<p>Whether to use alternative quotes.</p>\n<p>Does nothing for languages that don't have alternative quotes, or if\nexplicit quotes were set.</p>","example":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>lang<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;de&quot;</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">smartquote</span><span class=\"typ-punct\">(</span>alternative<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span>\n\n&quot;Das ist in anderen Anführungszeichen.&quot;\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/9724cf371363233c8525ba7e26504ca6.png\" alt=\"Preview\"></div></div>","types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">false</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"quotes","details":"<p>The quotes to use.</p>\n<ul>\n<li>When set to <code><span class=\"typ-key\">auto</span></code>, the appropriate single quotes for the\n<a href=\"/en-US-v0.13.1/reference/text/text/#parameters-lang\">text language</a> will be used. This is the default.</li>\n<li>Custom quotes can be passed as a string, array, or dictionary of either\n<ul>\n<li><a href=\"/en-US-v0.13.1/reference/foundations/str/\">string</a>: a string consisting of two characters containing the\nopening and closing double quotes (characters here refer to Unicode\ngrapheme clusters)</li>\n<li><a href=\"/en-US-v0.13.1/reference/foundations/array/\" title=\"array\">array</a>: an array containing the opening and closing double quotes</li>\n<li><a href=\"/en-US-v0.13.1/reference/foundations/dictionary/\" title=\"dictionary\">dictionary</a>: an array containing the double and single quotes, each\nspecified as either <code><span class=\"typ-key\">auto</span></code>, string, or array</li>\n</ul>\n</li>\n</ul>","example":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>lang<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;de&quot;</span><span class=\"typ-punct\">)</span>\n&#39;Das sind normale Anführungszeichen.&#39;\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">smartquote</span><span class=\"typ-punct\">(</span>quotes<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;()&quot;</span><span class=\"typ-punct\">)</span>\n&quot;Das sind eigene Anführungszeichen.&quot;\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">smartquote</span><span class=\"typ-punct\">(</span>quotes<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">(</span>single<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">(</span><span class=\"typ-str\">&quot;[[&quot;</span><span class=\"typ-punct\">,</span> <span class=\"typ-str\">&quot;]]&quot;</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>  double<span class=\"typ-punct\">:</span> <span class=\"typ-key\">auto</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span>\n&#39;Das sind eigene Anführungszeichen.&#39;\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/6d2a84fef7df6d07d316017d717d89e8.png\" alt=\"Preview\"></div></div>","types":["auto","str","array","dictionary"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[]}}}