Skip to content

Instantly share code, notes, and snippets.

@alanocallaghan
Created March 23, 2022 15:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanocallaghan/65811de1dc062388dd12fbb5055c30bd to your computer and use it in GitHub Desktop.
Save alanocallaghan/65811de1dc062388dd12fbb5055c30bd to your computer and use it in GitHub Desktop.
Exporting references from a central to local bib file
## using natbib
## when finished adding refs, run
bibexport --nosave -o [LOCAL_BIB_FILE] main.aux
## then switch the \bibliography command from the central file to the local one, ie change
# % \bibliography{[CENTRAL_BIB_FILE]}
# % \bibliography{[LOCAL_BIB_FILE]}
# % with biblatex you would run something like
jabref -n --aux main.aux,[LOCAL_BIB_FILE] [CENTRAL_BIB_FILE]
## and again switch which bib file you're working with
# % \addbibresource{[CENTRAL_BIB_FILE]}
# % \addbibresource{[LOCAL_BIB_FILE]}
@friendly
Copy link

Arghh, I've also done this many times, but I have several separate central bib files to pull from. I use an aux2bib perl script

references.bib : $(MAIN)-all.aux
	rm TOGS-all.aux
	cat $(MAIN).aux ch[01]?*.aux > TOGS-all
	mv TOGS-all TOGS-all.aux
	perl $(AUX2BIB) $(MAIN)-all

together with

% Bibliography items originally in separate files
%\bibliography{timeref,graphics,statistics}
% for production, all have been collected in references.bib
\bibliography{references}

@kidpixo
Copy link

kidpixo commented Mar 23, 2022

I use the Zotero + Better Bibtex to keep the library in automatically sync with a bibtex file

@friendly
Copy link

That's different than pulling cited references for a book or paper from one or more master .bib files, whether you use Zotero or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment