[Tex/LaTex] Unable to generate references using .bib in Texlipse

bibliographiesbibtexerrors

I'm writing a LaTeX file using Texlipse.
So here is my LaTeX file:

\documentclass[10pt,psfig,letterpaper,twocolumn]{article}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{natbib}
\usepackage{verbatim}
\usepackage[scaled=0.9]{helvet}
\singlespacing
\paperwidth 8.5in
\paperheight 11in
\oddsidemargin 0in
\headsep 1.3cm 
\geometry{left=0.75in,top=0.75in,right=0.75in,bottom=1in}
\textwidth 7in 
\textheight 9.25in
\columnsep 0.4in
\footskip 0in 
\renewcommand{\bibname}{REFERENCE}
\pagestyle{empty} 
\begin{document}
\bibliographystyle{acm} 

\title{\fontfamily{phv}\selectfont{\huge{\bfseries{Title here}}}} \author{
{\fontfamily{ptm}\selectfont{\large{\bfseries{author name}}}}\thanks{contact
info }}

\maketitle
\thispagestyle{empty}

\section*{\fontfamily{phv}\selectfont{\normalsize{\bfseries{Section name}}}}

\begin{figure}
\centering
\includegraphics[width=3in]{fig1.png}
\caption{Caption}
\label{Fig.1}
\end{figure}

\pagebreak[4]
\vspace*{5.52in}
\bibliography{ref}
\end{document}

and here is my .bib file:

@BOOK{notsurewhatitisfor,
   author = "Author's name",
   title = "Book's title",
   publisher = "Springer",
   year = 2011
   }

@Article{notsurewhatitisfor,
  author =       {author's name},
  title =        {article's title},
  journal =      "EEEE",
  year =         {2011},
  volume =    {1},
  number =    {1},
  month =     {},
  pages =     {4-27},
  note =      {},
  annote =    {}
}

The bib file is named ref.bib and was copied to the same folder with the .tex file. However, I have nothing generated in the References section.

Here is the message in the console that I think is relevant:

pdflatex>(./document.bbl
pdflatex> 
pdflatex> Package natbib Warning: Empty `thebibliography' environment on input line 3.
pdflatex> 
pdflatex> )

I noticed that the document.bbl in the tmp folder is empty.
Can someone please let me know where the problem is?

Best Answer

To get something in the references, you have to cite it. The generic command for this is \cite, and the argument to the command is what you have called notsurewhatitisfor in your bibfile. In other words, you want this key to be different for each entry in your bib-file, and then you can use \cite{notsurewhatitisfor} to cite that article/book/whatever.

If you don't want to put a reference in your text, just fill up the References section with all the entries in your bibfile, you can use \nocite{*}.


Another thing to note, is if one doesn't use an IDE/script that handles the compilation sequence, one has to compile the document in four steps to have the bibliography and citations show up correctly. TeXlipse does this for you, but if it didn't, you would have to go through the following sequence:

pdflatex file.tex
bibtex file.aux
pdflatex file.tex
pdflatex file.tex

Roughly what happens is this:

  1. On the first run of pdflatex (or latex, xelatex, lualatex), every occurrence of a \cite command will be written to a temporary file, called file.aux.

  2. When you run bibtex on this file (specifying the file ending, .aux isn't necessary), the BibTeX program will find all these occurrences in the .aux file, find the entries in the .bib file corresponding to them, and write a .bbl file that contains the References section, with the entries sorted according to the bibliography style you have chosen.

  3. On the second rund of pdflatex, this .bbl file will be read, and the References section will be printed in the document.

  4. On the final run of pdflatex the citations will be put in.

As mentioned, I guess TeXlipse does all of this for you automatically if necessary, but I thought it could be nice to add a quick explanation of what's happening.
https://imathworks.com/tex/tex-latex-unable-to-generate-references-using-bib-in-texlipse/
imathworks.com
CC-MAIN-2023-06
25727
application/http; msgtype=response
sha1:5H6WSCVHONLXW2INEQ256RHZGYT5FO2C
<urn:uuid:96534205-e97a-4911-aa99-9c016ed0610b>
2023-01-28T14:09:07Z
45.77.5.190
text/html
sha1:VIE45FDVH3IYH6XXG2GNDEXM34PWKORO
<urn:uuid:0724b824-7b61-468e-899b-5c68838e1835>
https://imathworks.com/tex/tex-latex-unable-to-generate-references-using-bib-in-texlipse/
response
<urn:uuid:ece805b5-06dc-4a75-a148-4bce68a2806b>
isPartOf: CC-MAIN-2023-06
publisher: Common Crawl
description: Wide crawl of the web for January/February 2023
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-142
software: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/