24

I'm making a beamer presentation and I'd like to use natbib because of its \citet and that it recognizes URLs. However, when I try to compile it, while doing the third PDFLaTeX pass, there appear this error (among others):

[28] (./presentacion.toc) [29] (./presentacion.bbl  

(./presentacion.toc  

! Missing } inserted.  

<inserted text>   

                }  

l.3 ...r@sectionintoc {1}{Introducci\'on}{4}{0}{1}  

When I take out the natbib package, everything works well, including the \bibliography

Is there a way to solve this, or I shouldn't use natbib with beamer?

1
  • Minimal complete example? I have used beamer + natbib occasionally. Commented Aug 18, 2010 at 17:10

2 Answers 2

16

The beamer class is not working with natbib. The initial author of the class Till Tantau said:

Currently, beamer does not work with natbib since beamer meddles with the same things as natbib and beamer's meddling is not done in such a way that natbib can tolerate this. Also, it is not possible to "switch off beamer's meddling"

However, you may use it in article mode.

You can read it here in the tex.latex.beamer.general mailing list.

2
  • 3
    Yes, this is one of the things on the beamer 'to do' list. Not sure whether we'll tackle this any time soon.
    – Joseph Wright
    Commented Aug 18, 2010 at 17:15
  • 1
    It's really great that the development of beamer goes on.
    – Stefan Kottwitz
    Commented Aug 18, 2010 at 17:16
15

Here is a working example. I compiled this on MacTex-2009, using pdflatex. No errors, no warnings (except a message about pgfbaseimage.sty being obsolete, which is unrelated).

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage[scaled]{helvet}
\usepackage[round]{natbib}
\newcommand{\newblock}{}

\begin{document}

\begin{frame}
    See \citet{foo}.

    \begin{thebibliography}{22}
        \bibitem[Foo(1988)]{foo} Foo (1998). Bar. \emph{CONF 1988}.
    \end{thebibliography}
\end{frame}

\end{document}

The result is a PDF document that looks like this:

See Foo (1988).

Foo (1998). Bar. CONF 1988.

And another example using Bibtex; test.tex:

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage[scaled]{helvet}
\usepackage[round]{natbib}
\newcommand{\newblock}{}

\begin{document}

\begin{frame}
    See \citet{foo}.

    \bibliographystyle{abbrvnat}
    \bibliography{test}
\end{frame}

\end{document}

and test.bib:

@INPROCEEDINGS{foo,
    author={Bar Foo},
    year={1988},
    title={Foo},
    booktitle={CONF 1988}
}

Again, works fine.

3
  • 5
    Your post was very helpful for me. I want to say, though, that this second example is NOT straightforward at all. In particular \newcommand{\newblock}{} is a hack to get natbib and beamer working together. The beamer user guide suggests that only the manual bibliography entry approach is supported.
    – lowndrul
    Commented Mar 2, 2011 at 0:59
  • It worked for me with \renewcommand{\newblock}{}, great!
    – yannis
    Commented May 22, 2015 at 21:35
  • 2
    This second example does not work for me. Although I hoped it would!
    – B Furtado
    Commented Jun 7, 2018 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .