mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
40 lines
1.0 KiB
XML
40 lines
1.0 KiB
XML
--- locate-position ---
|
|
// Test `locate`.
|
|
#v(10pt)
|
|
= Introduction <intro>
|
|
#context test(locate(<intro>).position().y, 20pt)
|
|
|
|
--- locate-position-trailing-tag ---
|
|
// Test locating the position of a tag with no following content.
|
|
#context test(here().position().y, 10pt)
|
|
#box[]
|
|
#v(10pt)
|
|
#context test(here().position().y, 20pt)
|
|
|
|
--- locate-missing-label ---
|
|
// Error: 10-25 label `<intro>` does not exist in the document
|
|
#context locate(<intro>)
|
|
|
|
--- locate-duplicate-label ---
|
|
= Introduction <intro>
|
|
= Introduction <intro>
|
|
|
|
// Error: 10-25 label `<intro>` occurs multiple times in the document
|
|
#context locate(<intro>)
|
|
|
|
--- locate-element-selector ---
|
|
#v(10pt)
|
|
= Introduction <intro>
|
|
#context test(locate(heading).position().y, 20pt)
|
|
|
|
--- locate-element-selector-no-match ---
|
|
// Error: 10-25 selector does not match any element
|
|
#context locate(heading)
|
|
|
|
--- locate-element-selector-multiple-matches ---
|
|
= Introduction <intro>
|
|
= Introduction <intro>
|
|
|
|
// Error: 10-25 selector matches multiple elements
|
|
#context locate(heading)
|