Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

path error in pkgdown article with multiple bibliographies

Tags:

r

pkgdown

I have a vignette of a R-package with multiple bibliographies (MB), using a lua filter. When I try to turn the vignette with MB into a pkgdown article I got an error for the .lua and .bib files, that do not appeared with the vignette.

pkgdown::build_article("index", pkg = ".", data = list(), lazy = FALSE,
  quiet = FALSE) # build index.Rmd vignette (located in vignettes folder) as article

openBinaryFile: does not exist (No such file or directory

WORKAROUND: If I use the whole path of files, problem disappears: /home/user..

NOTE: For pandoc >2.11 each bibliography accepts only one .bib

Vignette (index.Rmd) with MB, example yaml section:

pkgdown:
  as_is: true
output:
  rmarkdown::html_vignette:
    toc: true
    toc_depth: 1
    number_sections: true
    pandoc_args: --lua-filter=multiple-bibliographies.lua

bibliography_normal: [allrefs.bib]
bibliography_software: [packages.bib, Rrefs.bib]
bibliography_docs: [docPackages.bib]

For testing purposes you will need a package DESCRIPTION file, one is available in link. See also link about creating a package. In order to create a vignette, install R-Studio, go to File, new file, R-markdown, From Template, Package Vignette. Important: Check the lua filter link also to learn what is MB in this Post. To add cites use [@R-plyr] in body, or use this in yaml section:

nocite: |
   @R-plyr

In order to create .bib files use:

knitr::write_bib(c("devtools","plyr","dplyr"), 'packages.bib')

Notes: Requires pandoc > 2

like image 890
Ferroao Avatar asked Dec 30 '19 22:12

Ferroao


1 Answers

Solved adding files to yaml:

resource_files:
  - multiple-bibliographies.lua
  - allrefs.bib
like image 154
Ferroao Avatar answered Oct 31 '22 06:10

Ferroao