[Tex/LaTex] Creating a central bibliography

bibliographiesbibtex

I am trying to create a central bibliography (.bib file) in a directory outside of my LaTeX project. I want to do this so I don't have to have different .bib's for each paper I write. Currently in each .tex file I write:

\bibliography{central-bibliography}

at the end where I want to put it. My .bib file is called central-bibliography.bib.
The .bib file is in the same directory as the .tex file.

If I put the .bib file in an arbitrarily located directory, how would I reference it in the .tex file?

Best Answer

You can reference central-bibliography.bib at an absolute or relative (preferred) location from within the \bibliography command:

\bibliography{../references/central-bibliography}

Note the use of / and not \. Although it is not always required, using / (forward slash) works across most (all?) operating systems.

If you want to modify this from a location at the start of your document, you could also define a command to store the relative location:

\documentclass{<class>}
\newcommand{\myreferences}{../references/central-bibliography}
%...
\begin{document}
%...
\bibliography{\myreferences}
%...
\end{document}
Related Question