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


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


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


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


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