Skip to content

Instantly share code, notes, and snippets.

@andrewheiss
Created October 2, 2025 14:21
Show Gist options
  • Save andrewheiss/7a8ab45e36192c5c4c00035ee8363d1d to your computer and use it in GitHub Desktop.
Save andrewheiss/7a8ab45e36192c5c4c00035ee8363d1d to your computer and use it in GitHub Desktop.
---
title: "Cross reference fun times"
crossref:
custom:
- kind: float
key: appfig
latex-env: appfig
reference-prefix: Figure A
space-before-numbering: false
latex-list-of-description: Appendix Figure
- kind: float
key: apptbl
latex-env: apptbl
reference-prefix: Table A
space-before-numbering: false
latex-list-of-description: Appendix Table
format:
html: default
typst: default
---
The trick is to (1) [specify custom float cross-reference types](https://quarto.org/docs/authoring/cross-references-custom.html), and (2) use the new `key` values for the crossref ids.
---
See @apptbl-some-table for a table
::: {#apptbl-some-table}
```{r}
#| label: table-thing
#| echo: false
library(tinytable)
data.frame(x = 1:2, y = c("A", "B")) |>
tt()
```
A table!
:::
See @appfig-some-plot for a plot
::: {#appfig-some-plot}
```{r}
#| label: plot-thing
#| echo: false
plot(1:10)
```
A plot!
:::
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment