Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Help with BibTeX and TeXShop

Help with BibTeX and TeXShop
Thread Tools
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 16, 2002, 04:22 PM
 
I've been trying to get BibTeX working with TeXShop but I just can't find the directions on what it is supposed to do, much less how to do it.

Can anyone explain how I go from a BibTeX database file to using it to create a bibliography in a TeXShop document, and having citations? There is some mention that they "link", but no documentation on how to do anything.

Again, I have the bibliography entries in a BibTeX file, and I have a LaTeX document in TeXShop. How do I add the bibliography into the file somewhat automatically so that I can manage them with BibTeX and they will be generated in the TeXShop document. Anyway?
"It's about time trees did something good insted of just standing there LIKE JERKS!" :)
     
Dedicated MacNNer
Join Date: Dec 2001
Location: Bolton, UK
Status: Offline
Reply With Quote
Apr 16, 2002, 06:56 PM
 
1. Put the citations in your .tex file in the form \cite{<key>}. Papers you have not cited will not appear in the bibliography.

2. Put \bibliography{<bibfilename>} in your .tex file where you want the bibliography to appear. Make sure the .bib file is somewhere that latex can find it, such as the same folder as the .tex file.

3. Run latex then bibtex then latex then latex again, all on your .tex file (actually you run bibtex on the .aux file, but texshop does this for you).

Check the results.

For more details, see appendix B of the latex book, or chapter 13 of the latex companion.

Barney.
     
Brazuca  (op)
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 16, 2002, 08:25 PM
 
Originally posted by barney ntd:
<STRONG>1. Put the citations in your .tex file in the form \cite{&lt;key&gt;}. Papers you have not cited will not appear in the bibliography.

2. Put \bibliography{&lt;bibfilename&gt;} in your .tex file where you want the bibliography to appear. Make sure the .bib file is somewhere that latex can find it, such as the same folder as the .tex file.

3. Run latex then bibtex then latex then latex again, all on your .tex file (actually you run bibtex on the .aux file, but texshop does this for you).

Check the results.

For more details, see appendix B of the latex book, or chapter 13 of the latex companion.

Barney.</STRONG>
Thanks Barney. I acutally followed what you said to the letter and it worked perfectly. Shouldn't it be a bit less redundant? I'm sure they'll fix it in the future.

Now, is there a way to have the bibliography print the entire database instead of only those entries that are cited? There are many sources that I've consulted but that I don't want to explicitly quote on the text. I can't find that option.

Also, how do I change the format shown in the output from the [1] to something more like (Lastname:97) ? I"m using the {plain} bib style and it looks too complex for me to hack it.
"It's about time trees did something good insted of just standing there LIKE JERKS!" :)
     
Dedicated MacNNer
Join Date: Dec 2001
Location: Bolton, UK
Status: Offline
Reply With Quote
Apr 17, 2002, 08:24 AM
 
To put an uncited reference in the bibliography, use \nocite{&lt;key&gt;} anywhere in the .tex file. To put everything in, use \nocite{*}. The idea is that all your references can be in one .bib file, and only those which you need for this paper get included.

To change the way references look, use \bibliographystyle{&lt;bstfilename&gt;}. If you have installed teTeX, there will be lots of .bst files in teTeX/share/texmf/bibtex/bst/. Try them all; if there isn't one you like, you'll have to write your own, which is not that easy. You should really use the one recomended by your publisher.

There are also certain packages (.sty files) which alter the way references appear, and some of the bibliography styles have packages which go with them. Look in teTeX/share/texmf/tex/latex for .sty files, or get hold of a copy of the latex companion, which describes lots of them.

The reason for the redundancy is in the way latex works. The first run of latex puts all the \cites into the .aux file. Bibtex reads the .aux file, and creates a .bbl file containing the actual bibliography. The second run of latex inserts the .bbl file into your paper, and puts the references into the .aux file. The final run of latex gets the cross-references right.

This means that you only need to run bibtex again if you change which papers you cite. If you add or remove citations, you have to go through the latex, bibtex, latex, latex business again, but otherwise you just run latex as normal (sometimes twice if cross-references have changed). You can look at the .bbl file to see the latex source for your bibliography, and even edit it if you like, though it will get overwritten if you run bibtex again.

Barney.
     
Brazuca  (op)
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 17, 2002, 09:09 AM
 
Originally posted by barney ntd:
<STRONG>To put an uncited reference in the bibliography, use \nocite{&lt;key&gt;} anywhere in the .tex file. To put everything in, use \nocite{*}. The idea is that all your references can be in one .bib file, and only those which you need for this paper get included.

To change the way references look, use \bibliographystyle{&lt;bstfilename&gt;}. If you have installed teTeX, there will be lots of .bst files in teTeX/share/texmf/bibtex/bst/. Try them all; if there isn't one you like, you'll have to write your own, which is not that easy. You should really use the one recomended by your publisher.

There are also certain packages (.sty files) which alter the way references appear, and some of the bibliography styles have packages which go with them. Look in teTeX/share/texmf/tex/latex for .sty files, or get hold of a copy of the latex companion, which describes lots of them.

The reason for the redundancy is in the way latex works. The first run of latex puts all the \cites into the .aux file. Bibtex reads the .aux file, and creates a .bbl file containing the actual bibliography. The second run of latex inserts the .bbl file into your paper, and puts the references into the .aux file. The final run of latex gets the cross-references right.

This means that you only need to run bibtex again if you change which papers you cite. If you add or remove citations, you have to go through the latex, bibtex, latex, latex business again, but otherwise you just run latex as normal (sometimes twice if cross-references have changed). You can look at the .bbl file to see the latex source for your bibliography, and even edit it if you like, though it will get overwritten if you run bibtex again.

Barney.</STRONG>
Great! This helped out a lot. I actually understand how it works and even managed to get it working. It's not hard, though it should be simpler.

Btw, for anyone else that reads this and wants to format their own .bst file: there is a "script" that takes you step by step on each of the format options and creates a .bst file exactly how you want it. You can specify little details such as where the publisher and date go, if there are commas after the titles, how the authors' names get displayed, etc.
It's called custom-bib and you can find instructions on how to use it here: custom-bib instructioins
Note that the page is geared for users of SWP, but custom-bib requires only a TeX installation (such as LaTeX).
The instructios are also found in the ReadMe file found in the custom-bib package itself.

Get the package here: custom-bib tar file from this page (sorry, ubb code is not working well):

URL=http://www.ctan.org/getfile/?filename=macros/latex/contrib/supported/custom-bib/&preferredCTAN=ctan.unsw.edu.au&action=/tools/filesearch&catstring=macros/latex/contrib/support ed/custom-bib/

Thanks to all those above who helped out.

edit: looks like ubb code is not working right.

[ 04-17-2002: Message edited by: Brazuca ]
"It's about time trees did something good insted of just standing there LIKE JERKS!" :)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 11:24 AM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2