4

I've been googling for hours and found many related issues but still don't understand what's gone wrong. i have run latex and bib at least 1000 times. In the dropdown menu I use "pdflatex" for my latex file and "bibtex" for my bib file. I am using Texworks. Also, I should say this has worked previously on another computer.

here's my bib file:

@article{paper,
author={name},
title="{title}",
journal={J. Phys. Conf. Ser.},
volume={67},
number={},
 pages={23},
 year={2007}
}

and this is my latex file:

\documentclass[a4paper, 12pt]{article}


\begin{document}
\title{Autumn Term Report}
\author{myself}
\date{\today}
\maketitle

  HI
\cite{paper}

\bibliographystyle{unsrt}
\bibliography{trial.bib}
\end{document}

and here's my bbl file (empty! so i think bibtex musn't be compiling)

\begin{thebibliography}{}

\end{thebibliography}

Also, in my output pdf i get a "References" section but the article is not listed there, and there's a question mark where i refer to it in the main body.

  • 2
    It sounds like you're compiling the .bib file ... ? You should not be doing that. You should be running latex, bibtex, latex, and then latex again. bibtex should be run on the .aux file, but it's best if you just don't specify a file extension, depending on how you're calling bibtex. Welcome to TeX.SX! – Adam Liter Apr 26 '14 at 3:13
  • It is not \cite{@paper} but \cite{paper}. Remove @. – user11232 Apr 26 '14 at 3:18
  • 1
    Thanks for your answers :) Sorry on two accounts First, the \cite{@paper} problem is a typo i made when creating this minimal example. Having fixed this now, i still have the same problem. secondly, maybe i'm using incorrect terminology. By "compiling" i mean pressing on the green button with a triangle inside it. I guess that is "running". Anyways, as I said above I have done this about a thousand times without success, including what you've suggested. Both things have been edited in my original post – user50563 Apr 26 '14 at 3:29
  • sorry - my minimal example is now working. however my actual document is still not working. i really don't understand what's going on! – user50563 Apr 26 '14 at 3:53
  • @user50563 - If your real file still won't compile properly (after removing the extension .bib from the argument of \bibliography), I suggest you post a new query in which you condense your "real" file to the minimum amount that still generates the problem (or problems). – Mico Apr 26 '14 at 7:28
6

You have to use \cite{paper} without @. Also, don't use the extension in \bibliography{trial}. Having said this, you have to run this compile sequence assuming that your main file is named myfile.tex

pdflatex myfile
bibtex myfile
pdflatex myfile
pdflatex myfile

Code (myfile.tex):

\documentclass[a4paper, 12pt]{article}
\usepackage{filecontents}
\begin{filecontents*}{trial.bib}
  @article{paper,
author={name},
title="{title}",
journal={J. Phys. Conf. Ser.},
volume={67},
number={},
 pages={23},
 year={2007}
 }
\end{filecontents*}

\begin{document}
\title{Autumn Term Report}
\author{myself}
\date{\today}
\maketitle

  HI
\cite{paper}

\bibliographystyle{unsrt}
\bibliography{trial}    %% no .bib needed
\end{document}

enter image description here

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.