Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to run bibtex from a different directory than my .bib file. According to the description in 'man bibtex', I should be able to set the envirorment variable BIBINPUTS to include the location of my .bib file. This is not working for me. What am I doing wrong?

$ # Mac OS X 10.7.4
$ bibtex -v
BibTeX 0.99d (TeX Live 2012)
kpathsea version 6.1.0
$BIBINPUTS=/path/to/directory
$bibtex mypaper
The style file: plain.bst
I couldn't open database file thesis.bib
---line 62 of file mypaper.aux
: \bibdata{thesis
:                  }
I'm skipping whatever remains of this command
I found no database files---while reading file mypaper.aux
Warning--I didn't find a database entry for "Hamlet"
Warning--I didn't find a database entry for "SP"
Warning--I didn't find a database entry for "Lbook"
Warning--I didn't find a database entry for "companion"
Warning--I didn't find a database entry for "book"
Warning--I didn't find a database entry for "Metafont"

I am certain that thesis.bib exists in /path/to/directory.

Is there any way I can verify directory bibtex is trying to read from?

share|improve this question
    
Something like kpsewhich -var-value BIBINPUTS? Also, don't you want to export your new value? –  jon Aug 15 '12 at 1:32
    
ah, I think I definitely want export. Thanks. I'll give that a shot in about 30 min. I've looked up kpsewhich too and I see how that can help be further troubleshoot. –  NoahR Aug 15 '12 at 2:52

1 Answer 1

up vote 6 down vote accepted

Thank you @jon.

To use BIBINPUTS with bibtex, it must be exported to the environment passed to the child process. So

$export BIBINPUTS=/path/to/directory
$bibtex mypaper
share|improve this answer
    
Perhaps you should add to use a .bib file 'in a non-standard area, outside your working directory' (or the equivalent). The kpsewhich -var-value BIBINPUTS will let you see where bibtex expects to find .bib files. (Not sure how/if that works on Windows....) –  jon Aug 15 '12 at 3:45

Your Answer

 
discard

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.