GeneralUsing a BIB file in a different directory

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Using a BIB file in a different directory

Post by curiouslearn »

Does someone know how to use a .bib file which resides in another directory. For example, my LaTeX file is in C:/latexfile and the .bib file is in C:/bibfile. Suppose the name of the .bib file is refer

I tried

(1) \bibliography{C:/bibfile/refer}
(2) \bibliography{C:/bibfile/refer.bib}
(3) \bibliography{"C:/bibfile/refer.bib"}

None of the above work. The bibliography is not compiled. However, if I put the refer.bib file in C:/latexfile then everything works fine.

I would ideally like to have a single .bib file in one place and use it for my manuscripts which are spread out in different directories.

Thanks in advance for your help.
Last edited by curiouslearn on Tue Jan 08, 2008 8:58 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Using a BIB file in a different directory

Post by balfonsi »

I see two possibilities: 1) launch bibtex with a switch: --enable-directory=... 2) there is an environment variable used by bibtex: BIBINPUTS qui contains extra paths fo fonding bib files.Specify your path in either way. All this corresponds to the MiKTeX distribution, but there must be the ananlogue for other distributions as well.

Regards,
B.A
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Using a BIB file in a different directory

Post by Juanjo »

I haven't now at hand a Windows PC to try, but I wonder if the problem is simply a bad typing of the path. If the directory of the bib file is supposed to be C:/bibfile, the path to refer.bib should be C:/bibfile/refer.bib. Logically, none of the options (1), (2) and (3) can work. Maybe \bibliography{C:/bibfile/refer} does the trick.
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Using a BIB file in a different directory

Post by curiouslearn »

Thanks to both of you for replying. balfonsi, I am not sure how to implement either of your steps, but I will try to lookup on the web. In case it is not too much of a problem, can you please elaborate on the first method that you suggest.

Juanjo, I had made a mistake in typing out the example here. The path was complete when I tried those options. I have edited the example that I posted here.
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Using a BIB file in a different directory

Post by balfonsi »

I know how to implement (I think) under MiKTeX. Do you use this distribution? You also may add C:\bibfile to the path. Which editor do you use? It might be more or less simple for me, according to the one you use.

BIBINPUTS can be specified in System Properties->'Advanced' tab -> 'Environment variables' button (I'm not sure of the exact names, as I'm translating from french).

Regards,
B.A.
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Using a BIB file in a different directory

Post by curiouslearn »

Balfonsi,

Yes I am using MiKTeX. I am using Winedt for the editor. The operating system is Win XP. When you say that I can add C:/bibfile to the path, do you mean adding it to the PATH in My Computer -> Properties -> Advanced ->Enivronment Variables ->System Variables ->Path.

Thanks for your help.
Post Reply