5

I am trying to use BibTeX for references. Here is my code.

\documentclass[11pt, a4paper]{article} 
\usepackage[latin1]{inputenc}
\usepackage{graphicx}     
\setcounter{secnumdepth}{0}
\usepackage{cite}

\title{Draft Project Laser Bubbles}
\author{PTB} 
\begin{document}
\maketitle

\abstract{
Optofluidics
}

\section{Theory}

Blablabla said Nobody ~\cite{Nobody06}.

\bibliographystyle{plain}
\bibliography{mybib}{}

\end{document}

And mybib.bib in the same folder:

@article{Nobody06,
  author = "Nobody Jr",
  title = "My Article",
  year = "2006"
}

@article{mrx05,  
author = "Mr. X", 
Title = {Something Great}, 
publisher = "nob" # "ody"}, 
YEAR = 2005, 
}

Error message:

This is BibTeX, Version 0.99d (MiKTeX 2.9)
The top-level auxiliary file: Project-PTB-Draft.aux
The style file: plain.bst
Database file #1: mybib.bib
Warning--I didn't find a database entry for "Nobody06"
(There was 1 warning)

I have tried latex bibtex latex latex (it is my Quick Build at the moment). Any ideas? :)

First problem found: mybib.bib was in the wrong folder. facepalm. Put it in the right folder and it still doesn't work. The current error message:

Process started

This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: Project-PTB-Draft.aux The style file: plain.bst Database file #1: mybib.bib You're missing an entry type---line 1 of file mybib.bib : @ :

Process exited normally

EDIT:

I fixed it! I deleted the old .bib file and made a new one in texmaker. Then it worked!

I guess an encoding problem or something :)

Thanks guys!

  • Hi! Are you calling bibtex mybib or bibtex mytexfile? Because the first way doesn't work, you have to go the second way. – yo' Oct 24 '13 at 12:28
  • 3
    When I do the standard calls (see @tohecz) the MWE compiles without any errors. – Ruben Oct 24 '13 at 12:32
  • 1
    For me the code above compiles without problems (in PDFLaTeX). – Chris Oct 24 '13 at 12:32
  • Make sure that you actually saved your bib. And I would suggest to give the bib a more specific name e.g. petter-2013, so that you can be sure that you are not a editing a copy with the same name in some other place. – Ulrike Fischer Oct 24 '13 at 12:35
  • 1
    @Guido I actually start to doubt that this is the problem. Because the log output from bibtex shows that the call is correct. I more think that PetterTB has a typo his the real document somewhere (for instance mismatched upper/lowercase) – yo' Oct 24 '13 at 12:44
  • 2
    There is an unbalanced brace } in the publisher of the second item, the bibliography command should be just \bibliography{mybib} without the extra {}. Otherwise the posted code compiles fine, just that bibtex warns "Warning--empty journal in Nobody06". – Andrew Swann Oct 24 '13 at 13:00
  • I feel stupid, the mybib.bib was in another folder facepalm. When I moved it to the correct folder, it still doesn't work, tho. The error message changes:

    Process started

    This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: Project-PTB-Draft.aux The style file: plain.bst Database file #1: mybib.bib You're missing an entry type---line 1 of file mybib.bib : @ :

    Process exited normally

    I do have @article in the first line confused

    – PetterTB Oct 24 '13 at 14:14
  • I use the compilation buttons in tex maker. – PetterTB Oct 24 '13 at 14:29
  • @AndrewSwann Fixed that (removed the second item and the braces). Still the same error message. The extra braces were included in the example at the bibtex site. – PetterTB Oct 24 '13 at 14:39
  • Have you tried compiling from the command line instead of from tex maker? Another possibility is that you have mybib.bib several places on the system and the wrong file is being picked up. – Andrew Swann Oct 24 '13 at 18:31

1 Answers1

6

As tohecz said you have to use the following commands to compile your file:

latex texfile
bibtex texfile
latex texfile
latex texfile
pdflatex texfile

where texfile is your file with LaTeX code. If I run your files with these commands it compiles perfectly.

Laura
  • 478