feat: scienting-math/1 sources and derived/math.jsonl; lode references; stress fixes
Math content may say its source is in scienting-math/1's canonical TeX (form, in no hash); derived/math.jsonl holds papermath's tree, symbols and issues, and the validator now checks derived files. A symbol annotation names its symbol by key; lode claim references use lode's tag and pin syntax. The zip reader refuses entries zipfile cannot read, and checkpoint lines end in LF only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017R7sgDNvUGWY2zFPCq2JH6
This commit is contained in:
40 files changed
+750
-63
No files matched your search
+21
-3
@@ -79,11 +79,11 @@ Page breaks, running heads and columns are not nodes: they are geometry ([7](07-
|
||||
| Content | Kinds | Shape |
|
||||
| --- | --- | --- |
|
||||
| Runs | `sentence`, `cell`, `reference`, `authors`, `keywords` | A non-empty list of inline runs ([3.5](#35-inline-runs)). |
|
||||
| Math | `equation`, `equation-line` | `{notation, source}`: `tex` or `typst`, and the source as written. |
|
||||
| Math | `equation`, `equation-line` | `{notation, source, form?}`: `tex` or `typst`, the source as written or as a form spells it, and that form ([3.7](#37-math-forms)). |
|
||||
| Verbatim | `code`, `algorithm` | `{language?, text}`. |
|
||||
|
||||
Other kinds have no `content`.
|
||||
Derived renderings, such as MathML, are not content; they live in `derived/` ([12.7](12-package.md#127-derived-files)).
|
||||
Derived renderings and readings, such as MathML and a formula's tree, are not content; they live in `derived/` ([12.7](12-package.md#127-derived-files)).
|
||||
|
||||
## 3.4 Attributes
|
||||
|
||||
@@ -105,7 +105,7 @@ No other kind carries `attrs`, and each kind carries only its own attributes.
|
||||
| Run | Properties | Plain projection |
|
||||
| --- | --- | --- |
|
||||
| `text` | `text`, and optional `style`: a sorted list of distinct values from `em`, `strong`, `sup`, `sub`, `sc`, `mono`, never both `sup` and `sub`. | The text. |
|
||||
| `math` | `notation` (`tex` or `typst`), `source`. | `$` + source + `$` |
|
||||
| `math` | `notation` (`tex` or `typst`), `source`, and optional `form` ([3.7](#37-math-forms)). | `$` + source + `$` |
|
||||
| `cite` | `refs`: reference node IDs; `text`: the printed form, such as `23`, `[1,2]` or `(Smith, 2019)`. | The printed form. |
|
||||
| `xref` | `target`: a node ID in this document, an address in another, or null when not yet resolved; `text`. | The printed form. |
|
||||
| `fnmark` | `footnote`: a footnote's ID, or null; `text`: the mark. | The mark. |
|
||||
@@ -133,3 +133,21 @@ A node's runs as printed are its runs with each run's `printed` in place of its
|
||||
Its projection as printed is the plain projection of its runs as printed; an equation's or a verbatim node's is its plain projection, and any other node's joins its text leaves' projections as printed with one U+0020.
|
||||
It is the text a witness of the paper holds, recovered from `nodes.jsonl` alone; for a node no emend touched it is the plain projection.
|
||||
The strict and lossy projections are taken over the runs as printed ([5.3](05-hashes.md#53-the-strict-projection)), and `projections.jsonl` gives an emended sentence's projections with its projection as printed.
|
||||
|
||||
## 3.7 Math forms
|
||||
|
||||
A math form is a standard spelling of formulas, so that one formula is written alike whichever paper, converter or claim it comes from.
|
||||
An equation's or equation line's content and a `math` run MAY carry `form`, which names the form its `source` is written in; a source without `form` is as the witness wrote it.
|
||||
The one form is `scienting-math/1`, canonical TeX, which [9.4](09-figures-tables-equations.md#94-the-math-form) describes; a node or run with `form` has the notation `tex`.
|
||||
|
||||
A consumer MAY rely on these properties of a source that carries `form`:
|
||||
|
||||
1. It is canonical: it is the form's own spelling of the formula the witness wrote, which renders as that formula did, apart from presentation such as spacing, `\displaystyle` and delimiter sizes.
|
||||
2. It is idempotent: spelling it in the form again gives it back unchanged, so a tool that rewrites it to check it, or a converter run twice, changes nothing.
|
||||
3. It carries no label: the form lifts a `\tag` out of the source, and an equation keeps it as its `label`; `\label`, `\nonumber` and `\notag` are gone.
|
||||
4. Everything else is derived from it: the tree, the symbol keys and the issues of [9.4](09-figures-tables-equations.md#94-the-math-form) are read from the source by a pinned tool into `derived/math.jsonl` ([12.7](12-package.md#127-derived-files)), are never content, and are the same for the same source under the same form.
|
||||
|
||||
A producer writes `form` only on a source it has spelled in that form.
|
||||
A correction that changes such a source writes the new source in the form too, since the gate does not implement the form and cannot check it.
|
||||
A validator that implements the form reports a source with `form` that is not its own canonical spelling as `doc.math.form`.
|
||||
`form` enters no content value, so adding it to a source already in the form changes no hash, ID or anchor, while respelling a source in the form changes them as any edit of the source does ([5.2](05-hashes.md#52-own-content)).
|
||||
Reference in new issue
Block a user