Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/authoring/cross-references-custom.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ You can define custom float cross-reference types using the `custom` key to the
- `kind`, which currently can only be `float`
- `key`, the abbreviation used in the reference identifier ("In `@fig-1`, ...")
- `reference-prefix`, used for the reference in output ("In Figure 1, ...")
- `caption-prefix`, used in front of the caption text ("Figure 1: ..."). If `caption-prefix` is unspecified, Quarto will use the value of `reference-prefix`.

For example, the following YAML defines a new cross-reference type for videos:

Expand Down Expand Up @@ -54,11 +53,20 @@ Which renders as:

In @vid-cern...

There are some additional options that give you more control over the appearance of the cross-reference:

- `caption-prefix`, the text used to construct the caption title shown under the float ("Figure 1: ..."). If unspecified, Quarto will use the value of `reference-prefix`.

- `caption-location`, the position of the the caption. Options are: `top`, `bottom` (default) or `margin`.

- `space-before-numbering`, whether there is a space between the prefix and number. Set to `false` to omit the space (e.g. "Figure1").


You can find a complete listing of the options available for the `custom` key on the [Cross-Reference Options](/docs/reference/metadata/crossref.qmd#custom) reference page.

## PDF Output

If your output format is PDF you'll also need to specify `latex-env`, a name to be used for the float environment wrapped around the element in the intermediate TeX. For example, to use the custom video reference type in PDF you could add `latex-env: video`:
If your output format is `pdf` you'll also need to specify `latex-env`, a name to be used for the float environment wrapped around the element in the intermediate TeX. For example, to use the custom video reference type you could add `latex-env: video`:

``` yaml
format: pdf
Expand Down