Skip to content

Cross references

Giorgio Garofalo edited this page Sep 25, 2025 · 4 revisions

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. See Numbering 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.

 

Sections

Once Quarkdown is installed, check out .ref {getting-started} for a quick guide.

# Getting started {#getting-started}

TODO img

Tip

In HTML rendering, the reference ID of headings also sets the HTML id attribute, suitable for linking.

 

Figures

.ref {logo} shows the Quarkdown logo.

![Logo](icon.svg "The Quarkdown icon") {#logo}

TODO img

 

Tables

As shown in .ref {data}, coffee is the most popular beverage.

| Person | Beverage |
|--------|----------|
| Alice  | Tea      |
| Bob    | Coffee   |
| Charlie| Coffee   |
{#data}

TODO img

With caption:

| Person | Beverage |
|--------|----------|
| Alice  | Tea      |
| Bob    | Coffee   |
| Charlie| Coffee   |
"Beverage preferences" {#data}

TODO img

 

Equations

Einstein's famous equation is shown in .ref {energy}.

$ E = mc^2 $ {#energy}

Multi-line:

$$$ {#energy}
E = mc^2
$$$

TODO img

 

Code blocks (listings)

See the main function in .ref {main}.

```kotlin {#main}
fun main() {
    println("Hello, World!")
}
```

TODO img

With caption:

```kotlin "Hello World in Kotlin" {#main}
fun main() {
    println("Hello, World!")
}
```

TODO img

 

Custom numbered elements

.numbered elements are thoroughly explained in Numbering.

Example .ref {my-example} shows a custom numbered element.

.numbered {examples} ref:{my-example}
    number:
    Example .number: this is a custom numbered element.

TODO img

Getting started [NEW!]

Documentation

CLI tools

Markdown enhancements

Functions

Setting up

Multi-file projects

Layout

Charts & diagrams

Scripting & control flow

Utilities

Slides

I/O

Native content

Value types

Built-in libraries

  • Paper: abstract, definitions, theorems, and more

Extra features

Inside Quarkdown

Clone this wiki locally