You have to take into account that you need to choose both the style for the citations in the document, and the layout for the section containing the bibliographical entries.
Try this sample document (let's call it test.tex
):
\documentclass{article}
\usepackage[round]{natbib}
\begin{document}
\citep{goossens93}
\nocite{*}
\bibliographystyle{abbrvnat}
\bibliography{biblio}
\end{document}
with bibliographical database biblio.bib
(saved in the same directory containing test.tex
):
@book{goossens93,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The Latex Companion A",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@article{greenwade93,
author = "George D. Greenwade",
title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
year = "1993",
journal = "TUGBoat",
volume = "14",
number = "3",
pages = "342--351",
url=" www.ctan.org"
}
@book{knuth79,
author = "Donald E. Knuth",
title = "Tex and Metafont, New Directions in Typesetting",
year = "1979",
publisher = "American Mathematical Society and Digital Press",
address = "Stanford"
}
@book{lamport94,
author = "Leslie Lamport",
title = "Latex: A Document Preparation System",
year = "1994",
edition = "Second",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{patashnik88,
author = "Oren Patashnik",
title = "{B}ib{T}e{X}ing. Documentation for General {B}ib{T}e{X} users",
year = "1988",
howpublished = "Electronic document accompanying BibTeX
distribution"
}
@techreport{rahtz89,
author = "Sebastian Rahtz",
title = "A Survey of {T}ex and graphics",
year = "1989",
institution = "Department of Electronics and Computer Science",
address = "University of Southampton, UK",
number = "CSTR 89-7"
}
compile in the following way:
(pdf)latex test
bibtex test
(pdf)latex test
(pdf)latex test
Refer to the documentation of the natbib package for further information.
Another option would be to use the biblatex package; in this case, the file test.tex
would have the following aspect (using bibtex
as back.end):
\documentclass{article}
\usepackage[style=authoryear,maxnames=1,backend=bibtex]{biblatex}
\addbibresource{biblio}
\begin{document}
\parencite{goossens93}
\nocite{*}
\printbibliography
\end{document}
the compilation process would be the same as before. Newer versions of biblatex
use biber
as default backend, so if backend=bibtex
is not specified, the compilation sequence becomes
(pdf)latex test
biber test
(pdf)latex test
Summarised (and expanded) from comments above:
BibTeX uses the aux file written by LaTeX (showing where you want to cite what) together with a bst file (containing stylistic information - such as plain.bst) and a bib file (containing bibliographic information about any document you might want to reference). So a workflow from the command line might look like
latex
- to generate the aux file
bibtex
- to generate a bbl file which contains information about the specific references mentioned in the aux file, formatted correctly
latex
- to incorporate the information in the bbl file into your typeset document
- possibly
latex
again, to fix any cross-referencing problems introduced when all the citations were included
Looking at the aux and bbl files along the way - and, as @Joseph pointed out, the blg file which is BibTeX's log - can help to troubleshoot problems.
For completeness as an answer: on this occasion it apparently turned out that the bibtex
step wasn't working due to a typo in the name of the bst file.
Best Answer
I'd treat it with the catch all
@misc
entry:Note that
filecontents
is used just for convenience; use your normal method with an external.bib
file. I also changed the document class for avoiding page breaks.