jtleek / dataanalysis

The lecture slides for Coursera's Data Analysis class
761 stars 720 forks source link

How convert the presentation of slidify in a pdf file? #18

Open bluepill5 opened 11 years ago

bluepill5 commented 11 years ago

Hi, i'm start working wih slidify, my question is: How did you convert the .Rmd file in a .pdf file?

Thanks.

lcolladotor commented 11 years ago

Once you get a .md file you can use Pandoc http://johnmacfarlane.net/pandoc/ to get a pdf file. Also check the slidify documentation or browse the past issues https://github.com/ramnathv/slidify/issues?state=closed (someone might have asked that previously).

bluepill5 commented 11 years ago

Thanks, i'm gonna check.

ramnathv commented 11 years ago

For the slides in this repo, you can directly use Google Chrome's print feature to save it as a PDF.

bluepill5 commented 11 years ago

Perfect, thank you so much for the help.

khughitt commented 10 years ago

Anyone know of a way to print with one slide per page? Currently Chrome ignores slide boundaries and prints as much as it can fit.

Nowosad commented 10 years ago

The same problem here. Chrome is ignoring slides boundaries, and sometimes doesn't print slide titles, etc.

ramnathv commented 10 years ago

There were some changes to Google Chrome, which broke the print styles for the slide framework being used here. I would recommend printing to PDF from Safari of Firefox. I tried it today and it seems to work well for me.

khughitt commented 10 years ago

:+1: Firefox worked for me as well.

rpietro commented 10 years ago

Printing using pandoc certainly works well, specially since the yaml is nicely transformed into a title. But what I was trying to do was to get a pdf that would keep all the custom styling created through CSS. My ultimate goal is to have the presentation imported into slideshare.

I tried to use http://wkhtmltopdf.org/ , which works pretty well in converting local and online html-css into very nice looking pdf or images, but that didn't work for slidify (pdf or images). I then tried standalone and selfcontained, but still no results.

I wonder whether anybody might have been successful in uploading a slidify presentation in any format to slideshare.

thanks

ramnathv commented 10 years ago

The best way to do this is to use the browsers print function. Firefox seems to give the best results retaining most of the styling. There is also an automated solution that uses casperjs to capture each slide as screenshot and convert them into a pdf.

ptoche commented 9 years ago

I'm getting no-where with Firefox/Chrome/Safari/Opera print functions. They print only the current slide and without any of the styles. I'm using html5slides, in case that matters. I'll try pandoc, but I thought I should let you know.

juaneschutte commented 9 years ago

Unfortunately, im also not winning with any of those major browsers, even if i use the io2012 framework.

ptoche commented 9 years ago

@juaneschutte , I've had more success with the io2012 framework and chrome (not tested with others).

There appear to be 2 problems: 1) the first, title page is messed up (only part of the title shows, not centered properly); 2) there is an empty white slide at the end (it's not numbered, so the problem is quite minor).

Here is my workflow:

  1. File --> Print
  2. Select 'Landscape' mode.
  3. Print using system dialog
  4. Select orientation (I forget which, but it makes a difference)
  5. Pages per sheet: 1 (other numbers resulted in slides being cut off)
  6. select the PDF button at the bottom left corner. This seems to be rather important.

The resulting PDF is available here for 28 days: http://www.fileconvoy.com/dfl.php?id=gbf535f69bcbe21aa999618530ff3fd43ada27bb5c

ptoche commented 8 years ago

Currently Firefox does a good job (it prints an extra blank page at the end, but otherwise fine), as long as you set the advanced printing options to landscape and remove headers, footers, and background colors. Chrome currently messes things up (in my case, it makes a mess of the title page and omits the second page, weird but true).

NP-compete commented 6 years ago

On Mac OSX, this can be done using Rscript -e "Sys.setenv(RSTUDIO_PANDOC='/Applications/RStudio.app/Contents/MacOS/pandoc');library(rmarkdown); library(utils); render('input.Rmd', 'pdf_document')"`