Development build 586e1bd4
Typst文档简体中文版v0.15.1 + dev 586e1bd4

smartquote元素
Question mark
自始可用Go to source

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."

Syntax

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

参数
Question mark

double
bool
可用set规则
Question mark
默认值:true

Whether this should be a double quote.

enabled
bool
可用set规则
Question mark
默认值:true

Whether smart quotes are enabled.

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

Expand展开示例
#set smartquote(enabled: false) These are "dumb" quotes.

alternative
bool
可用set规则
Question mark
默认值:false

Whether to use alternative quotes.

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

Expand展开示例
#set text(lang: "de") #set smartquote(alternative: true) "Das ist in anderen Anführungszeichen."

quotes
auto or str or array or dictionary
可用set规则
Question mark
默认值:auto

The quotes to use.

Expand展开示例
#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.'