citr icon indicating copy to clipboard operation
citr copied to clipboard

Please support multiple messy bib files in tidy_bib_file() function

Open jooyoungseo opened this issue 5 years ago • 2 comments

Would you mind allowing multiple messy bib files for tidy_bib_file() function?

Let's say you have two bib files in your YAML:

bibliography: ["a.bib", "b.bib"]

I would like to create a tidy_references.bib file out of these two messy bib files.

So, I did the following; however, tidy_bib_file() function does not allow multiple messy bib files.

library(RefManageR)
citr::tidy_bib_file(
  rmd_file="test.Rmd"
  , messy_bibliography = c("a.bib", "b.bib")
  , file = "tidy_references.bib"
)

jooyoungseo avatar Jan 23 '20 15:01 jooyoungseo

Hi JooYoung,

I suppose this is possible, but I won't get around to implementing this any time soon (I'd be willing to review a PR, though). In priniciple, it should be easy to achieve this manually by tidying the bib-files separately and merging the text files using readLines() and, for example, cat(..., append = TRUE).

crsh avatar Jan 24 '20 20:01 crsh

I thought this was a great idea, so I tried to write the solution, see this pull request.

ilsePit avatar Dec 30 '20 22:12 ilsePit