Consider this code:
\documentclass{article}
\usepackage{filecontents}
%\begin{filecontents*}{\jobname.bib}
%@article{gander2001,
% author={Gladstone Gander},
% title={How to be lucky},
% journal={Nature},
% pages={1-33},
% volume={42},
% year={2001},
%}
%@article{ducks2002,
% author={Donald Duck and Fethry Duck},
% title={How to be unlucky},
% journal={Nature},
% pages={34-44},
% volume={43},
% year={2002},
%}
%@book{scrooge1901,
% author={Scrooge McDuck},
% title={My first golden nugget in {Klondike}},
% publisher={Yukon Press},
% address={Whitehorse},
% year={1901},
%}
%@book{scrooge1990,
% author={Scrooge McDuck},
% title={How to manage zillion of dollars},
% publisher={McDuck Press},
% address={Duckburg},
% year={1990},
%}
%\end{filecontents*}
\begin{document}
You should use a \verb|\cite{bib key}| in your document%~\cite{scrooge1901}.
To print all the references in the bib file without citing them in the text, use
\verb|\nocite{*}|. %\nocite{*}
You should also specify a bibliography style and provide a .bib file as below.
%\bibliographystyle{unsrt}
\bibliography{\jobname}
\end{document}
If you run pdflatex and then bibtex on this file, one will get this error message by bibtex:
This is BibTeX, Version 0.99dThe top-level auxiliary file: doi.aux
I found no \citation commands---while reading file doi.aux
I found no \bibstyle command---while reading file doi.aux
(There were 2 error messages)
Now uncomment all commented things:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{gander2001,
author={Gladstone Gander},
title={How to be lucky},
journal={Nature},
pages={1-33},
volume={42},
year={2001},
}
@article{ducks2002,
author={Donald Duck and Fethry Duck},
title={How to be unlucky},
journal={Nature},
pages={34-44},
volume={43},
year={2002},
}
@book{scrooge1901,
author={Scrooge McDuck},
title={My first golden nugget in {Klondike}},
publisher={Yukon Press},
address={Whitehorse},
year={1901},
}
@book{scrooge1990,
author={Scrooge McDuck},
title={How to manage zillion of dollars},
publisher={McDuck Press},
address={Duckburg},
year={1990},
}
\end{filecontents*}
\begin{document}
You should use a \verb|\cite{bib key}| in your document~\cite{scrooge1901}.
To print all the references in the bib file without citing them in the text, use
\verb|\nocite{*}|. \nocite{*}
You should also specify a bibliography style and provide a .bib file as below.
\bibliographystyle{unsrt}
\bibliography{\jobname}
\end{document}
Now run pdflatex, bibtex, pdflatex and pdflatex in this sequence on this, no errors are generated.
Moral
You should have a .bib file in the same directory (here
\jobname.bib generated by filecontents).
You should use a \cite{bib key} in the document.
You should specify a bibliography style.
- You should include the bib file in the document via
\bibliography{\jobname}.
- For a more specific answer, you should provide a MWE!
`to mark your inline code as I did in my edit. Which version ofbiblatexdo you use? Do you usebibtexorbiber? – Kurt Oct 24 '12 at 13:55texcode. Please include a smallbibfile with packagefilecontentsin your MWE. – Kurt Oct 24 '12 at 14:02logfile – Kurt Oct 24 '12 at 14:03