33

I have been putting references into my document with no problems until today. Now all of a sudden when I put a new reference in I get two error messages and get told the following:

Package natbib warning: Citation xzy on page x undefined on line y

Package natbib warning: There were undefined citations

I am using windows, MiXTeX 2.9, TeXnic center, and JabRef. I have looked at the bib file that JabRef generates and the citation information is in the file.

The citations I had in previously still compile ok and can be entered in new parts of the document without error. Its just the new citation that I put into the Jabref program today that wont work.

\documentclass{article}

\usepackage[a4paper,hmargin={2cm,2cm},vmargin={2cm,2cm}]{geometry} \usepackage{setspace} \usepackage[maxauthors=20,etalmode=truncate,biblabel=period]{achemso} \usepackage[journal=rsc]{chemstyle} \usepackage{chemscheme} \usepackage[version=3]{mhchem} \usepackage{textcomp} \usepackage{threeparttable} \usepackage{textcomp} \usepackage{lmodern} \usepackage{color, colortbl} \usepackage{array} \usepackage{float} \usepackage{color} \usepackage{soul} \usepackage{picins} \usepackage{graphicx} \usepackage{hyperref} \usepackage{longtable} \usepackage{caption} \usepackage{subcaption}

\begin{document}

text goes here.\cite{Global2013}

\bibliography{References}

\end{document}

The offending part of the .bib file follows:

@TECHREPORT{Global2013,
  author = {Future Markets, Inc},
  title = {The Global Market for Quantum Dots},
  year = {2013},
  owner = {x},
  timestamp = {2013.06.17}
}
Cole
  • 433
  • Are you using for the argument of \cite the exact same key you used in the .bib file? – Gonzalo Medina Jun 16 '13 at 23:02
  • Yes, even copy pasted it to make sure – Cole Jun 16 '13 at 23:16
  • 1
    Can you please edit your question and add a simple complete document showing the relevant settings and allowing us to reproduce the problem? Add the offending entry of the .bib file too. – Gonzalo Medina Jun 16 '13 at 23:18
  • You forgot to add the offending entry of the .bib file. – Gonzalo Medina Jun 16 '13 at 23:35
  • Is that ok? not sure if I have it edited right – Cole Jun 16 '13 at 23:44
  • Almost :-) You said you were using natbib, but your minimal code doesn't load natbib. Also, you didn't include the style used (the line with \bibliographystyle{...}). – Gonzalo Medina Jun 16 '13 at 23:52
  • Dont know what I need to put in to load natbib. I don't have anything in my file with \bibliographystyle{...} – Cole Jun 17 '13 at 00:00
  • @Please do a test using the example document on my answer below. Save the file exactly as it is as, for example, mybibtest.tex, and then run pdflatex+bibtex+pdflatex+pdflatex. Do you get the same result as in the image I attached or do you get error(s)/warning(s)? Please report the outcome. – Gonzalo Medina Jun 17 '13 at 00:16
  • I get the image you attached – Cole Jun 17 '13 at 00:47
  • then the problem is elsewhere. Do you have any problems in your document after adding the \bibliographystyle{...} line? – Gonzalo Medina Jun 17 '13 at 00:50
  • Yea, it says Package achemso warning: \bibliographystyle{...} ignored – Cole Jun 17 '13 at 02:04
  • So you are using some packages. That's why I asked for a minimal document with the relevant settings and allowing us to reproduce the problem mentioned. Without this information is really hard to provide effective help. Edit the question, and make sure you include all relevant settings. – Gonzalo Medina Jun 17 '13 at 02:34
  • My apologies, I have put in all the packages I am using. Is there anything else I need to put in? – Cole Jun 19 '13 at 04:42

3 Answers3

36

The package natbib is automatically loaded by the achemso package. That's why you get those warnings from the natbib package.

Supposing that your .tex file is named test.tex, I suggest you first to delete the files test.aux and test.bbl.

After that, run, in the following sequence:

pdflatex test

bibtex test

pdflatex test

pdflatex test

You shouldn't have problems with the MWE you've provided.

Also remember that the achemso package automatically loads the achemso bibliography style, which is the same as inserting the line

\bibliographystyle{achemso}

so you don't have to add such a line in your document.

karlkoeller
  • 124,410
  • 1
    This worked perfectly for me. Texworks' default option is pdfLaTex+MakeIndex+BibTex, which is not the same as what is in this answer, so if you are having this issue, make sure you run pdfLaTex+BibTex+pdfLaTex+pdfLatex. There must be a way to add this sequence as a shortcut, but I'm not sure how. – Vivek Subramanian Jul 26 '18 at 05:31
  • to sum it up run bibtex yourfile everytime you add a new citation! – Greenish Oct 30 '18 at 18:18
  • All about the order of compilation. First bibtex then latex. – Shawyan Azdam Nov 06 '19 at 14:17
9

I had this message pop up in my console output for all my citations, although the bibliography and citations displayed correctly in the TeXworks pdf preview.

In my case, I had a few references in my .bib file where words with diacritics weren't surrounded in curly braces. Changing all such instances got rid of the messages. For example:

publisher = {Universidad Nacional de Río Negro},

Changed to:

publisher = {Universidad Nacional de {Río} Negro},

arjan
  • 211
1

I met this problem. After checking the code, I found that I accidentally deleted the code \bibliographystyle{ACM-Reference-Format} \bibliography{bibfile}. Make sure you have defined the bibliography style and bibliography file first. :)