crsh / citr

RStudio Addin to Insert Markdown Citations
Other
407 stars 46 forks source link

Please support multiple messy bib files in tidy_bib_file() function #62

Open jooyoungseo opened 4 years ago

jooyoungseo commented 4 years ago

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"
)
crsh commented 4 years ago

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).

ilsePit commented 3 years ago

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