36

My article paper.tex compiles fine, but myBib.bib doesn't.

$ pdflatex paper.tex
$ bibtex myBib
I couldn't open file name `myBib.aux'

I happen to be using TeXShop, but the command line is unambiguous.

Thanks in advance.

  • 21
    bibtex paper rather than bibtex myBib. – Ian Thompson Jul 25 '12 at 20:58
  • 4
    @NickVence myBib.bib is only a database, which may contain many entries that you don't cite in your paper. It's in paper.tex that you tell the system what bibliographic database to use (with \bibliography{myBib}). So it's paper which you must run BibTeX on (precisely paper.aux, but the extension can be omitted). – egreg Jul 25 '12 at 23:04
  • 1
    A solution can be found here if you use a build subfolder for compiling. – Alexandre Willame Sep 7 '14 at 19:15
15

In addition to Ian Thompson's comment, if you are using TeXShop then you don't even have to bother with the command line, as TeXShop provides you with a graphical interface. Just switch to BibTeX in the pop-up menu after a first LaTeX compilation, then press typeset (this is equivalent to calling bibtex paperin the command line) exactly as for a LaTeX compilation, then switch back to LaTeX and press Typeset (equivalent to command line pdflatex paper.tex; two compilations are needed).

  • i dont understand i've tried texshop and texworks and opening my .tex file with both and opening my .bib file with both and tapping typeset and nothing changes i still get [?] which is the same output i get with the green play button using textworks – user1709076 Jan 24 at 0:34
9

That will resolve the problem ;) :

pdflatex paper.tex
bibtex paper.aux
pdflatex paper.tex
evince paper.pdf
2

In my case, my latx file contains of many files. So when I tried to compile the bibliography.bib file directly without switching to the main document file (thesis.tex) I got the error. The solution is to compile the document from the main file (thesis.tex). enter image description here

  • That's why they added the function "Options"->"Set current document as 'Master Document'". If you're clicking this while the main .tex file is open, you can compile everywhere – CharlyDelta Mar 7 '16 at 9:13

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.