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
相关产品推荐
相关产品推荐

