-
-
Notifications
You must be signed in to change notification settings - Fork 212
Cross references
In typesetting, cross-references are references to other parts of the document, such as figures, tables, sections and equations.
In Quarkdown, a cross-reference is created via the .ref {id}
function, where id
is the cross-reference ID of the target element.
The function may appear either before or after the target element.
Note
Cross-referencing works best when elements are numbered and a supported document language is set.
See Numbering and Localization for details.
The ID is usually set via the {#id}
syntax, in locations that depend on the element type, as the following sections explain.
For this guide, assume the 1.1
numbering format is used for all elements.
Once Quarkdown is installed, check out .ref {getting-started} for a quick guide.
# Getting started {#getting-started}

Tip
In HTML rendering, the reference ID of headings also sets the HTML id
attribute, suitable for linking.
The Quarkdown logo is shown in .ref {logo}.
 {#logo}

As shown in .ref {data}, coffee is the most popular beverage.
| Person | Beverage |
|--------|----------|
| Alice | Tea |
| Bob | Coffee |
| Charlie| Coffee |
{#data}

With caption:
| Person | Beverage |
|--------|----------|
| Alice | Tea |
| Bob | Coffee |
| Charlie| Coffee |
"Beverage preferences" {#data}
Einstein's famous equation is shown in .ref {energy}.
$ E = mc^2 $ {#energy}
Multi-line:
$$$ {#energy}
E = mc^2
$$$

See the main function in .ref {main}.
```kotlin {#main}
fun main() {
println("Hello, World!")
}
```

With caption:
```kotlin "Hello World in Kotlin" {#main}
fun main() {
println("Hello, World!")
}
```
.numbered
elements are thoroughly explained in Numbering.
In Example .ref {my-example} you can see a custom numbered element.
.numbered {examples} ref:{my-example}
number:
**Example .number:** this is a custom numbered element.

- Figures
- Image size
- TeX formulae
- Table caption
- Code caption
- Decorative headings
- Alerts (quote types)
- Quotation source
- Cross-references
- Page breaks
- Text symbols (text replacement)
- Document metadata
- Theme
- CSS
- Fonts
- Page format
- Page margin content
- Page counter
- Automatic page break
- Numbering
- Paragraph style
- Caption position
- Table of contents
- Bibliography
- Footnotes
- Stacks (row, column, grid)
- Container
- Align
- Float
- Figure
- Clip
- Box
- Collapsible
- Landscape
- Whitespace
- Variables
- Optionality
- Math
- Conditional statements
- Loops
- Let
- Destructuring
- String manipulation
- Table manipulation: sorting, computing, and more
- Generators
- String
- Number
- Markdown content
- Boolean
- None
- Enumeration entry
- Iterable
- Dictionary
- Range
- Lambda
- Size(s)
- Color
- Dynamic
- Paper: abstract, definitions, theorems, and more