34

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}
}
13
  • Are you using for the argument of \cite the exact same key you used in the .bib file? Commented Jun 16, 2013 at 23:02
  • Yes, even copy pasted it to make sure
    – Cole
    Commented Jun 16, 2013 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. Commented Jun 16, 2013 at 23:18
  • You forgot to add the offending entry of the .bib file. Commented Jun 16, 2013 at 23:35
  • Is that ok? not sure if I have it edited right
    – Cole
    Commented Jun 16, 2013 at 23:44

3 Answers 3

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.

3
  • 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. Commented Jul 26, 2018 at 5:31
  • to sum it up run bibtex yourfile everytime you add a new citation!
    – Greenish
    Commented Oct 30, 2018 at 18:18
  • All about the order of compilation. First bibtex then latex. Commented Nov 6, 2019 at 14:17
10

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},

1
  • Lifesaver. For anybody exporting their bibliography from Zotero, you can prevent the issue by changing the character encoding mode from UTF-8 to Western. Commented Apr 21 at 18:42
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. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .