3

I was not sure if this question would better fit here on in https://emacs.stackexchange.com/ but I was thinking that more people may be able to answer here.

So basically, until now, I was managing by bibliography files in a quite naïve way: for every project, I was creating a new biblio.bib file, searching on the internet the BibTeX entry of every interesting article, and copy pasting this entry in my biblio.bib file. And my coauthors are also populating this same file. When I wanted to insert a reference, I was simply doing on emacs (my LaTeX editor) C-c [ (to load RefTeX) and then I was typing some title and it would automatically insert \cite{thepaperentry}.

However, I was thinking that maybe I could have a more efficient workflow, which would let me to have a central bibliography file, with a central PDF list of the article (that way I can quickly open a pdf corresponding to an article without losing time on the internet). But the problem is that it's not clear to me how to move efficiently the articles from my global bibliography file to my local bibliography. I don't want to symlink the global bibliography file because first symlink + git + overleaf don't play well together (my coauthor use overleaf), and secondly when my coauthor will populate the biblio.bib file, they will modify my global file. And I want to be the only one editing the global file.

So ideally, I would love to have a command on emacs like C-c [, but that also looks in my global file, and if the entry is not present in the local file, it would copy the entry locally. Is it possible? If not was is the usual workflow for that kind on things?

Thanks!

PS: I'm using for now the great org-ref-helm-insert-cite-link function to insert new citations in my .tex file, search for BibTeX entries...

-- EDIT2 --

I tried to use as a command M-x reftex-create-bibtex-file but it fails with an error:

reftex-get-bibfile-list: \bibliography statement missing or .bib files not found

The solution to that problem was that reftex was loaded by org-ref, but I needed to actually add in my .emacs:

(use-package reftex
  :ensure auctex
  :after latex)

to fix this issue.

1
  • Nelson Beebe has developed a substantial collection of tools for bibliography management. Do an author search at CTAN. Nelson has also written on this topic for TUGboat; a good place to start is A Bibliographer’s Toolbox Apr 8, 2020 at 14:34

1 Answer 1

4

RefTeX provides a function exactly for this purpose called reftex-create-bibtex-file. From the manual:

4.6 Database Subsets

RefTeX offers two ways to create a new BibTeX database file.

The first option produces a file which contains only the entries actually referenced in the current document. This can be useful if the database is only meant for a single document and you want to clean it of old and unused ballast. It can also be useful while writing a document together with collaborators, in order to avoid sending around the entire (possibly very large) database. To create the file, use M-x reftex-create-bibtex-file, also available from the menu under Ref->Global Actions->Create Bibtex File. The command will prompt for a BibTeX file name and write the extracted entries to that file.

1
  • (last problem solved) Thanks a lot for this trick, it is very nice, but it still have a minor issue: it removes all the entries in the bib file that are not in the text. And I don't want to erase some entries that may be used by other files, or that was added by my coauthor but are not yet used. Maybe I could add a merging step (done by ebib?), but then if I repeat that process for every single addition or a reference, it may be a bit inefficient.
    – tobiasBora
    Apr 10, 2020 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.