BibTeX, biblatex and bibernatbib | Bibliography start-up Problems

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
slashpwn
Posts: 3
Joined: Sat Oct 06, 2012 2:43 pm

natbib | Bibliography start-up Problems

Post by slashpwn »

Hi guys, I'm new to LaTeX. I'm currently doing an assignment which needs references. It's required that the referencing is the Harvard style (author-year). I've been through a lot of websites and could conclude that I should use natbib.

But none of the sites could tell me how it's done. I've tried to understand, but failed. So I humbly ask you to help me get started. An example could be really helpful.

Kind regards
Newbie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

natbib | Bibliography start-up Problems

Post by localghost »

slashpwn wrote:[…] I've been through a lot of websites and could conclude that I should use natbib.

But none of the sites could tell me how it's done. […]
Perhaps reading the manuals of harvard and natbib will help you on.


Best regards and welcome to the board
Thorsten
slashpwn
Posts: 3
Joined: Sat Oct 06, 2012 2:43 pm

natbib | Bibliography start-up Problems

Post by slashpwn »

localghost wrote:Perhaps reading the manuals of harvard and natbib will help you on.
Thanks for the welcome and the quick answer. It helped a bit to read the natbib manual. Right now I'm trying to work it out in the {thebibliography} environment. The citations work but the references does not show any text in the PDF.

Here is my code:

Code: Select all

\documentclass{article}
\usepackage{natbib}

\begin{document}
\bibliographystyle{agu}

\section*{Recommended texts}
something\citep{1} for love

\begin{thebibliography}{1}
	\bibitem[Jonas et al.(1992)]{1}
\end{thebibliography}

\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

natbib | Bibliography start-up Problems

Post by localghost »

slashpwn wrote:[…] Right now I'm trying to work it out in the {thebibliography} environment. […]
It can't work this way. Try BibTeX along with according entries in a database file. It could look similar to this.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
%\usepackage{harvard}
\usepackage[authoryear,round]{natbib}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{lamport:94,
  author = {Lamport, Leslie},
  edition = {2nd},
  note = {User's Guide and Reference Manual},
  publisher = {Addison-Wesley},
  title = {{\LaTeX\ -- A Document Preparation System}},
  year = {1994}
}
\end{filecontents*}

\bibliographystyle{agsm}

\begin{document}
  \cite{lamport:94}
  \bibliography{\jobname}
\end{document}
Of course you can create the BibTeX database (*.bib) separately, either in your editor or perhaps with an external tool. Use either harvard (commented in the above code) or natbib to get the citation you want.

Consider to use the biblatex package for better control of bibliographies.
slashpwn
Posts: 3
Joined: Sat Oct 06, 2012 2:43 pm

natbib | Bibliography start-up Problems

Post by slashpwn »

localghost wrote: Consider to use the biblatex package for better control of bibliographies.
Okay it works now, many thanks for the help. I've been using TeXmaker which apparently was the source of the problem. Now I'm using TeXworks and everything works as supposed to.
Post Reply