Citations
Attach a source to a value, read cited tables, and understand how the compiler resolves them.
A citation ties a value to the page or table it came from. It sits at the end of the line, after the expression.
need Lh: time = 20000 h @T1 "Bảng 10.5"
port k2: key(host = s2, b = 14 mm, h = 9 mm, t = 5.5 mm, len = 50 mm, at = 60 mm) @T1 "Bảng 10.5"Forms
| Form | Meaning |
|---|---|
@T1 "Bảng 10.5" | A labelled table or figure |
@T1 p.188 | The printed page 188 |
@T1 pdf.200 | PDF page 200 |
Bind a source
use T1 = uploads/giao-trinh-ctm.pdf binds the upload. Archee reads each upload into a folder beside it, uploads/giao-trinh-ctm/, whose index.json lists the pages and labels:
{
"source": "giao-trinh-ctm.pdf",
"pages": [{ "printed": 188, "pdf": 200 }],
"labels": {
"Bảng 10.5": { "pdf": 200, "csv": "tables/b10_5.csv", "image": "images/p200_1.png" }
}
}A label matches after NFC normalisation, case folding and whitespace collapse. A printed page maps to its PDF page through pages.
Read a table
A cited table is also data. Read a cell with a row selector and a column name:
let tau: stress = T1."Bảng 10.5"["C45"].tau| Selector | Reads |
|---|---|
[k] | The row whose first column equals k |
[~k] | A linear interpolation at k |
[>=k] | The first row with key at least k |
The column header carries the unit, which types the result: a column headed tau [MPa] gives a stress. A table read cites its table automatically.
Resolution errors
A citation that does not resolve is an error.
| Code | Meaning |
|---|---|
C01 | The label is not in index.json |
C02 | The page is out of range |
C03 | The row or column is missing |
C04 | The label is ambiguous |
C05 | The source is not indexed |
The message lists the labels that exist, so the fix is one edit.
A literal with no citation is allowed. The compiler reports it as an assumed value (A01), so a reader sees which numbers rest on a source and which on your choice.