8

I am preparing presentation with beamer and using pdflatex and bibtex. How can I put references at the end of a frame? What if I use allowframebreaks ?

I do not want all the references put together in one big frame at the end of my presentation, rather I want each reference as footnote on the frame where it has been used.

Note: I am using a custom bibliography style and author-year citation style.

MWE

\documentclass[xcolor=dvipsnames, 10pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath,bm,mathtools}

\usepackage{natbib}
\usepackage{bibentry}
\bibliographystyle{apalike}
\usepackage{chngcntr}


\counterwithin*{footnote}{page}
\newcommand\footcite[1]{\footnote{\bibentry{#1}}\label{\thepage:#1}}
\newcommand\secondcite[1]{\textsuperscript{\ref{\thepage:#1}}}



\setbeamertemplate{navigation symbols}{}
\definecolor{byublue}{RGB}{0 34 85}%added
\definecolor{mydarkgray}{RGB}{64 64 64}%added

\usecolortheme[named=MidnightBlue]{structure}%added
\usetheme{Montpellier}%Montpellier originally
\useoutertheme{tree}%added
\useinnertheme{circles}%added
\beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2->{15}}




\usefonttheme{professionalfonts} % using non standard fonts for beamer
\usefonttheme{serif} % default family is serif


\begin{document}
\nobibliography{bibliography_phd_journal_key}

\section{Introduction} 


\begin{frame}
\begin{center}
Some text \footcite{titanath2008p165326}
another test \secondcite{titanath2008p165326}
\end{center}


\begin{tabular}{|c|c|}
\hline 
Header\footcite{titanath2008p165326} & header \\ 
\hline 
1 & 2 \\ 
\hline 
\end{tabular} 
\end{frame} 


\bibliographystyle{mybibstyle}


\end{document}

I am using two external .bib files. One is the main .bib file and the other one is for journal name abbreviation.

cosmicraga
  • 2,630
  • 1
    Please add a minimal working example that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass and ending with \end{document}. Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here – adn Nov 27 '13 at 21:49
  • If this is the code you're using, there are a few problems. First, you have a \ in front of your bibfile name in the \nobibliography command. Second, that command is just like a \bibliography command, and should simply contain the names of both your .bib files. Lastly, you need to remove the \bibliography command, it's not needed in this case. – Alan Munn Nov 28 '13 at 12:27

1 Answers1

13

If you are using natbib for references, then you can use the bibentry package to create references in footnotes. It should be noted that this is a bit of a hack, and it doesn't really implement a proper footnote reference style, but emulates one. To deal with subsequent citations (as you request in the comments) I've created a second command \secondcite which will place a footnote referencing the correct citation's original footnote number without duplicating the bibliography entry itself. Here's an example:

\documentclass{beamer}

\begin{filecontents}{\jobname.bib}
@book{Saussure1995,
    Author = {Ferdinand de Saussure},
    Origyear = {1916},
    Publisher = {Payot},
    Title = {Cours de Linguistique G{\'e}n{\'e}rale},
    Year = {1995}}

@book{Labov1972,
    Address = {Philadelphia},
    Author = {William Labov},
    Publisher = {University of Pennsylvania Press},
    Title = {Sociolinguistic Patterns},
    Year = {1972}}

\end{filecontents}
\usetheme{Montpellier}
\usepackage{natbib}
\usepackage{bibentry}
\bibliographystyle{apalike}
\usepackage{chngcntr}

\counterwithin*{footnote}{page}
\newcommand\footcite[1]{\footnote{\bibentry{#1}}\label{\thepage:#1}}
\newcommand\secondcite[1]{\textsuperscript{\ref{\thepage:#1}}}

\begin{document}
\nobibliography{\jobname}
\begin{frame}

  \frametitle{Stuff famous linguists asked}
  \begin{block}{A block}
       \begin{enumerate}
        \item Is it part of \emph{langue} or part of \emph{parole}?\footcite{Saussure1995}
        \item Is it socially stratified?\footcite{Labov1972}
        \item More Saussure\secondcite{Saussure1995}
       \end{enumerate}
  \end{block}
\end{frame}
% The next frame is a duplicate for testing purposes    
\begin{frame}

  \frametitle{Stuff famous linguists asked}
  \begin{block}{A block}
       \begin{enumerate}
        \item Is it part of \emph{langue} or part of \emph{parole}?\footcite{Saussure1995}
        \item Is it socially stratified?\footcite{Labov1972}
        \item More Saussure\secondcite{Saussure1995}
       \end{enumerate}
  \end{block}
\end{frame}


\end{document}

output of code

If you want the references to be one big frame, then using [allowframebreaks] is the way to go. I find the standard formatting of references in beamer overly garish, so I subdue everything:

\setbeamercolor*{bibliography entry title}{fg=black}
\setbeamercolor*{bibliography entry author}{fg=black}
\setbeamercolor*{bibliography entry location}{fg=black}
\setbeamercolor*{bibliography entry note}{fg=black}
\setbeamertemplate{bibliography item}{}

I also allow for the "(cont.)" to be used on subsequent slides:

\setbeamertemplate{frametitle continuation}[from second]

The references slide itself is simple.

\begin{frame}[t,allowframebreaks]
\frametitle{References}
\bibliography{<bibfile>}
\end{frame}
\end{document}
Alan Munn
  • 218,180
  • `Since usually you want the references to be one big frame', I do not want all the references put together in one big frame at the end of my presentation, rather I want the reference as footnote on the frame where it was used. – cosmicraga Nov 28 '13 at 02:31
  • That wasn't clear from your question. What are you using for your bibliography - natbib or biblatex? This is a lot easier to do with biblatex. – Alan Munn Nov 28 '13 at 02:58
  • Yes I use natbib' and I am not familiar withbiblatex'. – cosmicraga Nov 28 '13 at 04:27
  • I am using `Montpellier' theme and this solution is not working in this theme. – cosmicraga Nov 28 '13 at 04:45
  • How would I know what theme you are using? Also, if you substitute Montpellier in the sample document I gave, it still works. This is why you were asked to give an minimal example of your problem. – Alan Munn Nov 28 '13 at 04:48
  • Yes, your MWE is working in Montpellier template. I am using two external .bib files and at present I do not know how to adapt those two in your code. – cosmicraga Nov 28 '13 at 05:29
  • Using \footcite{bibkey} multiple times on same frame creating duplicates of same reference. How to stop that ? – cosmicraga Nov 28 '13 at 19:02
  • 1
    There's no simple way to do this: what I've implemented here is not a true footnote citation system, it's a hack. But I've added a new command to refer to an already cited reference on the same slide. – Alan Munn Nov 29 '13 at 00:23
  • This works when used in text body but this is not working in table header. It is not reproducing the bibliography entry but the superscript number is not correct. I am modifying my MWE. Can it be solved ? – cosmicraga Nov 29 '13 at 05:40
  • Footnotes in tables are always problematic. See Footnotes in tables?. This is a separate issue and should be asked as a separate question. Given that this solution isn't the ideal way to do this, I would just avoid using it in a table. – Alan Munn Nov 29 '13 at 06:18