注意 / Info
本站经 Typst GmbH 许可,提供 Typst v0.10.0+后期随缘更新 官方文档的翻译,由中文社区维护。建议与官方文档一同阅读,因为可能存在错译、漏译或过时信息。如有意改进翻译内容或网站本身,可在GitHub上提出 Issue、发起 Pull Requests。此外,也欢迎加入「Typst 非官方中文交流群」(QQ 793548390)
This site provides a Chinese translation of the Typst v0.10.0+后期随缘更新 documentation maintained by the “Typst Chinese Community” with permission from Typst GmbH. We recommend using this alongside the official documentation. We welcome contributions through Issues and Pull Requests on our GitHub repository for both translation improvements and website enhancements. Feel free to join our QQ chat group “Typst 非官方中文交流群” (793548390).
Typst文档简体中文版
v0.10.0+后期随缘更新

smartquote
元素
元素
元素函数可用setshow规则自定义样式。

感知上下文的语言感知引号。 A language-aware quote that reacts to its context.

根据文本语言自动转换为适当的开头或结尾引号。

Example

"This is in quotes."

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

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

Syntax

该函数还有专用语法:普通引号('")。Typst会自动转换引号形式。

参数
参数
参数是传给函数的输入,写在函数名后的括号中。

double
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

是否应当是双引号。

默认值:

true

enabled
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

是否启用智能引号。

要禁用智能引号,还可以用反斜杠进行转义。

默认值:

true

展开例子
#set smartquote(enabled: false)

These are "dumb" quotes.
Preview

alternative
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

是否使用替代引号。

对于没有替代引号或已设置显式引号的语言,不起作用。

默认值:

false

展开例子
#set text(lang: "de")
#set smartquote(alternative: true)

"Das ist in anderen Anführungszeichen."
Preview

quotes
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

要使用的引号。

  • 当设置为auto时,将使用文本语言的适当单引号。这是默认设置。
  • 可以将自定义引号作为字符串、数组或包含以下内容的字典传递
    • 字符串: 包含开启和关闭双引号的两个字符的字符串(这里的字符指的是Unicode图形簇)
    • 数组: 包含开启和关闭双引号的数组
    • 字典: 包含双引号和单引号的数组,每个都指定为auto、字符串或数组

默认值:

auto

展开例子
#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
转到官方文档(英文)

搜索