Typst 0.15.0
Typst 0.15.0
Changelog 0.15.0 Typst 0.15.0 (June 15, 2026) This section documents all changes to the Typst language and compiler between Typst 0.14.2 and 0.15.0. If you are migrating an existing document to Typst 0.15, make sure to check out the Migration guide. It walks you through changes you may need to make to your existing documents to ensure compatibility with Typst 0.15.
更新日志 0.15.0 Typst 0.15.0(2026 年 6 月 15 日) 本节记录了 Typst 0.14.2 到 0.15.0 之间 Typst 语言和编译器的所有变更。如果您正在将现有文档迁移到 Typst 0.15,请务必查看“迁移指南”。它将引导您完成为确保与 Typst 0.15 兼容而可能需要对现有文档进行的修改。
Highlights
- Typst now supports variable fonts
- HTML export now supports equations out of the box via MathML
- With the new, experimental bundle export target, a single Typst project can output multiple files (e.g. a multi-page website)
- A single document can now contain multiple bibliographies
- Typst can now target multiple PDF standards at once
- The new
withinselector simplifies many introspection use cases - The new
dividerelement represents a thematic break that templates can style - Spot colors enable use of custom pigments in offset printing
- With the new file path type, project-relative paths can be passed to packages
- The new, more general
typst evalCLI subcommand supersedestypst query - Layout convergence issues now result in detailed diagnostics
- Two long-standing list layout issues with marker alignment and centering were fixed
- Paragraph handling in HTML export is improved, preventing unexpected paragraphs from appearing
- This documentation now has a print version
亮点
- Typst 现在支持可变字体 (Variable Fonts)。
- HTML 导出现在通过 MathML 原生支持公式。
- 通过全新的实验性 bundle 导出目标,单个 Typst 项目可以输出多个文件(例如多页面网站)。
- 单个文档现在可以包含多个参考文献列表。
- Typst 现在可以同时针对多个 PDF 标准进行输出。
- 新的
within选择器简化了许多内省 (introspection) 的使用场景。 - 新的
divider元素代表了一个可以由模板进行样式化的主题分隔符。 - 专色 (Spot colors) 支持在胶印中使用自定义颜料。
- 通过新的文件路径类型,可以将项目相对路径传递给包。
- 全新且更通用的
typst eval命令行子命令取代了typst query。 - 布局收敛问题现在会产生详细的诊断信息。
- 修复了两个长期存在的列表布局问题(标记对齐和居中)。
- 改进了 HTML 导出中的段落处理,防止出现意外的段落。
- 本文档现在有了打印版本。
Language Syntax
- File paths (e.g. in imports or image function calls) may not contain backslashes anymore; instead forward slashes must be used (Breaking change)
- Added hints for invalid characters in code mode
- Added hint when trying to use a unary operator directly in an embedded expression using a hash (e.g.
#-30deg) - Fixed potential stack overflow crashes by enforcing a maximum parsing depth
- Fixed incremental parsing of unclosed strings
语言 语法
- 文件路径(例如在导入或图像函数调用中)不再允许包含反斜杠;必须使用正斜杠(破坏性变更)。
- 为代码模式下的无效字符添加了提示。
- 当尝试在哈希嵌入表达式中直接使用一元运算符(例如
#-30deg)时,添加了提示。 - 通过强制执行最大解析深度,修复了潜在的栈溢出崩溃问题。
- 修复了未闭合字符串的增量解析问题。
Styling
- Text show rules now have tracebacks that include the matched text
- Fixed a crash with text show rules that match on multi-character symbols
样式
- 文本显示规则 (Text show rules) 现在具有包含匹配文本的追踪信息 (tracebacks)。
- 修复了匹配多字符符号的文本显示规则导致的崩溃问题。
Scripting
- Extended hint when built-in definitions are shadowed to set and show rules
- Added hint when trying to spread one or multiple dictionaries into an array
- Improved diagnostics for invalid method calls
- Improved hint for unknown variables in math that are available in std
- Fixed a misleading error message when trying to assign to a temporary return value
脚本
- 当内置定义被 set 和 show 规则遮蔽时,扩展了提示信息。
- 当尝试将一个或多个字典展开 (spread) 到数组中时,添加了提示。
- 改进了无效方法调用的诊断信息。
- 改进了数学模式下对 std 中可用但未定义变量的提示。
- 修复了尝试赋值给临时返回值时产生的误导性错误消息。
Library Foundations
- Added file path type that is now accepted in all places where paths were previously only represented as strings
- A path constructed in one file can be used in another file, but will be resolved relative to its original file
- Likewise, paths can be passed across package boundaries
- The initial path type is very minimal, but additional features like file existence checks or directory walking are planned
- Collections: Added
mapandfilterfunctions on dictionaries and arguments - Named arguments on arguments values are now accessible with field access syntax
- The
slicefunctions on strings and arrays will now error if passing both an end and a count (Minor breaking change) - Added
inclusiveparameter torangefunction
库 基础
- 添加了文件路径类型,现在所有之前仅以字符串表示路径的地方都接受该类型。
- 在一个文件中构建的路径可以在另一个文件中使用,但将相对于其原始文件进行解析。
- 同样,路径可以在包边界之间传递。
- 初始路径类型非常精简,但计划添加文件存在性检查或目录遍历等附加功能。
- 集合:在字典和参数上添加了
map和filter函数。 - 参数值上的命名参数现在可以使用字段访问语法进行访问。
- 如果同时传递
end和count,字符串和数组的slice函数现在会报错(微小的破坏性变更)。 - 为
range函数添加了inclusive参数。
Calculation
- Added
asinh,acosh,atanh, anderffunctions tocalcmodule - Added
int.minandint.maxconstants for the minimum and maximum representable integer, respectively - Fixed behavior of
quofor negative integers - Fixed potential overflows in
norm,abs,gcd, andlcm - Floating-point calculations are now consistently deterministic across platforms
计算
- 向
calc模块添加了asinh、acosh、atanh和erf函数。 - 添加了
int.min和int.max常量,分别表示可表示整数的最小值和最大值。 - 修复了负整数
quo的行为。 - 修复了
norm、abs、gcd和lcm中潜在的溢出问题。 - 浮点计算现在在不同平台上保持一致的确定性。
Date & time handling
- The
offsetparameter ofdatetime.todaynow accepts durations as an alternative to integers, allowing for sub-hour precision offsets - Addition and subtraction of datetimes and durations now retains precision instead of clamping to full days in some cases
- The
datetimeconstructor now emits more precise errors when components are missing
日期与时间处理
datetime.today的offset参数现在接受持续时间 (durations) 作为整数的替代方案,允许进行小时以下的精度偏移。- 日期时间和持续时间的加减运算现在保留精度,而不是在某些情况下强制截断为整天。
- 当组件缺失时,
datetime构造函数现在会发出更精确的错误信息。
Conversions
- Added
baseparameter tointconstructor to configure in which base to parse a string - Fixed that the
baseparameter of thestrconstructor was accepted for non-integer values if its value was 10 (Minor breaking change) - Added hint when trying to construct a string with base 1
- The
panicfunction now displays strings as-is instead of showing theirrepr, making it more suitable for friendly, user-facing messages - Changed
reprof styles and locations to be more distinct
转换
- 为
int构造函数添加了base参数,用于配置解析字符串时的进制。 - 修复了
str构造函数的base参数在值为 10 时接受非整数值的问题(微小的破坏性变更)。 - 当尝试以 1 进制构建字符串时添加了提示。
panic函数现在按原样显示字符串,而不是显示其repr,使其更适合用户友好的消息。- 更改了样式和位置的
repr,使其更具区分度。
Model
- Added
dividerelement representing a thematic break that templates can style - Bundle-related elements: The
documentelement can now be constructed to produce individual documents in bundle export - Added
pathandformatparameters todocumentelement - Added experimental
assetelement
模型
- 添加了
divider元素,代表模板可以样式化的主题分隔符。 - Bundle 相关元素:
document元素现在可以被构建以在 bundle 导出中生成单独的文档。 - 为
document元素添加了path和format参数。 - 添加了实验性的
asset元素。
Bibliography management
- A single document can now contain multiple bibliographies
- Added
targetparameter tobibliographyelement to configure which citation is picked up by which bibliography - Added
groupparameter tobibliographyelement to configure how numbers are shared/reset across bibliographies - Added support for numeric values for the
monthkey in.bibfiles - Added support for BibLaTeX name options in
.bibfiles - Added support for propagating non-numeric volume fields in
.bibfiles to bibliographies - Improved sorting in bibliographies to take into account language conventions
- Improved interoperability with CSL styles; for a full listing of changes, review the Hayagriva 0.10.0 changelog
- Added support for setting directors on videos without a parent in Hayagriva YAML files
- Improved handling of Anthos entries in Hayagriva YAML files by treating them as chapters in CSL
参考文献管理
- 单个文档现在可以包含多个参考文献列表。
- 为
bibliography元素添加了target参数,用于配置哪个参考文献列表捕获哪些引用。 - 为
bibliography元素添加了group参数,用于配置编号如何在不同参考文献列表间共享或重置。 - 添加了对
.bib文件中month键数值的支持。 - 添加了对
.bib文件中 BibLaTeX 名称选项的支持。 - 添加了对将
.bib文件中的非数字卷字段传播到参考文献列表的支持。 - 改进了参考文献列表中的排序,考虑了语言习惯。
- 改进了与 CSL 样式的互操作性;有关更改的完整列表,请查看 Hayagriva 0.10.0 更新日志。
- 添加了对在 Hayagriva YAML 文件中为没有父级的视频设置导演的支持。
- 改进了 Hayagriva YAML 文件中 Anthos 条目的处理,将其视为 CSL 中的章节。
Footnotes
- The link of a footnote is now within the superscript instead of around it, improving PDF tagging and HTML output
- The thickness of the default footnote separator is now specified in font-relative instead of absolute units
脚注
- 脚注的链接现在位于上标内而不是其周围,改进了 PDF 标记和 HTML 输出。
- 默认脚注分隔符的厚度现在以字体相对单位而不是绝对单位指定。
Numbering
- Added numbering support for Armenian numerals, Arabic Abjad numerals, and Tibetan numerals
- Greek numbering now uses the modern Greek style
- The
par.first-line-indentproperty will now fold, meaning that partial dictionaries across different set rules orparcalls are combined - Added
list.marker-alignproperty for defining how to align list markers - When omitted, it will default to the new baseline alignment (vertically)
编号
- 添加了对亚美尼亚数字、阿拉伯字母数字 (Abjad) 和藏文数字的编号支持。
- 希腊语编号现在使用现代希腊风格。
par.first-line-indent属性现在会进行折叠,这意味着跨不同 set 规则或par调用的部分字典将被合并。- 添加了
list.marker-align属性,用于定义如何对齐列表标记。 - 如果省略,它将默认为新的基线对齐(垂直方向)。