Replies: 3 comments 13 replies
-
I am not sure to understand the question or issue. #| fig-cap: !expr sprintf("A caption with some math, $\\gamma = 0.5$, ($N = %s$)", nrow(iris))
boxplot(Sepal.Length ~ Species, data = iris) Are you asking for a new feature to be implemented in Quarto, which is the "text reference" thing from bookdown? |
Beta Was this translation helpful? Give feedback.
-
For all that might see this discussion: the related issue is #1959 and it is scheduled as part of the v1.2 release milestone. |
Beta Was this translation helpful? Give feedback.
-
I achieve this as follows. My plot captions are often hairy bits of code since I am dynamically creating the caption based on the data being plotted.
or
and then
basically the same thing, but I find this cleaner. |
Beta Was this translation helpful? Give feedback.
-
One nice feature of the new YAML-style chunk options is that we can write complex text for e.g. captions without the need for escaping everything in an R character vector (by the way this is not Quarto-specific, it also works with plain knitr).
Is there a way to include R code in such a caption? Obviously, we can't use the standard way for evaluating R code by prefixing the value with
!expr
, as the value in this case is not an R expression.In bookdown text references can be used for such a purpose:
Is something like this possible with Quarto without resorting to character vectors?
Beta Was this translation helpful? Give feedback.
All reactions