Skip to content

Commit 692ea87

Browse files
DO use label with renderings, DON'T use crossref with renderings
1 parent 5b28b10 commit 692ea87

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/computations/execution-options.qmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ plot(1:10) # Shown in `dark` mode
101101

102102
:::
103103

104-
`renderings` does not currently work correctly with the cell options `label` or `fig-cap`, `tbl-cap`, etc. To combine `renderings` with crossrefs and/or captions, use the fenced div syntax:
104+
The `renderings` cell option does not currently work correctly with cell cross-reference options (`label` starting with `fig-`, `tbl-`, etc.) or cell caption options (`fig-cap`, `tbl-cap`, etc.).
105+
106+
107+
To combine `renderings` with crossrefs and/or captions, use the fenced div syntax:
105108

106109

107110
````
@@ -117,6 +120,7 @@ format:
117120
::: {#fig-caption-crossref}
118121
119122
```{{r}}
123+
#| label: caption-crossref
120124
#| renderings: [light, dark]
121125
par(bg = "#FFFFFF", fg = "#000000")
122126
plot(1:10) # Shown in `light` mode
@@ -131,6 +135,9 @@ Light and dark renderings with a caption and crossref
131135
:::
132136
````
133137

138+
Note the use of a `label` that is not a cross-reference, i.e. that does not start with one of the [cross reference types](../authoring/cross-references.qmd#overview). It is a good practice to have named cells with `label`, for debuggability and stable resource names. However, cross-reference labels that start with `fig-`, `tbl-`, etc., will not work with `renderings`.
139+
140+
134141

135142
::: callout-tip
136143
When using the Knitr engine, you can also use any of the available native options (e.g. `collapse`, `tidy`, `comment`, etc.). See the [Knitr options documentation](https://yihui.org/knitr/options/) for additional details. You can include these native options in option comment blocks as shown above, or on the same line as the `{r}` as shown in the Knitr documentation.

0 commit comments

Comments
 (0)