7

I'm wanting to place my .bib file where LaTex can easily find it, within my local Tex tree, under texmf.

I've already tried looking at the other centralised .bib posts here but they do not appear to be working for me. (.bib library file in a different directory, how to use? (Mendeley centralised .bib file))

Setup: Mac OSX El Capitan.

MacTex 2016, LaTexiT.

Using TexMaker for the editor.

I've so far tried placing the bib file in several locations to see if it will compile and find it however it fails to find it.

These locations are as follows:

  1. /usr/local/texlive/texmf-local/bibtex/bib/local
  2. /usr/local/texlive/texmf-local/bibtex/bib/
  3. /usr/local/texlive/2016/texmf-dist/bibtex/bib

In my .tex file I have is \bibliography{library} where the .bib file is named library.bib

Any suggestions? Thanks

Malakan
  • 163

2 Answers2

12

The simplest place to put local files with MacTeX is your local texmf folder which is located in:

~/Library/texmf

Files you put in this texmf folder will be found automatically without the need to use mktexlsr.

See the following question for how to set one up:

Bibliography files go in:

~/Library/texmf/bibtex/bib

If you use multiple machines as I do, my actual texmf folder is kept in Dropbox and I have a symbolic link in the ~/Library folder of each machine. To do this, make the folder in Dropbox and then from the Terminal do:

ln -s ~/Dropbox/texmf ~/Library/texmf

Update for MacOS 12.x

Changes to how Files on Demand are treated by the MacOS can lead to files in a Dropbox linked texmf not loading, since although the files exist, their content doesn't. Because of this, it's best to set the ~/Dropbox/texmf folder to have a "Make available offline" status. This can be done using the Finder: right-click (or control click) on the folder icon and choose the "Make available offline" Dropbox item. See MacTex 2022 issues for more detail.

Alan Munn
  • 218,180
2

A simple solution (or workaround) is to give the absolute path to your file as the argument of the \bibliography{} macro, e.g. \bibliography{/home/user-name/papers_and_stuff/library.bib}.
The call for the .bib file will thus be identical in all your documents.

ebosi
  • 11,692