# .bib library file in a different directory, how to use? (Mendeley centralised .bib file)

problem

Hello All,

I have the possibility of a centralised, updated .bib file using Mendeley Desktop. This file will stay updated with all the changes I make using my Mendeley citation software.

I want to access this centralised .bib file via biblatex from any .tex scripts from any possible directory

possible solutions

I've read that I can place my .bib file somewhere in the root of my latex install, so it can be found by latex from any tex file, but I'm not sure where to exactly place it?

I don't think it's possible, but perhaps there are options to declare the path in the `\bibliography{bibliography}` declaration?

note

I would like to use biblatex with biber.exe

-
with bibtex at least, you can have full paths in your `\bibliography`. For example, my standard working template has `\bibliography{../bib_files/jabrefmaster.bib}` and running bibtex against `filename.aux` works just fine. I'd assume this would also be possible with biblatex? – Willie Wong Dec 9 '10 at 15:05
biblatex does allow relative path names in the `\bibliography` command... – Seamus Dec 9 '10 at 15:23

You can store your `bib` file in \$LOCALTEXMF/bibtex/bib or any subdirectory of it. Then LaTeX (and BibTeX, biblatex, and biber) will find it. Note that you have to update the filename database whenever you put a new file in this location (but not when the file is only updated). The \$LOCALTEXMF part can be any directory which is known to your TeX distribution. For further information about this, see the UK TeX FAQ:

-
@matth, this file normally resides in the distribution’s TEXMF tree under `doc/latex/biblatex/examples/biblatex-examples.bib`. – domwass Mar 8 '12 at 7:22
no, it’s `\$TEXMF/doc/latex/biblatex/examples/biblatex-examples.bib`, as I said (c: But, of course, as long as `bibtex`/`biber` finds it (and that should be the case in a standard installation), you don’t have to know the exact location. – domwass Mar 8 '12 at 8:16
thanks, I guess it is too early for me... deleted my comments with wrong path. – matth Mar 8 '12 at 8:18
Well, your first comment was quite useful, I just wanted to give the corrected path to biblatex-examples. – domwass Mar 8 '12 at 8:25

Since v1.2, biblatex supports remote location of bibliography resources; this feature requires biber as backend (and the use of the `\addbibresource` command which replaces `\bibliography`). See section 3.5.1 of the biblatex manual for details.

-

Another possibility is to call `bibtex` with the `--include-directory` flag. So, instead of,

``````bibtex myfile.tex
``````

do

``````bibtex --include-directory="path/to/bibliography/folder" myfile.tex
``````

This is a particularly easy solution if you're using a dedicated editor such as Texmaker, WinEdt, TeXnic Center or emacs with AUCTex. In Texmaker, you can edit the `bibtex` command used by the editor by going to Options -> Configure Texmaker -> Commands. Directions for the other editors I mentioned are described in this post.

-

Have you experimented with

``````bibber.exe --output_directory <d>
``````

?

Files (.bbl and .log) are output to directory instead of the current directory. Input files are also looked for in before current directory.

I just tried that, it works exactly as I need.

-

Neither do I, but a few solutions are described over there. I personally like to store all *.bib files in one directory and then to use symbolic links from my paper's directory, but I still need to specify exactly which files I need in the `\bibliography` command.

-
Is "symmetric link" supposed to be "symbolic link"? If not, can you explain the concept? – Willie Wong Dec 9 '10 at 17:25
Sorry, and thanks for pointing that out, I fixed it. – Anthony Labarre Dec 9 '10 at 17:51

How about setting the BIBINPUTS environment variable to include the shared directory that holds your bib file? This gives you complete freedom over where you put it. I use that to specify a directory where we store one shared bib file. Oddly, it doesn't seem to be mentioned at all in the TeX Frequently Asked Questions although I may have just missed it.

-