Closed jjallaire closed 1 year ago
Hello: Is it possible to add this function?or use html details?
#| label: fig-plot2
#| fig-cap: !expr tippy::tippy(icons::fontawesome("question"),"answer")
ggplot2::ggplot()
#| fig-cap: "<details><summary>question</summary>answer</details>"
I think to do any of this sort of thing the best way currently is to inject javascript (using e.g. include-in-header
or include-after-body
that transforms the rendered content as you want at page load time.
I would love to see table/figure notes separated from a title, too! A while ago, I filed an issue to knitr
with the same request. It didn't seem to engender much interest though so I was wondering if the existing field fig-cap
could be hacked to accomodate this functionality instead? Perhaps some sort of post-processing could extract both title and notes from this one field or the \caption
command in LaTeX could be redefined to split them. But of course, native support would be much, much better.
Yes, please! This sounds like it would be very useful. I'm currently struggling with trying to hack my way with current Quarto functionality and python . Any suggestions?
This is something I would love to see have better support. Most fields suggested best practice is to include a short description next to the table, so this seems important. I have a hacked together solution for pdf/latex.
I header-includes \setkomafont{captionlabel}{\bfseries}
to make the "Table X" bold, then my tables I write the caption like this
| fruit | price |
|--------|--------|
| apple | 2.05 |
| pear | 1.37 |
| orange | 3.09 |
: **Fruit prices.** The price of fruit in dollars at the end of 2000. {#tbl-fruit tbl-colwidths="[75,25]"}
Which gives me
I'd prefer to be able to have more flexibility with font sizing / spacing / placement though.
The appropriate solution for these situations is to have custom formats render their figures however they desire. This is now possible in 1.4. We have preliminary documentation available here and here, but we'll document further before the release.
Specifically, arbitrarily-formatted captions should be implemented by a filter that overrides Quarto's figure rendering and adds whatever desired process by processing the FloatRefTarget node in a Lua filter.
For example: