Bookdown:导出到 word 文档(files2[[format]] 中的错误:尝试 select 小于 get1index 中的一个元素)

Bookdown: Exporting to a word document (Error in files2[[format]] : attempt to select less than one element in get1index)

我正在使用 bookdown 包和 memoir latex class 写论文。当我导出为 pdf 或 html 时,一切都相对正常,但我无法将论文导出为 word 文档...

我收到以下神秘错误:

Error in files2[[format]] : 
  attempt to select less than one element in get1index

但是很难提供一个可重现的例子,因为我正在处理我凌乱的论文库。

但这是我的 _output.yml 文件的(一部分):

bookdown::pdf_book:
  includes:
    in_header: latex/preamble.tex # defines style and latex options
    before_body: latex/before_body.tex # defines cover page
  latex_engine: xelatex # lualatex or xelatex
  citation_package: none # needs to be "none" in order to use the csl file
  keep_tex: true # keeps the .tex file
  dev: "cairo_pdf"
  toc: false # deactivates default table of contents
  highlight: pygments # code highlighting
  pandoc_args: [ "--csl", "./csl/apa6.csl" ] # specifies the csl file to be used

bookdown::word_document2:
  pandoc_args: [
    "--csl", "./csl/apa6.csl",
    "--bibliography", "./bib/packages.bib",
    "--bibliography", "./bib/thesis.bib",
    #"--reference-doc", "./assets/2018-05-17-aim1-draft.docx",
    "--filter", "pandoc-citeproc"
    #"--filter", "./assets/fix-apa-ampersands.py"
  ]

有什么想法吗?

这是 bookdown 软件包的错误,I just fixed 在 Github 上。请尝试那里的开发版本:

remotes::install_github('rstudio/bookdown')