[Tex/LaTex] Placing a .bib file in a package folder – TeXWorks can’t find it

bibtexfolderstexworks

I have created a courses.bib database file for all my course litterature, which I have placed along with a package of mine named tlnames.sty that defines some related macros. The folder in which both files reside is ~/documents/texlive/texmf/tex/latex/tlnames.

I'm compiling this from inside TeXWorks using a modified version of the LaTeXmk script, which works fine except for the bibliography – it can't find courses.bib. Finding tlnames.sty works OK – I can import the package and use macros from it.

I have, since I placed courses.bib there, run texhash ~/documents/texlive/texmf and recievd the following output

$ texhash texmf
texhash: Updating /home/tomas/documents/texlive/texmf/ls-R... 
texhash: Done.

Why is this not working? What do I need to do to help BiBTeX find my database?

For completeness of the question: I'm running Ubuntu 12.04, with TeX Live 2011 and TeXWorks version 0.5 r.952.

Best Answer

(Still running 11.10, but....)

I wouldn't put my .bib file there. If you want a system-wide solution, try running this command from the terminal:

kpsewhich -var-value BIBINPUTS

For me, that gives me a bunch of choices, including

~/home/<username>/texmf

So if I add a file like test.bib to:

~/home/<username>/texmf/bibtex/bib/

BibTeX and/or Biber can find this file even without using texhash. (This works from within emacs and from a terminal; I don't have TeXWorks.)