目录由Pandoc自动构建:其条目严格对应于章节标题。这就是为什么在最后一个示例中(使用
# {-}
有很多方法可以实现你的目标。举个例子,最简单的方法可能是使用CSS。
记住这个降价线
# Exercise 1{-}
<div id="exercise-1" class="section level1 unnumbered">
<h1>Exercise 1</h1>
...
</div>
你可以藏起来
h1
h1 {
display: none;
}
对于如此小的CSS,您可以使用
knitr
CSS引擎在您的
Rmd
---
title: "A Multi-page HTML Document"
author: "Yihui Xie and Romain Lesur"
date: "`r Sys.Date()`"
output:
pagedown::html_paged:
toc: true
toc_depth: 3
# change to true for a self-contained document, but it'll be a litte slower for Pandoc to render
self_contained: false
---
```{css, echo=FALSE}
h1 {
display: none;
}
```
# Exercise 1{-}
<div style="width: 100%; height: 20px; border-bottom: 1px solid black; text-align: center">
<span style="font-size: 40px; background-color: white; padding: 0 10px;">
Exercicio 1 <!--Padding is optional-->
</span>
</div>