Using the template for Rmd, I add toc: true
to the yaml, and the document knits, but there is no toc to be found. Instead the text “true” appears in the document.
---
title: "Untitled"
author: "Author Name"
date: "2024-08-06"
output: html_document
toc: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
A slightly altered yaml doesn’t help:
---
title: "Untitled"
author: "Author Name"
date: "2024-08-06"
output:
html_document:
toc: true
---
The text “true” disappears, but there is no TOC. Ideas?
> sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=C LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
time zone: America/Los_Angeles
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] jsonlite_1.8.8 dplyr_1.1.4 compiler_4.4.0 promises_1.3.0 tidyselect_1.2.1 Rcpp_1.0.12 stringr_1.5.1 later_1.3.2 jquerylib_0.1.4
[10] yaml_2.3.8 fastmap_1.2.0 mime_0.12 R6_2.5.1 plyr_1.8.9 shinyjs_2.1.0 generics_0.1.3 knitr_1.47 tibble_3.2.1
[19] shiny_1.8.1.1 bslib_0.7.0 pillar_1.9.0 rlang_1.1.3 utf8_1.2.4 cachem_1.1.0 stringi_1.8.4 xfun_0.44 httpuv_1.6.15
[28] sass_0.4.9 cli_3.6.2 magrittr_2.0.3 shinyWidgets_0.8.6 digest_0.6.35 rstudioapi_0.16.0 xtable_1.8-4 lifecycle_1.0.4 vctrs_0.6.5
[37] evaluate_0.23 glue_1.7.0 rsconnect_1.3.1 fansi_1.0.6 reshape2_1.4.4 rmarkdown_2.27 tools_4.4.0 pkgconfig_2.0.3 htmltools_0.5.8.1