In Latex there are a variety of tools that can be used to create a self-contained .bib file for the
cited references that are extracted from several larger .bib files; see this popular tex.stackexchange question.
Is there some way to do this for markdown documents processed by pandoc (well, pandoc-citeproc)?
Context: I'm writing an article (in rmarkdown, .Rmd format) shared with a collaborator in the cloud. I refer to several .bib files in my local texmf tree.
bibliography:
- "../localtexmf/bibtex/bib/statistics.bib"
- "../localtexmf/bibtex/bib/graphics.bib"
- "../localtexmf/bibtex/bib/Rpackages.bib"
But my colleague can't access these, unless I copy them to the project directory (and then have to maintain duplicate copies).
The LaTeX solutions rely on the the .aux file generated in processing the .tex file. However, pandoc does not map [@reference] into \cite and doesn't produce an .aux file.
A similar question was asked here, but received no answers.
Update: There is probably no direct solution with LaTex or pandoc, but a first step would be to use perl or sed to extract all the citation keys, strings like @key in the .Rmd file.