Some fixes to achieve the task to print a pdf version of the slideshow.

I explained the changes involved here: https://github.com/ipython/ipython/issues/3634