22

How can I change the citation style to "( author , year )" on beamer? The code is for "author year"

\documentclass{beamer}
\usepackage[backend=bibtex,style=authoryear]{biblatex}
\addbibresource{ppgeq.bib}

\usetheme{Madrid}
\begin{document}
\section{}
\subsection{}
\begin{frame}{\secname}{\subsecname}
\cite{Wang2005}
\end{frame}
\end{document}
Vitor Abella
  • 1,158

2 Answers2

15

I would recommend using biber (the default) instead of bibtex as the back end for using biblatex. With the standard author-year style, there are two main citation commands:

  • \textcite{} produces Author yyyy
  • \parencite{} produces (Author yyyy)

To get the comma between the name and the year, you need:

  • \renewcommand*{\nameyeardelim}{\addcomma\addspace}

So here's a complete example of what you want:

\documentclass{beamer}
\begin{filecontents}{\jobname.bib}
@book{Saussure1995,
    Author = {Ferdinand de Saussure},
    Publisher = {Payot},
    Title = {Cours de Linguistique G{\'e}n{\'e}rale},
    Year = {1995}}
\end{filecontents}
\usetheme{Madrid}
\usepackage[style=authoryear]{biblatex}
\renewcommand*{\nameyeardelim}{\addcomma\addspace}

\addbibresource{\jobname.bib}
\begin{document}
\begin{frame}
\frametitle{A frame title}
\begin{itemize}
\item Langue et parole \parencite{Saussure1995}
\end{itemize}
\end{frame}

\end{document}

For printing the bibliography, you should typically use [allowframebreaks] on the frame that contains the \printbibliography command.

output of slide

Alan Munn
  • 218,180
  • As I asked for a authoryear comma separated style, just add "\renewcommand*{\nameyeardelim}{\addcomma\space}" after "\addbibresource{\jobname.bib}" and it will totally answer my question. – Vitor Abella Jun 20 '16 at 03:17
  • Yes, I forgot about that. Just added it now. – Alan Munn Jun 20 '16 at 03:24
  • I just found this answer. When I compile your example with pdflatex and bibtex and add a cite slide containing \printbibliography that slide simply remains empty in the final PDF. – Peter May 21 '19 at 17:01
  • @Peter You need to use with biber rather than bibtex to process the bibliography. – Alan Munn May 24 '19 at 02:27
  • Okay, that makes sense, biber was initially producing an error so I assumed I had to use bibtex, but I tried this again and it worked. – Peter May 24 '19 at 07:10
6

I think this can solve the problem. Just add the \bibliographystyle{apalike} before the \bibliography{}. I used it on beamer and works fine.

\begin{frame}
    \frametitle{Referências}
    \bibliographystyle{apalike}
    \bibliography{bibliografia.bib}
\end{frame}
luciana
  • 69
  • \bibliographystyle is used by natbib, not biblatex. The original question is using biblatex (which may be used because they want the references printed on the same slide, not in a bibliography at the end). Without including a preamble that imports compatible packages, this answer does not work. So in context, it is wrong, even though it would be good in a different context. – EL_DON Jan 10 '21 at 15:36