12

I am completely new to using LaTex (I just started a week ago), and I'm using the templates posted on this website. I downloaded all the files, including the .bib file and the .cls file and they are all in the same directory. I am able to compile and display the .tex file, but when it appears, all citations have a [?] in them.

I'm not sure what I'm supposed to do. I'm sure there's a step I'm missing... perhaps there is a special way to use TexShop to make it work? Or am I supposed to use another program? Any help would be greatly appreciated.

  • 1
    Note that for .bib files, you need to compile using the sequence: latex file, bibtex file, latex file (and possibly another latex file). latex can also be substituted with pdflatex or xelatex (depending on your compiler). – Werner Apr 11 '12 at 3:32
23

To get proper citations using TeXShop you need to (at least):

  1. Run LaTeX
  2. Run BibTeX
  3. Run LaTeX
  4. Run LaTeX

LaTeX and BibTeX are selected in the drop-down box next to the "Typeset" button.

Assuming that everything else is correct (packages, .bib file, citation commands), this should give proper citations.

edit: Added an extra LaTeX run after running BibTeX as noted in the comments.

  • 1
    You should usually run latex twice after running bibtex. See Undefined citation warnings. – Alan Munn Apr 11 '12 at 11:07
  • Wow! Thank you so much!!! I didn't realize that I had to compile both the .tex and .bib files. After a few tries, it seems like I need four steps: Latex File, Bibtex file, Latex File, Latex File (again). – Paul Apr 11 '12 at 14:10
1

I am also new to Latex and was having this problem while using TexShop on Mac OS X. I second what's been said above: you need to run Latex, then Bibtex, then Latex twice. Also: you need to ensure that the file name of the .bib file is the same as the .tex file, and in the same directory. You do not need to specify the whole file directory path in the \bibliography{} command, just the file name e.g. \bibliography{my bib.bib} if it is in the same directory as the .tex file. After a lot of tinkering, I've got it to work!

  • 2
    I don't think the .bib file must have the same name as the .tex file, putting the correct name in \bibliography{...} is enough. – CarLaTeX Feb 23 '17 at 9:53
  • Also, it's not necessary to include the extension .bib in the argument of \bibliography. – Mico Feb 23 '17 at 10:25
0

I'm using BibTex, Version 0.99d. In this version, it seems that the name of the .bib file must be the same with the latex file. So if you can't get the BibTex work, try to unify the name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.