Making slides without powerpoint/impress reloaded

1 minute read

Published:

After doing html slides what’s next?

Beamer

Beamer is a LaTeX class for creating slides for presentations.

But I know nothing about Beamer neither about LaTeX.\

I wanted to convert the html presentations to Beamer, because the output of Beamer/LaTex is pdf, and pdfs shows nicely in figshare.\

Ok, pandoc comes to rescue us, I already have the files I’ve done with Rstudio and knitr which I described in the previous post so it’s very easy, with pandoc you can generate html slides or Beamer slides:

pandoc -t beamer RAE2012_DivPatron_charla.md -V theme:Warsaw -o RAE2012\_DivPatron\_charla.pdf

but the result is not very good, the images were BIG, very BIG.

Thanks to Jeromy Anglim’s post about Beamer/Markdown I learn to use some simple LaTex formating commands for images:\

centerline{\includegraphics[height=2in]{my_image.pdf}}

The problem is that images dynamically generated with R, can’t be formated this way. Knitr chunk options have the posibility to change size: fig.width and fig.height. The images get smaller but the fonts dont’ change it’s size, the images are awfull. The other chunk options to control output size:out.width and out.height didn’t work with Beamer.

Thus I choose the option to modify the Markdown file generated by knitr with the previous LaTex command. It was not a very elegant solution but worked.

UPDATE: here there is a python script to replace <center>![](figure)</center> with LaTeX code gist

Then I ended with two files: the Rstudio markdown with all the R commands to generate the plots and a modified markdown file used for generate the beamer output by pandoc.

And I uploaded the presentation to figshare, the presentation can be showed in your blog/web page using the code provided by figshare, it works!

I like the slides generated by pandoc/Beamer,  so I think that I am prepared to say goodbye to powerpoint/impress now.

Leave a Comment