BibTeX, biblatex and biberNatbib hello world

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
jonsson
Posts: 1
Joined: Sun Dec 24, 2023 11:34 am

Natbib hello world

Post by jonsson »

Happy Christmas ! This is a question about natbib. I am trying to get a thesis template to work. But I can't get it to work. So I made a minimal working example. That doesn't work either. Here it is. The file is called doc.tex

\documentclass{article}
\usepackage{natbib}

\begin{document}

Here is Donald Knuth's website: \cite{knuthwebsite}.

\medskip

\bibliography{ref}

\end{document}



Here is the ref.bib file:

@misc{knuthwebsite,
author = "Donald Knuth",
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}


I make in the terminal (debian) with:
$ pdflatex -synctex=1 -interaction=nonstopmode doc.tex

These are the warnings that I am getting:

Package natbib Warning: Citation `knuthwebsite' on page 1 undefined on input li
ne 6.
No file doc.bbl.
Package natbib Warning: There were undefined citations.


Can you recommend what could I can do to debug this? I'm using texlive 2023.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Natbib hello world

Post by Stefan Kottwitz »

Hi jonsson,

welcome to the forum!

You need a \bibliographystyle command, and need to run bibtex on the document, that creates the .bbl file, then run pdflatex again. Click on "Run LaTeX here":

Code: Select all

Code, edit and compile here:
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@misc{knuthwebsite,
author = "Donald Knuth",
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
\end{filecontents}
\usepackage{natbib}
\begin{document}
Here is Donald Knuth's website: \cite{knuthwebsite}.
\medskip
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Stefan
LaTeX.org admin
Post Reply