-
Notifications
You must be signed in to change notification settings - Fork 336
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
error with pdf output and html function (leaflet) #3279
Comments
Thanks for the report. Can you share the full .qmd that is causing trouble for you? |
Providing a link to that qmd at our public repo. https://github.com/hdadvisors/rrh-framework/blob/main/part-4-9.qmd |
Sorry for the delay on getting back to you. I confess I don't quite know how you got PDF support in leaflet; I've tried rendering with quarto versions going back to 1.0.38 and I see the same problem. I believe
|
Related to #4225 probably where I need to update the documentation. Using HTMLWIDGETS in document using R with Quarto works the same way as with rmarkdown. Screenshot of the html widgets will be made. For that webshot or preferably webshot2 R package is required. See the issue linked for explication in my comments Do you have one of those package installed ? If not, then it won't work. If you do, the PDF will render with a screenshot of the leaflet. @cscheid your example works for me and produce this PDF. Improving the indication on what to do is part of work I need to do for #4225 |
Ah, I don't have webshot2 installed (maybe we should tell users that). And it does seem like this causes a bug, because the output is different. |
This is R only feature to wonder how we want to warn about that, but my plan is to add to documentation for knitr computation as part of #4225 which is the same issue.
What bug exactly ? It is working for me unless I missed something |
They generate different figures (the HTML one is centered on the polygon for me, but the PDF one isn't). |
Oh I see now. I missed this. I think I may know why (related to size option on cells that we use with R Markdown gives a different results so something we do in Quarto. ---
title: test
output:
pdf_document:
keep_md: true
---
```{r}
#| label: fig-ash-map
#| fig-cap: "Map of Town of Ashland"
library(sf)
library(leaflet)
ashland <- st_read('https://services2.arcgis.com/sKZWgJlU6SekCzQV/arcgis/rest/services/Ashland_Boundary/FeatureServer/0/query?outFields=*&where=1%3D1&f=geojson', quiet = TRUE)
leaflet(ashland) %>%
addTiles() %>%
addPolygons()
``` |
@ericvmai I'll close this one because the initial error is fixed. Regarding the different rendering with webshot2 doing the screenshot, I believe this because and screenshot needs to be done with This will work ---
title: test
format: pdf
---
```{r}
#| label: fig-ash-map
#| fig-cap: "Map of Town of Ashland"
#| fig-format: png
library(sf)
library(leaflet)
ashland <- st_read('https://services2.arcgis.com/sKZWgJlU6SekCzQV/arcgis/rest/services/Ashland_Boundary/FeatureServer/0/query?outFields=*&where=1%3D1&f=geojson', quiet = TRUE)
leaflet(ashland) %>%
addTiles() %>%
addPolygons()
```
I'll open an issue to remember to think of an improvement in Quarto or knitr |
Bug description
I have the below code in a Quarto project and I'm trying to render to pdf.
I get the following error that was not occurring previously:
I've updated quarto cli to the 1.2.269 Candidate Release on Windows 11 Pro. It worked fine on my other machine and all packages are updated. My yml includes the following settings for pdf export:
Please help! I was having no issue with Quarto exporting these out to a pdf previously but am now all of a sudden.
Checklist
The text was updated successfully, but these errors were encountered: