Remark.jl icon indicating copy to clipboard operation
Remark.jl copied to clipboard

Export to PDF?

Open dpsanders opened this issue 6 years ago • 5 comments

Is it possible to export the slides to PDF? I guess maybe using Pandoc somehow.

dpsanders avatar Oct 02 '19 04:10 dpsanders

I haven't tested it, but you could try the recommendations from https://github.com/gnab/remark/issues/50.

A summary of something that worked for me:

  1. Open in Chrome (I've actually used Chromium)
  2. Open Chrome DevTools (Ctrl+Shift+I on Linux, otherwise More Tools/Developer Tools on the menu)
  3. Toggle device toolbar (Ctrl+Shift+M on Linux)
  4. Print to file

I'm really not sure why it prints correctly only if one does step 2 and 3. When I have more time I can try and test command line solutions proposed in https://github.com/gnab/remark/issues/50 and if they work include them in the docs.

piever avatar Oct 12 '19 10:10 piever

TLDR:

  1. Open in Firefox/Chrome
  2. Resize the window to make the slides fill the full width of the window. (This means that there is at least a little bit of space at the top and bottom of the slides.)
  3. Print to file (tip: choose a custom paper size with a 4:3 ratio)

The "print to file" also works in Firefox 71 on Ubuntu 18.04. I noticed that you can skip steps 2 & 3 if you resize your browser window such that the slides fill the full width of the window (and there is some space at the top and bottom of the slides). I have no clue as to why this space is needed. When leaving the space at the top, though, all slides seem to be offset by that amount from the top of the pdf page, suggesting that the padding of the slides is also printed, which may be (part of) the cause of the slides not appearing when the space is on the sides.

MPvHarmelen avatar Jan 07 '20 15:01 MPvHarmelen

FWIW I've been using https://github.com/astefanutti/decktape for a long time now. It's really great.

floswald avatar Mar 07 '20 09:03 floswald

Looks interesting! Does it just work out of the box with Remark.jl as well? If that's the case, it would be great if you could PR an example to the README or post it here!

piever avatar Mar 07 '20 21:03 piever

For pdf export I use the R package pagedown

julia> using RCall
R> install.packages("pagedown")
R> pagedown::chrome_print("presentation/build/index.html")

Correction: But decktape is much better, sorry for the noise.

pnavaro avatar Sep 02 '20 12:09 pnavaro