R markdown的元数据部分中的目录(TOC)选项不起作用。这是一个MWE。它不会产生TOC。我该如何解决?
---
title: "My Study"
author: "My Name"
date: "February 4, 2016"
output: html_document
toc: true
toc_depth: 2
toc_float: true
---
# Section 1. Executive
# Section 2. Introduction
# Section 3. Conclusion
答案 0 :(得分:4)
rmarkdown documentation指定toc
选项应嵌套在yaml前端的输出格式中。以下代码生成预期输出:
---
title: "My Study"
author: "My Name"
date: "February 4, 2016"
output:
html_document:
toc: true
toc_depth: 2
toc_float: true
---