BibTeX, biblatex and biberproblems with bib.... help,please

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

problems with bib.... help,please

Post by man2011 »

Dear Guys,
What should I do if I wan to have one copy of my bibliography
Now I have one folder in this
/Users/XXX/Desktop/phd
inside that folder I have two folders one is
/Users/XXX/Desktop/phd/folder 1

and another folder is
/Users/XXX/Desktop/phd/folder 2

Now in each folder I have one .bib (my bibliography) because I use them in my latex works
the problem whenever I add some information to one bib (e.g. add another article information) I have to do the same in the other bib in the second folder

my question is how I have one bib that I can use in a latex work either this .tex file has been saved on folder 1 or folder 2...?

so there is no need for me to do a change in each bib..
Last edited by man2011 on Thu Jan 20, 2011 8:05 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

problems with bib.... help,please

Post by frabjous »

It's probably best to put in your home texmf folder. I'm assuming you're using a mac. The folder is probably /Users/XXX/Library/texmf/, but it might be /Users/XXX/texmf depending on how you installed TeXlive. You can find out by using the following command from inside a terminal:

Code: Select all

kpsewhich -var TEXMFHOME
Go into the folder it spits out (create it if need be). Create a subfolder called bibtex, and a subfolder of that called bib, so the final folder will either be:

Code: Select all

/home/XXX/texmf/bibtex/bib/
or

Code: Select all

/home/XXX/Library/texmf/bibtex/bib/
depending on what the earlier command told you. Put your bib file in there.

A bib file in there should always be readable, no matter where the file you're working on is.

If it doesn't work at first, try running

Code: Select all

texhash /usr/XXX/Library/texmf
(or the same without Library if need be). Then it should work.

IF you're really set on having all the files in subdirectory of your phd folder instead, then I'd suggest using symlinks. I don't know enough about macs about how you create symlinks using its File Manager, but from the Unix terminal if you do:

Code: Select all

ln -s "/Users/XXX/Desktop/phd/folder 1/references.bib" "/Users/XXX/Desktop/phd/folder 2/references.bib"
Then the file "references.bib" in folder 2 will be "linked" to the "real" file in folder 1, and the system will treat them as the same file, so if you edit one, the edits will show up on the other as well.
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

Re: problems with bib.... help,please

Post by man2011 »

thank you for your help


it is working now so there is no need for me to put a info.bib file if i use latex so every time i work on a tex and I put this command in tex file ??
\bibliography{info}
it goes immediately in the info.bib that I have created in
/Users/XXXX/Library/texmf/bibtex/bib.. is that so?

??

thank you so much for your help
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

problems with bib.... help,please

Post by frabjous »

It should find it there, yes.

If there are other

The command:

Code: Select all

kpsepath bib
from a terminal will tell you what folders it searches for bib files and in what order. Notice that the first one there is probably ".", which means the active directory, so it'll probably start by looking for info.bib in that folder, and then move through the others. But one of them will the folder you now put info.bib into.

So if there's another copy of info.bib in the active folder, it will use that. If not, it'll look through the other folders listed.
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

problems with bib.... help,please

Post by man2011 »

hi
I did what you said and this is what I have got.. what does that mean??

Code: Select all

Last login: Thu Jan 20 20:31:40 on console
Muhammad-Alzaidis-iMac:~ muhammadalzaidi$ kpsepath bib
.:/Users/muhammadalzaidi/Library/texlive/2010/texmf-config/bibtex/bib//:/Users/muhammadalzaidi/Library/texlive/2010/texmf-var/bibtex/bib//:/Users/muhammadalzaidi/Library/texmf/bibtex/bib//:!!/usr/local/texlive/2010/texmf-config/bibtex/bib//:!!/usr/local/texlive/2010/texmf-var/bibtex/bib//:!!/usr/local/texlive/2010/texmf/bibtex/bib//:!!/usr/local/texlive/2010/../texmf-local/bibtex/bib//:!!/usr/local/texlive/2010/texmf-dist/bibtex/bib//
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

problems with bib.... help,please

Post by frabjous »

That's a list of folders separated by ":". It means that when you use the command:

Code: Select all

\bibliography{something}
in one of your documents, and then call BibTeX, BibTeX will look for a file named something.bib in the following folders:

1. The folder ".", which is a funny name for the folder you're currently in, i.e., the folder containing the .tex document. If it doesn't find it there, it moves to the next one on the list.

2. It then looks in "/Users/muhammadalzaidi/Library/texlive/2010/texmf-config/bibtex/bib/". If it doesn't find it there, then...

3. It then looks in "/Users/muhammadalzaidi/Library/texlive/2010/texmf-var/bibtex/bib/". If it doesn't find it there, then ...

4. It then looks in "/Users/muhammadalzaidi/Library/texmf/bibtex/bib/" (which is the folder I suggested you use). It it doesn't find it there, it moves on the others...

And so on. The first folder in that list containing a file named something.bib is the folder containing the version that it will use.
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

Re: problems with bib.... help,please

Post by man2011 »

thank you so much for your help.. :mrgreen:
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

Re: problems with bib.... help,please

Post by man2011 »

sorry
How can I do the same thing for including external images

rather than include the image which is in the same folder of the tex.file so i wan to download all the images I need in one folder and whenever I use this command in any tex.file, latex will find it

\includegraphics{XX}
Last edited by man2011 on Sat Jan 22, 2011 12:59 pm, edited 1 time in total.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

problems with bib.... help,please

Post by frabjous »

I would put images you want to reuse for multiple documents in /Users/XXX/Library/texmf/tex/generic/ -- but they can go anywhere in the result of "kpesepath pict".

(The graphicx package, however, also has a \graphicspath command you can use to customize this if you want. See its documentation.)
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

Re: problems with bib.... help,please

Post by man2011 »

oh thank you so much for your wonderful help and patience :D

I did your first advice and it is working now... brilliant

thank you a lot for your help again :D
Post Reply