R降级标题索引

时间:2018-10-19 16:09:19

标签: r markdown r-markdown

我见过能够根据您R降价文档中的标题创建索引的人,如这张图片所示

enter image description here

如果有人能让我知道我该如何修改此代码,以便它创建该左索引表?

---
title: "Untitled"
author: "Juan Lozano"
date: "October 19, 2018"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Title 1

Text Text Text Text Text

```{r cars}
summary(cars)
```

## Title 2

Text Text Text Text Text

1 个答案:

答案 0 :(得分:1)

@hrbrmstr的链接表明可能有许多YAML定制: 这是我通常使用的那种东西:

---
title: "Untitled"
author: "john Smith"
date: "today ;)"
output:
  html_notebook:
    fig_caption: yes
    number_sections: yes
    toc: yes
    toc_float: yes
  html_document:
    fig_caption: yes
    number_sections: yes
    toc: yes
    toc_float: yes
    df_print: paged
bibliography: /path/to/library.bib
---