-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
dev
metadata key not honoured
#368
Comments
Thanks for the report. You're right that something is not working as we could expected. Your workarounds are the good ones. When setting Lines 186 to 188 in 8dcfa3f
This means that rmarkdown::html_document(dev = "svg")$knitr$opts_chunk$dev
#> [1] "svg"
xaringan::moon_reader(dev = "svg")$knitr$opts_chunk$dev
#> NULL This is because Lines 210 to 211 in 8dcfa3f
Those options are merged with the base format (which is the one receiving the This is what happens internally base_format_do <- rmarkdown::knitr_options(opts_chunk = list(dev = "svg"))
xaringan_format_do <- rmarkdown::knitr_options(NULL)
str(base_format_do)
#> List of 5
#> $ opts_knit : NULL
#> $ opts_chunk :List of 1
#> ..$ dev: chr "svg"
#> $ knit_hooks : NULL
#> $ opts_hooks : NULL
#> $ opts_template: NULL
str(xaringan_format_do)
#> List of 5
#> $ opts_knit : NULL
#> $ opts_chunk : NULL
#> $ knit_hooks : NULL
#> $ opts_hooks : NULL
#> $ opts_template: NULL
str(rmarkdown:::merge_lists(base_format_do, xaringan_format_do))
#> List of 5
#> $ opts_knit : NULL
#> $ opts_chunk : NULL
#> $ knit_hooks : NULL
#> $ opts_hooks : NULL
#> $ opts_template: NULL @yihui this is our usual "merge output format" limitation due do initial design - other related issue are rstudio/rmarkdown#2407 and rstudio/rmarkdown#1558 (that I rememenber) Usual way to fix this is to pass the argument that goes into As More generally this is an issue when a format uses Hope it is clear. Do you want to support this better in xaringan by adding explicitly more argument to |
I tend to make this breaking change. We can do a PR and check revdeps first, to get an idea about how bad this change could be to other packages.
I tend not to add a new argument to |
It seems that the
dev
key that can be set as part of the YAML frontmatter is not being passed on tormarkdown::html_document()
. The following R Markdown document creates a Xaringan presentation with PNG graphics instead of SVG graphics:Only setting the chunk option
dev = "svg"
(or usingknitr::opts_chunk$set(dev = "svg")
) creates SVG figures.xfun::session_info("xaringan")
By filing an issue to this repo, I promise that
xfun::session_info('xaringan')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/xaringan')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: