3

I am writing a report in Latex, and I have the references in a separate bib file and I reference them in my main document as \cite{xxx}.

I am using Texworks on Windows. After compiling the bib to generate a bbl, when I compile the tex file with: "pdflatex + MakeIndex + BibTex", I am able to see the pdf the report, but I do not see the Bibilography section at the end and do not see references to the bibliography, not even question marks instead of the proper references to the bibliography.

I include the bibliography by typing

 \bibliography{plain}

and

 \bibliography{"C:/Users/BibName"}

at the end of the tex file

I then tried pdflatex + bibtex + pdflatex + pdflatex. When I tried that, the 'References' section shows up at the end, but I do not see the references, such as

1. Reinhard, D.A. Case Study

I also do not see the citation in the paper

Here is the MWE: The tex is:

\documentclass{article}  
\begin{document}  
Alpha particles \cite{example} (named after and denoted by the first letter in the
Greek alphabet,\[\alpha\]) consist of two protons and two neutrons bound
together.
This means that an particle is a helium nucleus. 

\bibliography{plain}
\bibliographystyle{plain}
\bibliography{BibName}

\end{document}

The bib is:

@article{example,
  author = {Knuth, Donald E.},
  year = {1986},
  title = {The \TeX book},
}

What am I doing wrong?

migrated from stackoverflow.com Dec 12 '14 at 12:11

This question came from our site for professional and enthusiast programmers.

  • This should work. Since it's not, we'll require more information. What does the .log say? What about the output from BibTeX? Can you compose a minimal working example (MWE) that replicates the problem that we can copy-and-paste-and-compile and see exactly what you're seeing? – Werner Dec 12 '14 at 0:48
  • I do see some errors in the output, such as ! LaTeX Error: File natbib.sty' not found. and todonotes.sty not found, but I thought these were insignificant since it still produces the pdf at the end, containing everything as expected, except for the 'references' section – user4352158 Dec 12 '14 at 1:21
  • My MWE is now in the OP – user4352158 Dec 12 '14 at 1:21
  • Please read this post to see how to create a minimal example that includes the use of a bibliography. – Werner Dec 12 '14 at 3:54
  • 1
    The \bibliographystyle is required, since it specifies which .bst to use to create the .bbl from the .bib. Without it, BibTeX would not now how to format the bibliography. You should also see this being reported as problematic in the BibTeX output (or your .blg file). – Werner Dec 12 '14 at 7:36
2

\bibliography{<file>} denotes the name of the <file>.bib that contains your BibTeX references, while \bibliographystyle{<bibstyle>} denotes the style you want your references displayed in. You clearly want one \bibliography only:

enter image description here

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{references.bib}
@article{example,
  author = {Knuth, Donald E.},
  year = {1986},
  title = {The {\TeX} book},
}
\end{filecontents*}

\begin{document}  
Alpha particles~\cite{example} (named after and denoted by the first letter in the
Greek alphabet,~$\alpha$) consist of two protons and two neutrons bound
together. This means that an particle is a helium nucleus. 

\bibliographystyle{plain}
\bibliography{references}

\end{document}
-1

Maybe this helps (something really basic that maybe you already did, but if don't it can crack your head off).

Try avoiding spaces in names of .tex and .bib, both. It generates names with spaces also in .aux, .bbl etc.

I had the same problem: Long .tex and .bib files with a final .pdf with question marks instead of referencies, and messages like Warning--I didn't find a database entry for "XXXX" and Package natbib Warning: There were undefined citations.. No .bbl at all and no answer about when surfing the web.

At the end, I just copy/paste everything to a new folder in new files (trying to avoid unknown characters) and changed even names. It magically worked just because the new name didn't have spaces (test.tex instead of pritty work for my lovely boss v_342.tex).

N. of R.: I'm working under Windows and this happend to me only using TeXworks. In an old PC (also under Windows plattform), that I don't use because it has less reaction than a slug, it works perfectly even with spaces in names, so I suppose that is because I had TeXnicCenter in my old PC. BTW, using TeXnicCenter you just have to compile several times but with a unique compiling option (LaTeX=>PDF); using TeXworks you have to compile with pdfLaTeX, then with BibTeX and finally twice with pdfLaTex again, always the .tex file.

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.