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

Quarto Beamer演示文稿章节编号不生效的问题咨询

问题分析与解决方案

你的Quarto配置语法本身没有错误,章节标题不显示编号是因为Beamer部分默认主题会隐藏章节编号,即使Quarto设置了number-sections: true,也需要主题支持或手动开启编号。

解决方法

方法1:更换支持章节编号的Beamer主题

在YAML的Beamer格式配置中添加theme字段,指定如Madrid、AnnArbor这类默认显示章节编号的主题:

---
title: "Title"
format: 
  beamer:
    pdf-engine: xelatex
    number-sections: true
    number-depth: 3
    theme: Madrid
editor: visual
---

方法2:手动添加LaTeX命令强制开启编号

如果不想更换主题,可通过header-includes注入LaTeX代码,强制开启章节、小节的编号显示:

---
title: "Title"
format: 
  beamer:
    pdf-engine: xelatex
    number-sections: true
    number-depth: 3
    header-includes:
      - \setbeamertemplate{section in toc}[sections numbered]
      - \setbeamertemplate{subsection in toc}[subsections numbered]
      - \setbeamertemplate{section page}[sections numbered]
editor: visual
---

执行上述任一修改后,重新渲染文档,章节和小节标题就会正常显示编号了。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.14 11:39:59