Closed yyzeng closed 2 years ago
@yyzeng my one guess is that maybe the scribble controls are interfering in some way. I just pushed #139 to hide the scribble controls when printing. For some reason I can't get Chrome to work for me locally, can you please try the solution that PR and let me know if it works for you?
# install the latest version of xaringanExtra
remotes::install_github("gadenbuie/xaringanExtra")
# then re-render your slides and print them
@yyzeng I merged the changes in #139, so now you can just install the latest version of xaringanExtra
Thank you for your prompt reply.
I have updated xaringanExtra
to 0.5.5, tried the following reprex
example and found it does't work regretedly.
---
title: 'Test'
output:
xaringan::moon_reader
---
```{r setup, echo=FALSE}
xaringanExtra::use_scribble()
# full-paged, but shrank to ~80% when print to a pdf via Google Chrome
print(head(mtcars, n = 29))
![Test](https://user-images.githubusercontent.com/5230361/133708892-616fcfe4-3860-4722-9a60-e6ee90ebad25.png)
That's unfortunate. I tried to reproduce your problem but I'm not seeing the same issue: below is an animation with two slides derived from your example, where including or removing scribble doesn't affect the font size at all.
I'm not sure I can be much help with this issue other than suggesting two things to consider:
build_pdf()
function that may provide more consistent results.Thank you! I will clarify myself a little more, just for memo. 😄
xaringanExtra::use_scribble()
, then everything is find.xaringanBuilder::build_pdf()
works for me, though it is a little crumsy.chromote::find_chrome()
just CAN'T find chrome.exe's path in my computer, but I have checked and found the path is in the Register with key "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe\\"
, 😭 So, I have to set Sys.setenv("CHROMOTE_CHROME" = "C:\\Users\\admin\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe")
before using xaringanBuilder::build_pdf("Test.Rmd")
, then everything is ok.Thank you once again for all your prompt reply and sound advice! 👍 @gadenbuie
Glad that you got it sorted out @yyzeng. I agree, we could give better advice in xaringanBuilder, so I added a note to update the error message that you should have received from build_pdf()
. Note that you can set this env var in your ~/.Renviron
file (use usethis::edit_r_renviron()
to open it) so that you don't have to keep setting the env variable each time you want to make PDFs.
We do have instructions here on the main xaringanBuilder README, but it would probably be more helpful if a careful error message was also added as this is pretty far down in the README. I should also probably just move these instructions further up in the README so that it's all up front.
@gadenbuie Hi Garrick, Thanks for all your great work! I love scribble, tile-view, freezeframe, etc. 👍
I use Google Chrome to print xaringan slides into pdf manually (https://github.com/yihui/xaringan/wiki/Export-Slides-to-PDF#manual-conversion-via-web-browser). It just works until I have added
xaringanExtra::use_scribble()
in my slides recently. I found that the printed fonts shrinked about 10%, leaving some extra blanks in the bottom. I just can't figure out why. 😭