Forge
Forge

Reputation: 1687

floating TOC for prettydoc in Rmarkdown ask for theme

I love floating TOCs in my Rmarkdown and prettydoc package but trying to use both seems impossible.

I just want to add a floating TOC to my HTML Pretty doc. This is my working yaml header

title: "testing TOCs"
author: "Joe"
output:
  prettydoc::html_pretty:
    theme: leonids
    highlight: github
    toc: true

Adding Floating TOC option issues an error message asking for Theme.

title: "Test floating TOC"
author: "joe"
output:
  prettydoc::html_pretty:
    theme: leonids
    highlight: github
    toc: true
    toc_float: true


Error in rmarkdown::html_document(fig_retina = fig_retina, css = NULL,  : 
  You must use a theme when specifying the 'toc_float' option
Calls: <Anonymous> ... do.call -> <Anonymous> -> <Anonymous> -> <Anonymous>

Upvotes: 9

Views: 3069

Answers (2)

julio514
julio514

Reputation: 187

You should probably try rmdformats. It offers toc support and great visuals - https://cran.r-project.org/web/packages/rmdformats/vignettes/introduction.html

Upvotes: 1

Mario Huang
Mario Huang

Reputation: 85

Per GitHub documentation, toc_float does not work with prettydoc.

Upvotes: 3

Related Questions