Generalbeamer natbib bibliography not working

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

beamer natbib bibliography not working

Post by Monkey D »

I don't know why this doesn't work.

I copy-pasted the bib structure from my document to this presentation but it insists on not working.

Code: Select all

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage{default}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[square, sort, numbers, authoryear]{natbib}
\bibliographystyle{plainnat}

\usetheme{Warsaw}
...
\begin{document}

\begin{frame}{something}
Because it's cool \citep{MrCool2007}.
\end{frame}

\bibliography{references}
\end{document}
My error message:
presentation.tex:0: Citation `MrCool2007' on page 3 undefinedon input line 101.
presentation.tex:8: Empty `thebibliography' environment on input line 8.
presentation.tex:0: There were undefined citations.
Line 8 is the one before natbib usepackage.
If I comment the line where I cite and the \bibliography line it compiles without warnings/errors (but off course it doesn't solve me the problem).

Any way to fix this?
Thank you.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: beamer natbib bibliography not working

Post by josephwright »

Have you run bibtex? I think you also need to do something like \newcommand*{\newblock}{}, as beamer does not define it.

Joseph Wright
Joseph Wright
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

Re: beamer natbib bibliography not working

Post by Monkey D »

Once again thank you josephwright! :mrgreen:
This solved the problem:
\def\newblock{}
\bibliography{references}
Post Reply