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

Quarto Revealjs演示文稿目录重复:如何排除二级标题?

解决Quarto Revealjs演示文稿TOC重复及标题排除问题

方法1:排除指定二级标题出现在目录

给不需要显示在TOC中的二级标题添加{.unlisted}属性,幻灯片仍会正常显示标题,但该条目不会被收录到目录里。

修改后的示例代码:

---
title: "Presentation"
format: 
  revealjs:
    toc: true
    slide-number: true
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.

## Quarto {.unlisted}

When you click the **Render** button a document will be generated that includes:

-   Content authored with markdown
-   Output from executable code

## Quarto {.unlisted}

When you click the **Render** button a presentation will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1
## 方法2:创建无标题幻灯片
如果不需要幻灯片顶部显示标题,直接用水平分割线`---`创建新幻灯片即可,这类幻灯片不会被TOC收录,从根源避免重复条目。

修改后的示例代码:
```yaml
---
title: "Presentation"
format: 
  revealjs:
    toc: true
    slide-number: true
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.

---

When you click the **Render** button a document will be generated that includes:

-   Content authored with markdown
-   Output from executable code

---

When you click the **Render** button a presentation will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1
### 补充说明
你遇到的TOC重复条目问题,是因为每个`##`开头的二级标题默认都会被收录到目录中,多个相同标题自然会重复显示。上面两种方法都可以解决这个问题,选择哪种取决于你是否需要保留幻灯片的标题显示。

内容的提问来源于stack exchange,提问作者Marco
相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.21 13:31:23