[Tex/LaTex] Latex cannot read the bib file

bibliographies

I cannot make Latex read my bib file
here is the code

\documentclass[10pt]{article}
\begin{document}
Hello
\cite{Willis2009} 

\bibliographystyle{dcu} 
\bibliography{1_ref_bib}

\end{document}

Willis2009 is in the bib file

Best Answer

The code below works.

The dcu bibliography style is part of the harvard package. Be sure to load either harvard or the natbib/har2nat pair of packages in the preamble. The filecontents business is just in lieu of a "real" bib file; you can take that stuff out if you already have a bib file.

EDIT

Run latex (pdflatex, xelatex, lualatex, whatever), then bibtex, then latex twice more. Your bib file should be in the same folder as your latex file.

\documentclass{article}

\usepackage{harvard}

\usepackage{filecontents}
\begin{filecontents}{1_ref_bib.bib}
@article{Willis2009,
    author={Willie Willis},
    title={How much wood would a woodchuck chuck if a woodchuck would chuck wood?},
    year={2009}
}
\end{filecontents}

\begin{document}
    Hello
    \cite{Willis2009} 

    \bibliographystyle{dcu} 
    \bibliography{1_ref_bib}

\end{document}
Related Question