-
DescriptionIs there a way to set a custom image as the preview when you hover over a cross reference? When you have interactive content which isn't an image then the cross reference preview just shows a blank page. A reproducible example in R is below. The rendered version is here in case you need it: ---
title: "quarto-hover"
format:
html:
self-contained: true
---
Here is an simple R plot which will be displayed in the hover preview.
```{r}
#| label: fig-base-plot
plot(1:10)
```
Here is an interactive plot which won't be displayed in the hover preview.
```{r}
#| label: fig-plotly
#| message: false
library(plotly)
plot_ly(x = 1:10, y = 1:10, z = 10:1, type = 'scatter3d', mode = 'markers')
```
When you hover over the link to @fig-base-plot you see a preview, but not for @fig-plotly.
|
Beta Was this translation helpful? Give feedback.
Answered by
mcanouil
Sep 10, 2024
Replies: 1 comment 4 replies
-
Not directly in Quarto, but since it's HTML, you could probably use JavaScript. Side note: |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, I can't and that is out of Quarto scope.
For advanced customisation, you are a bit on your own I'm afraid, as we cannot teach you HTML/JavaScript or LaTeX or Typst or OpenXML.
The library used is Tippy.js:
https://github.com/quarto-dev/quarto-cli/blob/3cfdf0178848bce308be22c0fad0ca420add762c/src/resources/formats/html/tippy/