piever / Remark.jl

Create markdown presentations from Julia
Other
94 stars 14 forks source link

Export to PDF? #26

Open dpsanders opened 5 years ago

dpsanders commented 5 years ago

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

piever commented 5 years ago

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.

MPvHarmelen commented 4 years ago

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.

floswald commented 4 years ago

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

piever commented 4 years ago

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!

pnavaro commented 4 years ago

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.