首页 > 解决方案 > 从 Bookdown TOC 中省略索引页

问题描述

我正在使用 bookdown 使用 bs4_book 格式编写带有网络版本的书。我希望我的索引页(首页)不出现在左侧的目录中,即我希望此屏幕截图中的蓝色圆圈项不出现在目录中:

带有前言的目录截图

我尝试了文档中的说明:

# Section name {.unlisted .unnumbered}

但这无济于事。如图所示,我的 pandoc 版本 > 2.7:

> rmarkdown::pandoc_version()
[1] ‘2.11.0.4’

这些是 _bookdown.yaml 的内容

book_filename: "shiny-book"
language:
  ui:
    chapter_name: "Chapter "
delete_merged_file: true
new_session: no

rmd_files:
  [
    "index.Rmd",
    "test_chapter.md",
  ]

_output.yml

bookdown::bs4_book:
  repo: https://github.com/smsaladi/phd
  includes:
    in_header: [ga_script.html, no_robots.html]

索引.Rmd

---
title: "Investigations on the computer"
author: "Name"
site: bookdown::bookdown_site
---

`r if (knitr::is_latex_output()) '<!--'`

# Preface {.unlisted .unnumbered}

`r if (knitr::is_latex_output()) '-->'`

标签: rr-markdownknitrpandocbookdown

解决方案


推荐阅读