Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_austenite/tests/oracle/fixtures/marginalia_fixture.typ

8.8 KiB, 1 run

created by r1870400018:40018, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1// The oracle harness's marginalia fixture -- the corpus's first root exercising the A1 MARGINALIA
2// primitive. A `#claim-label(<code>)` places a compressed claim code in the outside margin (6.5 pt grey,
3// recto/verso aware) while setting nothing in the body text column; a `#claim-refs(<code>)` is metadata
4// only and sets nothing at all. Self-contained -- no `#import` of any shared template -- so it compiles
5// under typst 0.15.1 with no symbol-modifier patch, and austenite reads `#claim-label`/`#claim-refs` as
6// builtins regardless of the `#let` definitions Typst uses to render them.
7//
8// The page geometry is austenite's own `PageGeometry::a4()` (A4, uniform 56.9 pt margins) and the body is
9// set at austenite's default 11 pt Libertinus Serif, so the margin code lands at the same outer edge in
10// both engines. The `claim-label` below reproduces the book's `claims.typ` placement: measure the code,
11// then `place` it flush against the text block's outer edge -- its left edge at the block's right on a
12// recto (odd) page, its right edge at the block's left on a verso (even) page. The document runs onto a
13// second page on purpose, so a claim code is set on both a recto and a verso leaf.
14
15#set page(width: 595.276pt, height: 841.89pt, margin: 56.9pt)
16#set text(size: 11pt, font: "Libertinus Serif")
17#set par(justify: true)
18
19#let claim-refs(..codes) = { }
20#let claim-label(..codes) = {
21 let strs = codes.pos().map(c => if type(c) == label { str(c) } else { str(c) })
22 let display = strs.join(" ")
23 box(width: 0pt, clip: false, context {
24 let pos = here().position()
25 let page-w = 595.276pt
26 let outside-m = 56.9pt
27 let content = text(size: 6.5pt, fill: luma(90), hyphenate: false, display)
28 let m = measure(content)
29 let sized = box(width: m.width, content)
30 if calc.odd(counter(page).get().first()) {
31 place(dx: page-w - outside-m - pos.x, sized)
32 } else {
33 place(dx: outside-m - m.width - pos.x, sized)
34 }
35 })
36}
37
38= Marginalia
39
40The opening paragraph carries a claim code#claim-label(<A1>) set in the outside margin of this recto
41leaf, where the machinery seats a compressed proposition code in six-and-a-half point grey. The body
42prose closes over the marker's place exactly as it would were the annotation absent, so the line breaks
43and the page breaks are those of the plain paragraph and the code rides beside them without perturbing a
44single measure of the running text.
45
46A margin annotation cannot stream inline, because its extent would depend on a forward layout fact the
47paragraph has not yet fixed. The stratified answer is to emit a zero-width anchor at the point of the call,
48record where it lands, and draw the note in the outside margin only after the composition has converged.
49Nothing about the anchor occupies horizontal space, so the words around it flow as if it were not there.
50
51The claim family divides in two. A visible label registers its metadata for a reverse index and sets a
52compressed code in the margin, while a bare reference registers the same metadata and sets nothing visible
53at all. Both are consumed by the reader; only the label leaves ink, and that ink lives outside the text
54column where a single-column engine could never reach before this primitive existed.
55
56The compression rule collapses a run of three or more consecutive codes that share a letter prefix into a
57range, leaves a pair expanded, and passes an unparseable code through untouched. A single code, the common
58case in running prose, is set as written. The rule is a faithful port of the book's own claims machinery,
59so a reproduced page reads the same codes the reference page does.
60
61Reproduction is the instrument here. Every downstream document that leans on the margin is an opportunity
62to harden the primitive, to break it against a real page and mend it upstream rather than papering over
63the gap in the document that surfaced it. The margin code is one such exercise, long missing from the
64reproduction because a single text column had nowhere to put it.
65
66A second recto paragraph keeps the first page filling toward its foot, so that the material below it is
67forced onto a fresh leaf and the reader can see a claim code set against the opposite edge. The mirror of
68the margins is what makes the two edges symmetric: the binding sits at the spine on both sides of a leaf,
69and the fore-edge carries the annotation.
70
71The frame is laid once at the recto split, with the binding margin on the left, and a verso page is that
72same frame shifted bodily to the fore-edge. Placing the folio at the block's left on a verso page therefore
73lands it at the outer margin, and the margin code rides the very same mirror, so one placement rule serves
74both parities without a special case for either.
75
76Enough prose now stands above this point to carry the column past the foot of the first page and onto the
77second, where the next annotated paragraph will set its code against the left edge of the block, in the
78outside margin of a verso leaf. The overlay pass draws it there from the converged ledger, the same ledger
79the running head reads, so neither can reopen the fixed point the composition settled on.
80
81The stratification the primitive rests on is the discipline that user code may never observe a layout fact
82directly. What it may see is the ledger: a map from an anchor's identity to the page and position it landed
83on, filled during composition and content addressed by that identity, so a label keeps its meaning when a
84paragraph carries it to another page. The margin note is the first construct to draw purely from that map.
85
86Content addressing is what turns a convergence failure into a report rather than a guess. Two ledgers can be
87differenced, and the difference names the anchor that moved and the pair of pages it moved between. A margin
88anchor that stays put across passes contributes nothing to that difference, which is exactly why a page
89carrying one still settles on the same fixed point a page without one would.
90
91The anchor occupies no horizontal space and no vertical space, and it is never itself a legal breakpoint. A
92glue beside it breaks as though it were absent, because the breaker looks straight through the anchor to the
93box before it. This is the property the whole primitive turns on: weightlessness in the flow, so that the
94body reads identically whether or not a code rides beside it.
95
96A reproduction that could not place a margin note was a reproduction missing a whole register of the page.
97The reference documents lean on the margin to carry their apparatus, their claim codes and their cross
98references, and a single-column engine that dropped them silently was faithful only to the body. The
99primitive restores the register without disturbing the column it sits beside.
100
101Measuring the note is a boundary operation. Its width is taken at its natural set, so the code never wraps,
102and that width decides where a verso note's right edge falls against the block. The measure runs the same
103path the body does, through the shaper, so a code sets in the same face and at the same hinting as the prose
104it annotates, only smaller and greyer.
105
106The mirror of the margins is the quiet machinery under all of this. A leaf binds along one edge, so the
107inside margin and the outside margin alternate between a recto and a verso, and the frame the driver lays at
108the recto split is carried whole to the fore-edge on a verso. One shift, applied once after the page is
109otherwise fixed, serves the folio, the running head and the margin note alike.
110
111The apparatus of a scholarly page is mostly marginal, and mostly invisible until it is missing. A claim code
112in the outside margin is a small thing on any one line and a substantial thing across a book, the thread that
113ties a proposition in the body to its entry in an appendix. Reproducing it end to end is the difference
114between a document that looks right and one that is right.
115
116Enough further prose now stands here to be sure the column has crossed onto the second leaf, so that the
117paragraph below sets its code in the outside margin of a verso page and the fixture exercises both parities
118of the placement rule rather than only the recto one. The overlay draws each from the same converged ledger.
119
120This paragraph opens the verso page and carries its own claim code#claim-label(<B2>) set against the outer
121edge of the block, which on a left-hand leaf is the left edge. The reproduction has lacked exactly this for
122as long as it has run a single text column, and the primitive closes the gap by drawing the note from the
123ledger after the page is otherwise fixed.
124
125A closing paragraph#claim-refs(<C3>) registers a metadata-only reference, which sets nothing in the margin
126and nothing in the body, and the prose closes over it silently. The visible codes above it, one to a recto
127and one to a verso leaf, are the whole of what this fixture asserts: that the margin annotation renders,
128on both sides, at the corpus's own six-and-a-half point grey, in the outside margin, and nowhere else.