Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R Bookdown:TOC与html_文档2_R_Bookdown - Fatal编程技术网

R Bookdown:TOC与html_文档2

R Bookdown:TOC与html_文档2,r,bookdown,R,Bookdown,如何使用bookdown(例如使用其bookdown::html_document2格式)创建单个输出文档,并且在输出文档中的某个位置仍有目录 例如,我从中签出内容,然后运行 然后我根据需要得到一个\u main.html,包含所有章节的所有文本,但没有TOC。您可以使用bookdown::html_document2的dots(..)参数将TOC=TRUE传递到rmarkdown::html_document: Rscript -e "bookdown::render_book('index.

如何使用
bookdown
(例如使用其
bookdown::html_document2
格式)创建单个输出文档,并且在输出文档中的某个位置仍有目录

例如,我从中签出内容,然后运行

然后我根据需要得到一个
\u main.html
,包含所有章节的所有文本,但没有TOC。

您可以使用
bookdown::html_document2
的dots(
..
)参数将
TOC=TRUE
传递到
rmarkdown::html_document

Rscript -e "bookdown::render_book('index.Rmd', bookdown::html_document2(toc = TRUE))"

谢谢缺少一个事实,即我可以将
bookdown::html_document2
用作函数,而不仅仅是字符串。
Rscript -e "bookdown::render_book('index.Rmd', bookdown::html_document2(toc = TRUE))"