[Tex/LaTex] How to set a default bib path where all the bib files can refer to it

bibliographiesoverleafpaths

I have a problem when I have multiple bib files (i.e.,full.bib,article.bib,conf.bib,book.bib,me.bib; all the bib files are put into the bib folder), that is, every time I want to add bib files to my document, I will write as follows

\bibliography{bib/full,bib/article,bib/conf,bib/book,bib/me}

but it's annoying when I have many bib files.

My question is that,
should there be a simple way to write down thebibliography just as follows

 \bibliography{full,article,conf,book,me}

with a pre-defined path at the beginning of the document like

\bigliographypath{bib/}

Best Answer

(This is a solution for Overleaf since the user specifically asked to get the BIBINPUTS working on Overleaf in the comments.)

You can set the BIBINPUTS variable on your Overleaf project, by adding a file named latexmkrc with the following line in it:

$ENV{'BIBINPUTS'}='./bib//:' . $ENV{'BIBINPUTS'};

and then add some text to your .tex file to trigger a recompile.

The idea is similar to changing TEXINPUTS so that your project can access .sty, .bst, .cls etc in a folder: https://www.overleaf.com/help/212

Related Question