Bookdown:导出到 Word 文档(文件 2[[格式]] 中的错误:尝试在 get1index 中选择少于一个元素) [英] Bookdown: Exporting to a word document (Error in files2[[format]] : attempt to select less than one element in get1index)

查看:63
本文介绍了Bookdown:导出到 Word 文档(文件 2[[格式]] 中的错误:尝试在 get1index 中选择少于一个元素)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am writing my thesis using the bookdown package and the memoir latex class. Everything works relatively fine when I am exporting to pdf or to html but I am unable to export the thesis to a word document...

我收到以下神秘错误:

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

不过,很难提供可重现的示例,因为我正在使用凌乱的论文存储库.

It is difficult to provide a reproducible example though, as I am working from my messy dissertation repository.

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

But here is (a part of) my _output.yml file:

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 包的一个错误,我刚刚在 Github 上修复了.请尝试那里的开发版本:

This is a bug of the bookdown package, which I just fixed on Github. Please try the development version there:

remotes::install_github('rstudio/bookdown')

这篇关于Bookdown:导出到 Word 文档(文件 2[[格式]] 中的错误:尝试在 get1index 中选择少于一个元素)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆