Bookdown Preview_chapter()不适用于编织按钮

问题描述 投票:0回答:1

我目前正在帮助一位教授为他在哈佛的课程Gov 50编写一本数据科学书籍。使用bookdown程序包时遇到的问题是,我们似乎无法使用knit按钮构建单独的章节并无法在新窗口中自动预览该章节。

我们得到的错误是:

Error in files2[[format]] : 
  attempt to select less than one element in get1index
Calls: <Anonymous> ... render_book -> setdiff -> as.vector -> source_files
Execution halted

因此,我们被迫使用preview_chapter()功能,然后手动浏览该书的每个html文件,以查找要预览的章节。这最终很耗时,并且使我们的各个章节编写者都难以进行该过程。有谁知道是什么原因造成的?

我们的_output.yml文件似乎已正确设置:

bookdown::tufte_html_book:
  df_print: default
  css: style.css
  split_by: "section"
  config:
    toc:
      collapse: subsection
      scroll_highlight: true
r bookdown
1个回答
0
投票

我已找到导致错误的原因!这是由我们索引中的yaml选项引起的。

---
site: bookdown::bookdown_site
---

删除此错误已解决编织错误。

© www.soinside.com 2019 - 2024. All rights reserved.