[Tex/LaTex] texi2dvi: “I couldn’t open database file…” (strange behavior with relative paths to .bib file)


When I use texi2dvi -p --tidy foo.tex where foo.tex contains \bibliography{/home/user/.../mybib.bib}, everything works as expected, mybib.bib is found and references inserted in foo.pdf. Also, when mybib.bib is in the same folder as foo.tex and I use \bibliography{mybib.bib}. However, if mybib.bib is one directory level above foo.tex and I use \bibliography{../mybib.bib}, texi2dvi with the option --tidy (as given above) is not working anymore, it gives:

I couldn't open database file ../mybib.bib
---line 3 of file foo.aux
 : \bibdata{foo-blx,../mybib
 :                           }
I'm skipping whatever remains of this command

How can I specify relative paths in \bibliography so that texi2dvi with option --tidy does not fail?

Best Answer

Okay, I have it (fairly simple after all). Since the bib(la)tex-related files are in foo.t2d/pdf/build, the relative path in \bibliography should be: ../../../../mybib.bib for mybib.bib to be found.

Related Question