/
在排版中,交叉引用是指向文档其他部分的引用,例如插图、表格、章节和公式。
在 Quarkdown 中,你可以使用 .ref {id} 函数来创建交叉引用,其中 id 是目标元素的引用 ID。该函数可以出现在目标元素之前或之后。
你通常使用 {#id} 语法来设置 ID。具体位置取决于元素类型,如下面的小节所述。
Once you install Quarkdown, check out .ref {getting-started} for a quick guide.
## Getting started {#getting-started}
提示:在 HTML 渲染中,标题的引用 ID 也会成为 HTML 的
id属性,这使它们适合用于链接。
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 a 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}
For multi-line equations:
$$$ {#energy}
E = mc^2
$$$提示:有关在 Quarkdown 中编写公式的更多信息,请参阅 TeX 公式 。
See the main function in .ref {main}.
```kotlin {#main}
fun main() {
println("Hello, World!")
}
```
With a caption:
```kotlin "Hello World in Kotlin" {#main}
fun main() {
println("Hello, World!")
}
```
.numbered函数在编号中有详细说明。
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.