TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently bought a Mac and have been struggling with running my .tex files. I'm using Textmate and TeXShop. The problem I have is the following: using the exact same .tex and .bib files and running them on my Mac, some of the references do not appear.

For example, at some point a type: Eg. \citet{heckman81} and \citet{heckman81a}, and after running both pdflatex and bibtex (several times, as suggested elsewhere) I get the following warning:

Warning--I didn't find a database entry for "heckman81a"

Importantly, when I use to run it on my PC everything worked fine.

Anyone has suggestions, or has experienced something similar in the past?

share|improve this question
This sounds like a line-end issue: BibTeX can to have an issue with this. On Windows, the standard line end is CR-LF, but on the Mac and Linux its just LF. Does TeXshop let you check the line endings? (I use TeXworks, which does, but am not sure about TeXshop.) – Joseph Wright Aug 22 '12 at 18:02
Thanks Joseph. If the .bib file is in the same folder as the .tex file the bibliography compiles fine. I don't want that, so I have saved the .bib file inside ~/BiblioLatex. That's when some of my references are excluded. I have already checked that the PATH is correct (kpsepath bib shows my folder). What do you think? – Daniel Vaughan Aug 23 '12 at 1:09
Ok, I believe that my problem is that I'm not able to use my centralized bibliography (it was reading an old version that I had placed inside a texmf subdirectory). I've been battling with this for several days now: 1. If I type kpsewhich biblio.bib (my bibliography) I get the right answer (the folder I included in the bash_profile file with BIBINPUTS) so if I understand correctly, LaTex is able to find my bibliography. But why do I keep getting the error I couldn't open database file biblio.bib? Thanks. – Daniel Vaughan Aug 23 '12 at 3:28

You should place your bibliography files in ~/Library/texmf/bibtex/bib/. The TeXShop documentation says

Personal files should be stored in ~/Library/texmf. (Recall that ~/Library is the library folder in your home directory, while /Library is a system folder analogous to /Applications.) You will have to create the subfolder "texmf." When TeX needs to open a file, it searches ~/Library/texmf first, so if you modify a standard TeX file and place it there, the modified file will be used.

The folder structure inside ~/Library/texmf should mimic that of the texmf trees in your TeX distribution. This is easier than it appears. TeX will locate any file in ~/Library/texmf/tex or in a subfolder of this folder; LaTeX will locate any file in ~/Library/texmf/tex/latex or a subfolder of this folder. Bibtex will locate any file in ~/Library/texmf/bibtex/bib or in a subfolder of this folder. Etc.

TeXShop doesn't always run in the same environment as the shell where you type kpsewhich. It is best to stick to the standard locations recommended by TeXShop.

share|improve this answer
Andrew, thanks so much. Does that mean that the BIBINPUTS command is useless? I'm being able to do something I don't understand: if I use my editor (TextMate or TeXShop) it won't find my .bib file. Nonetheless, if I run everything from the Terminal (bibtex myfile.tex followed by pdflatex myfile.tex) and then go back and Texify the file from the editor, I will be able to get everything right. My guess is that from the Terminal the "right" aux files are generated, and then the Editor does the job well (rather inefficient). Any thoughts on this? Thanks! – Daniel Vaughan Aug 23 '12 at 18:23
When you run bibtex from the terminal it picks up your value of BIBINPUTS and creates the appropriate .bbl file. You can then run pdflatex from your GUI (TextMate or TeXShop) and it will slurp in the information from the .bbl file. It is only bibtex that needs to know the BIBINPUTS variable in this case. As I said, it is simplest to use the standard location expected by TeXShop. – Andrew Swann Aug 24 '12 at 9:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.