RMarkdown with knitr to HTML: How to hide bullets in TOC (table of contents)?

狂风中的少年 提交于 2019-12-01 19:55:25

Put this in styles.css:

div#TOC li {
    list-style:none;
    background-image:none;
    background-repeat:none;
    background-position:0;
}

And then use this in the Rmd header YAML:

---
title: "Untitled"
author: "Author"
date: "01/25/2015"
output:
  html_document:
    css: styles.css
    number_sections: true
    toc: yes
    toc_depth: 3
---

That will give you the #'s but no •'s. NOTE: styles.css and your Rmd file need to be in the same directory.

If you want to avoid having an additional (css) file besides the HTML file you can put the CSS code into your Rmd file directly:

---
title: "Untitled"
author: "Author"
date: "01/25/2015"
output:
  html_document:
    number_sections: yes
    toc: yes
    toc_depth: 3
---

<style type="text/css">
div#TOC li {
    list-style:none;
    background-image:none;
    background-repeat:none;
    background-position:0; 
}
</style>
Your content starts here...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!