You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Quarto Typst文档中引用章节时显示编号加名称而非仅编号?

要实现英文下引用显示“A link to chapter 2 Second chp”,只需修改YAML配置,调整章节编号类型和交叉引用格式:

---
format: typst
section-numbering: "chapter"
crossref:
  chapters:
    ref-format: "number-title"
---

# First chp

A link to @sec-chp2

# Second chp {#sec-chp2}

关键修改点:

  • 将section-numbering: "1"改为"chapter",让一级标题被识别为**章节(chapter)**而非小节(section),引用前缀会从"Section"变为"chapter"。
  • 添加crossref配置,设置ref-format: "number-title",让引用同时显示章节编号和标题内容。

如果需要切换为中文显示(比如“链接到第2章 第二章”),只需补充语言设置和中文前缀后缀:

---
format: typst
section-numbering: "chapter"
language: zh-CN
crossref:
  chapters:
    ref-prefix: "第"
    ref-suffix: "章"
    ref-format: "number-title"
---

# 第一章

链接到 @sec-chp2

# 第二章 {#sec-chp2}

内容的提问来源于stack exchange,提问作者MartineJ

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 07:05:01