Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use chrome_print on parametrized Rmarkdown document #188

Closed
cderv opened this issue Sep 16, 2020 · 3 comments
Closed

Allow to use chrome_print on parametrized Rmarkdown document #188

cderv opened this issue Sep 16, 2020 · 3 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Sep 16, 2020

From a question in the community : https://community.rstudio.com/t/not-able-to-produce-paged-pdf-document-when-trying-to-render-html-paged-rmarkdown-document-using-parameters/80677/2

Current you can render a Rmd file using

pagedown::chrome_print("reprex.Rmd")

but the included rendering does not accept params as in :

rmarkdown::render("reprex.Rmd", params=list(test="html"))

@yihui @RLesur How about we support that by

  • taking ... in chrome_print to pass to render : pagedown::chrome_print("reprex.Rmd", params = list(test="html"))
  • or by adding a render_args argument taking a list to match render argument ? pagedown::chrome_print("reprex.Rmd", rmd_args = list(params = list(test="html")))
@yihui
Copy link
Member

yihui commented Sep 29, 2020

The chrome_print() function actually also accepts .html input, so this should work:

pagedown::chrome_print(
  rmarkdown::render("reprex.Rmd", params=list(test="html"))
)

I'm fine with adding ... or render_args, but it doesn't seem to save a lot of typing effort. The solution I mentioned is totally flexible and you can use any arguments of rmarkdown::render().

@cderv
Copy link
Collaborator Author

cderv commented Sep 29, 2020

Yes this is what I answered in the community post

output <- rmarkdown::render("reprex.Rmd", params=list(test="html"))
pagedown::chrome_print(output)

That works well.

We could also just document that explicitly and consider it simpler to maintain that adding a new parameter to do the same.

@yihui yihui closed this as completed in 8d51a58 Sep 29, 2020
@yihui
Copy link
Member

yihui commented Sep 29, 2020

Okay. I just added more documentation. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants