-
Notifications
You must be signed in to change notification settings - Fork 323
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
label fig-xxx for knitr::include_url #5718
Comments
Thanks for the report! Could you format your example to be reproducible? Thanks. You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```
The end.
```` |
I think I got it right ! |
What you want to achieve, i.e., forcing content to be seen by Quarto as a figure is not currently possible, but Quarto team is working on cross-reference for 1.4 which should allow this in the future. |
Meanwhile, here is a workaround: ---
title: "fig"
format: html
editor: visual
---
## Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
here is a map, working as expected, but html saved is not a figure [@fig-maphtml]
::: {#fig-maphtml}
```{r}
htmlwidgets::saveWidget(leaflet::addTiles(leaflet::leaflet()) , "map.html")
knitr::include_url("map.html")
```
a leaflet interactive map
:::
the end.
|
great!
Le lun. 29 mai 2023 à 15:46, Mickaël Canouil ***@***.***> a
écrit :
… Meanwhile, here a workaround:
---title: "fig"format: htmleditor: visual---
## Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
here is a map, working as expected, but html saved is not a figure ***@***.***
::: {#fig-maphtml}
```{r}htmlwidgets::saveWidget(leaflet::addTiles(leaflet::leaflet()) , "map.html")knitr::include_url("map.html")```
a leaflet interactive map
:::
the end.
—
Reply to this email directly, view it on GitHub
<#5718 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANA2KEJE7XAITPMJIBAS64TXISSEFANCNFSM6AAAAAAYRIEAQQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@mcanouil I think Figure Divs is the answer to this, and not just a workaround. Do you think there should be more ? Otherwise, I think we can close |
I think that's a general solution yes. I said "workaround" because of a comment by @cscheid about cross-reference resdesign/refactoring which should allow to force anything to be read as anything for cross-reference, i.e., in this case, "html" as a "figure". |
Thanks, and I agree. There's too many open issues that are related to this (see the fifth bullet item in #4944); I'm going to leave this one open, and check back when those features are ready to see if they solve this issue. |
Ok, this style of crossreferenceable element is now documented and advertised, so we're good with closing this. |
Bug description
fig-xxx for an included_url (such as an interactive graph or a leaflet map) is not accepted as a figure by quarto (bookdown seems to work that way https://bookdown.org/yihui/rmarkdown-cookbook/include-url.html).
More generally it would be nice to allow user to include any content (if aware) as a figure or a table
(a table can sometime be rendered as an image ?).
here is a reprex:
Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Your environment
No response
Quarto check output
No response
The text was updated successfully, but these errors were encountered: