3

I already know how to use a central .bib-file on my Mac or on Windows. I just use the absolute path to the file (which I can store in a Dropbox folder). On my Mac I use for example something like this:

\bibliography{/Users/myname/Documents/blabla/Bibliographie/biblio.bib}

But since the folder structure is different on Windows, I'd like to know how I can use one .bib-file which is shared between Windows and Mac without changing the path in the respective .tex-file. (The .tex-file is also shared via Dropbox.)

I read of the possibility to save a file in the folder of the TeX distribution, but I don't know how I can refer to that folder within my document. Can I then just use a relative path as if the file would be in the folder of the specific document? Or is there another way?

2
  • 2
    Use a relative path...
    – TeXnician
    Jun 24, 2017 at 6:58
  • 1
    With Biber you can also use the file from dropbox directly using its URL, see here.
    – moewe
    Jun 24, 2017 at 7:18

1 Answer 1

4

Assume you file document.tex is saved in Dropbox in Documents/newdocument/document.tex and your bibliography.bib is saved in Dropbox in Documents/bibliographies/bibliography.bib then use

\bibliography{../bibliographies/bibliography}

in document.tex. ../bibliographies/bibliography.bib is called a relative path, where ../ means: go to the parent folder.

Now, you can mount the Dropbox directory Documents everywhere in your local file system. If you open document.tex from there, bibliography.bib should be found via the relative path.

For alternatively saving a file in a TEXMF examined by the TeX distribution have a look into Where do I place my own .sty or .cls files, to make them available to all my .tex files?. The main difference between .cls (or .sty) and .bib files is, that .cls files are stored into subfolder tex/latex/<myfolder>/<myfile.cls> and .bib files should be stored into bibtex/bib/<myfolder>/<myfile.bib>. In this case you don't need a (relative or absolute) path at the \bibliography command but only the basename of the .bib-file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .