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

 

Sections

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

# Getting started {#getting-started}
Sections

Tip

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

 

Figures

The Quarkdown logo is shown in .ref {logo}.

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

 

Tables

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

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

With caption:

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

 

Equations

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

$ E = mc^2 $ {#energy}

Multi-line:

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

 

Code blocks (listings)

See the main function in .ref {main}.

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

With caption:

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

 

Custom numbered elements

.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.
Custom numbered elements

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