+Custom crossref styles
+In Quarto
, it is possible to create a custom crossref type for things like appendix tables. One challenge, is that LaTeX will not allow users to nest a tblr
environment, inside a table
environment, inside the new environment that Quarto
creates for the crossref. Therefore, when rendering a table to LaTeX/PDF, it is important to drop the \begin{table}
environment. This can be done using the theme_tt()
function:
+---
+title: "Crossref Example"
+format:
+ pdf: default
+ html: default
+crossref:
+ custom:
+ - kind: float
+ key: apptbl
+ latex-env: apptbl
+ reference-prefix: Table A
+ space-before-numbering: false
+ latex-list-of-description: Appendix Table
+apptbl-cap-location: top
+---
+
+See @apptbl-testing
+
+::: {#apptbl-testing}
+
+::: {.cell}
+
+```{.r .cell-code}
+library(tinytable)
+
+tt(mtcars[1:5,]) |> theme_tt("tabular", style = "tabularray")
+```
+
+::: {.cell-output-display}
+
+```{=html}
+ <table class="table table-borderless" id="tinytable_1jsc2fi6o5lmndjm7hyv" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing='true'>
+ <thead>
+
+ <tr>
+ <th scope="col">mpg</th>
+ <th scope="col">cyl</th>
+ <th scope="col">disp</th>
+ <th scope="col">hp</th>
+ <th scope="col">drat</th>
+ <th scope="col">wt</th>
+ <th scope="col">qsec</th>
+ <th scope="col">vs</th>
+ <th scope="col">am</th>
+ <th scope="col">gear</th>
+ <th scope="col">carb</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+ <td>21.0</td>
+ <td>6</td>
+ <td>160</td>
+ <td>110</td>
+ <td>3.90</td>
+ <td>2.620</td>
+ <td>16.46</td>
+ <td>0</td>
+ <td>1</td>
+ <td>4</td>
+ <td>4</td>
+ </tr>
+ <tr>
+ <td>21.0</td>
+ <td>6</td>
+ <td>160</td>
+ <td>110</td>
+ <td>3.90</td>
+ <td>2.875</td>
+ <td>17.02</td>
+ <td>0</td>
+ <td>1</td>
+ <td>4</td>
+ <td>4</td>
+ </tr>
+ <tr>
+ <td>22.8</td>
+ <td>4</td>
+ <td>108</td>
+ <td> 93</td>
+ <td>3.85</td>
+ <td>2.320</td>
+ <td>18.61</td>
+ <td>1</td>
+ <td>1</td>
+ <td>4</td>
+ <td>1</td>
+ </tr>
+ <tr>
+ <td>21.4</td>
+ <td>6</td>
+ <td>258</td>
+ <td>110</td>
+ <td>3.08</td>
+ <td>3.215</td>
+ <td>19.44</td>
+ <td>1</td>
+ <td>0</td>
+ <td>3</td>
+ <td>1</td>
+ </tr>
+ <tr>
+ <td>18.7</td>
+ <td>8</td>
+ <td>360</td>
+ <td>175</td>
+ <td>3.15</td>
+ <td>3.440</td>
+ <td>17.02</td>
+ <td>0</td>
+ <td>0</td>
+ <td>3</td>
+ <td>2</td>
+ </tr>
+ </tbody>
+ </table>
+```
+
+:::
+:::
+
+Caption goes here.
+
+:::
diff --git a/vignettes/format.html b/vignettes/format.html
index b221a5e7..2d518b66 100644
--- a/vignettes/format.html
+++ b/vignettes/format.html
@@ -441,15 +441,15 @@