Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
share|improve this question
    
you may have to edit your .bst file. –  Nicholas Hamilton Dec 29 '12 at 18:46
    
Can you show how you make the citation? –  egreg Dec 29 '12 at 19:05
    
Yes, my entries are very simple: \cite{bibentry} –  Dave Dec 29 '12 at 19:10
    
Welcome to TeX.sx! –  egreg Dec 29 '12 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! :) –  Paulo Cereda Dec 29 '12 at 19:20

1 Answer 1

up vote 11 down vote accepted

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

share|improve this answer
    
Well, thank you very much for this quite simple solution :-) –  Dave Dec 29 '12 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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