Skip to content

Commit 9297ebe

Browse files
authored
warn about block-level equations (see quarto-cli#13019) (#1701)
1 parent f44ffb2 commit 9297ebe

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/authoring/cross-references-divs.qmd

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@ title: Cross-Reference Div Syntax
66

77
## Overview
88

9-
Cross-referenceable [figures](#figures), [tables](#tables) and [code listings](#listings) are known as *float* cross-references. Floats can appear in the rendered document at locations other than where they are defined, i.e. they float, and usually have captions.
9+
Cross-referenceable [figures](#figures), [tables](#tables) and [code listings](#listings) are known as *float* cross-references.
10+
Floats can appear in the rendered document at locations other than where they are defined, i.e. they float, and usually have captions.
1011

11-
Along with compact syntax for the most common uses of cross-references, Quarto also provides a more general div syntax for declaring floats that can be cross-referenced. To declare a cross-referenceable float, place the content inside a fenced div with the reference identifier as an attribute. The last paragraph inside the fenced div will be treated as the caption. For example:
12+
Along with compact syntax for the most common uses of cross-references, Quarto also provides a more general div syntax for declaring floats that can be cross-referenced.
13+
To declare a cross-referenceable float, place the content inside a fenced div with the reference identifier as an attribute.
14+
The last paragraph inside the fenced div will be treated as the caption.
15+
16+
::: callout-warning
17+
18+
Quarto currently only supports this alternative syntax for **floats**, as described above.
19+
Some cross-referenceable elements like theorems, proofs, etc naturally use this div syntax, but note that Quarto does not support the use of the div syntax for block-level equations.
20+
21+
:::
22+
23+
As a minimal example, consider the following QMD snippet:
1224

1325
````{.markdown}
1426
::: {#fig-example}
@@ -20,6 +32,18 @@ Caption
2032
:::
2133
````
2234

35+
This produces the following (admittedly silly) figure:
36+
37+
::: {#fig-example}
38+
39+
CONTENT
40+
41+
Caption
42+
43+
:::
44+
45+
Now, this figure can be cross-referenced with `@fig-example`, see @fig-example.
46+
2347
To be recognized as a cross-reference the identifier must begin with one of the built-in float reference types (Figures (`fig-`), Tables (`tbl-`) and Listings (`lst-`)), or be defined as a [custom float cross-reference](cross-references-custom.qmd) type.
2448

2549
You can then refer to the element as usual with the `@` syntax, e.g.

0 commit comments

Comments
 (0)