Info
This site is generated using the static site generator developed by the Typst Community. Please adjust the text content of this banner according to your usage requirements. At Typst GmbH's request, when publishing documentation, you must clearly indicate that it is non-official and display the version of Typst being documented. For details, refer to Issue #874 on typst/typst.
TypstDocumentEnglish
v0.dev.2025-09-12

smartquote
Element
Element
Element functions can be customized with set and show rules.

A language-aware quote that reacts to its context.

Automatically turns into an appropriate opening or closing quote based on the active text language.

Example

"This is in quotes."

#set text(lang: "de")
"Das ist in Anführungszeichen."

#set text(lang: "fr")
"C'est entre guillemets."
Preview

Syntax

This function also has dedicated syntax: The normal quote characters (' and "). Typst automatically makes your quotes smart.

Parameter
Parameter
Parameters are input values for functions. Specify them in parentheses after the function name.

double
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

Whether this should be a double quote.

Default value:

true

enabled
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

Whether smart quotes are enabled.

To disable smartness for a single quote, you can also escape it with a backslash.

Default value:

true

Show example
#set smartquote(enabled: false)

These are "dumb" quotes.
Preview

alternative
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

Whether to use alternative quotes.

Does nothing for languages that don't have alternative quotes, or if explicit quotes were set.

Default value:

false

Show example
#set text(lang: "de")
#set smartquote(alternative: true)

"Das ist in anderen Anführungszeichen."
Preview

quotes
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The quotes to use.

  • When set to auto, the appropriate single quotes for the text language will be used. This is the default.
  • Custom quotes can be passed as a string, array, or dictionary of either
    • string: a string consisting of two characters containing the opening and closing double quotes (characters here refer to Unicode grapheme clusters)
    • array: an array containing the opening and closing double quotes
    • dictionary: a dictionary containing the double and single quotes, each specified as either auto, string, or array

Default value:

auto

Show example
#set text(lang: "de")
'Das sind normale Anführungszeichen.'

#set smartquote(quotes: "()")
"Das sind eigene Anführungszeichen."

#set smartquote(quotes: (single: ("[[", "]]"),  double: auto))
'Das sind eigene Anführungszeichen.'
Preview
Open official docs

Search