12

I have to following problem. I'm working on a presentation. Therefore I need, when I cite a paper or something else, the whole name and year of the paper. Everything went well until now. When I cite something it is displayed like this:

Donald Knuth [1995]

But I want it this way:

[Donald Knuth, 1995]

This is my preamble:

\documentclass{beamer}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage[square,sort,comma,super,authoryear]{natbib}
\usepackage{url}
\usepackage{color}
\usepackage{tikz}
\bibliographystyle{plainnat}
\def\newblock{} % To avoid a compilation error about a function \newblock undefined
5
  • you may have to edit your .bst file. Dec 29, 2012 at 18:46
  • Can you show how you make the citation?
    – egreg
    Dec 29, 2012 at 19:05
  • Yes, my entries are very simple: \cite{bibentry}
    – Dave
    Dec 29, 2012 at 19:10
  • Welcome to TeX.sx!
    – egreg
    Dec 29, 2012 at 19:13
  • 1
    Hi Dave! You don't need to add (solved) to the title, the green tick mark already indicates that your question is solved. :) In order to keep things organized, we removed it from the title. Welcome to TeX.sx! :) Dec 29, 2012 at 19:20

1 Answer 1

13

You have to use \citep; here's a complete example.

\begin{filecontents*}{\jobname.bib}
@book{knuth1995,
 author={Donald E. Knuth},
 title={The {\TeX}book},
 year={1995},
}
\end{filecontents*}

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[square,sort,comma,super,authoryear]{natbib}

\begin{document}
\begin{frame}
\citep{knuth1995}

\bibliographystyle{plainnat}

\begin{block}{\refname}
\bibliography{\jobname}
\end{block}
\end{frame}

\end{document}

enter image description here

1
  • Well, thank you very much for this quite simple solution :-)
    – Dave
    Dec 29, 2012 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.