Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

References Truncated in Beamer Presentation prepared in Knitr/RMarkdown

I'm currently preparing a presentation in RStudio (using RMarkdown and Knitr, outputting to a Beamer presentation) that has quite a few references.

I'm using a pretty typical YAML header:

---
title: "Title"
author: "Me"
date: "February 27th, 2016"
output: 
  beamer_presentation
csl: ../../apa.csl
bibliography: ../../RefenceDesk.bib 
---

This presentation compiles and the references appear as they should, but unfortunately they all appear on one slide (and actually run off the page). Is there any way to have the references appear on multiple slides?

like image 621
Twitch_City Avatar asked Feb 28 '16 02:02

Twitch_City


1 Answers

{.allowframebreaks} is the solution for multislides bibliographies in beamer. It works out of the box with regular pandoc templates (see my previous answer). However, knitr has a setting that prevents it, by redefining \widowpenalties in its beamer template. You can verify that if you examine the .tex file with keep_tex: true.

In my opinion, this is a bug. A quick fix would be to reset \widowpenalties to its default value. It can be done in your yaml front matter:

---
title: Title
header-includes:
  - \widowpenalties 1 150
output: 
  beamer_presentation
---

Then, you can indicate the reference section as such:

## References {.allowframebreaks}
like image 158
scoa Avatar answered Sep 28 '22 03:09

scoa