# .ord File Format Syntax Reference

This is the complete reference for the `.ord` file format used by OrdStyle: a markdown-like content
syntax plus a `:STYLE:` definition system that drives the PDF, HTML and LibreOffice output. It lists
every field, key and value the format accepts. Its companion, `authoring.md`, is the guide to which
mechanism to reach for when you are building a particular design.

## Document Structure

An `.ord` file consists of:
1. Optional `:USERS:` / `:COMMENTS:` / `:CHATS:` / `:HISTORY:` header blocks (in that order)
2. One or more `:STYLE:` ... `:END:` sections
3. Document content (headings, body text, tables, images, etc.)

```
:USERS:
alice 4
bob 7
:END:
:STYLE:
%+TITLE: My Document
[def]	Noto Serif	12	0	0	0	0	12	0	0	0	0	0
:END:
# Heading 1
Body text here.
```

---

## Header Blocks

**These blocks are written and maintained by the editor — don't write them by hand.** The
`:USERS:`, `:COMMENTS:`, `:CHATS:` and `:HISTORY:` blocks (and the older top-level `%+` lines)
hold the document's contributors, comments, chat and undo history. They are described here so
you can recognize them when you open a `.ord` file in another program; to author a document you
only need `:STYLE:` blocks and the body.

Top-level header blocks come **before** any `:STYLE:` block. Each is optional (the editor omits an empty one). The block opener and closer are `:NAME:` and `:END:` (block names match the regex `:[A-Z0-9]+:`), so a style's name is upper-case letters A–Z and digits only: Rename Style upper-cases what is typed and refuses anything else (a space, a hyphen, an accented letter), as well as another style's name. Block names `USERS`, `COMMENTS`, `CHATS`, `HISTORY`, `NONE` and `END` are reserved — the rename-style UI refuses these. (`NONE` is reserved so `%+INHERIT: none` can never name a style; see *Inheritance* below. `END` would close its own block.) A rename made by a collaborator obeys the same rule, and the editor writes any other name as `STYLE<n>`.

The editor writes the blocks in a fixed order: `:USERS:` → `:COMMENTS:` → `:CHATS:` → `:HISTORY:` → `:STYLE:` → body. On read a different order is tolerated, and all blocks are still parsed.

A `:USERS:`, `:COMMENTS:`, `:CHATS:` or `:HISTORY:` block whose `:END:` is missing ends at the
first line that cannot be one of its own: a `:NAME:` opener or `%+BODY:` for any of them, a line
not ending in a color number in `:USERS:`, and a line not starting `{`, `%+` or `#+` in
`:HISTORY:`. That line is read as what comes after the block, so the style and body survive.
A `:STYLE:` block (or any style block) whose `:END:` is missing ends at the first line that is
neither a `%` setting nor a style row; that line is the body's first, and the editor warns once
on open. The next save writes the `:END:`. A line starting `[` that isn't a well-formed row (its
tabs turned to spaces) is dropped and the block goes on.

**`%+BODY:` — where the body starts.** The body normally begins at the first line that is not
part of a header. A body whose first non-blank line would itself read as a header — a line
beginning `%+`, a line beginning `:END:`, or `:NAME:` at column 0 — is written after a line
holding exactly `%+BODY:`, placed after the style sections; everything after that line is the
body, verbatim. The editor writes the marker only in that case; it is never required otherwise.

```
:STYLE:
[def]	Noto Serif	12	0	0	0	0	12	0	0	0	0	0
:END:
%+BODY:
:NOTE: this line is text, not a style section
```

### `:USERS:` block

Per-user color assignment for past contributors. One line per user.

```
:USERS:
alice 4
bob 7
:END:
```

Each line is `<name> <colorIdx>`. The name is everything before the last space, so it may hold spaces (a guest's `Guest:Josh G 4`).

### `:COMMENTS:` block

Comments / suggestions attached to text ranges. One line per comment.

```
:COMMENTS:
#+FORMAT: cid/2
1745603400 Josh%20Green 0 12 1 3 Two fixes:\n1 move this
:END:
```

Fields: `<datetime> <user> <start> <end> <status> <cid> <text>`. The writer opens the block with
`#+FORMAT: cid/2`, and each entry is one line:

- `<user>` is one word: a space (any Unicode space, tab included) and `%` are written as
  percent-encoded UTF-8 bytes (`Josh Green` → `Josh%20Green`, `50%` → `50%25`).
- `<text>` consumes the rest of the line; a line break is written `\n`, a carriage return `\r`,
  and a backslash `\\`. Any other backslash stays as it is.

Older forms still read as written. `#+FORMAT: cid/1` has the `<cid>` field but writes the user and
text as they are: a text's line break goes on over the following lines up to the next line that
starts with a digit (so a break followed by a digit starts what reads as a new comment), and a user
name cannot hold a space. A block with no format line has no `<cid>` (cid 0). A save writes cid/2.

`status` is a bitfield: `1` enabled, `2` reply, `4` suggestion, `8` emoji reaction, `16` **resolved**,
`32` **trail** (an auto-generated "marked this resolved" / "reopened this" reply — `32|16` on a reply
marks the line that is holding its thread closed, and deleting that line reopens the thread).
Enabled-clear means deleted. Enabled set with resolved set is a **settled** thread — an accepted or
rejected suggestion, or a comment someone resolved: closed and hidden by default, but still present
and still tracking its text, so it can be reopened.

### `:CHATS:` block

Document-scoped chat messages. One line per message.

```
:CHATS:
#+FORMAT: chat/2
1745603600 Guest:Josh%20G Hi everyone
:END:
```

Fields: `<datetime> <user> <text>`, encoded as in `:COMMENTS:` cid/2 when the block opens with
`#+FORMAT: chat/2` (the writer's form). A block with no format line writes them as they are: a
text's line breaks read as in `:COMMENTS:` cid/1, and a user name cannot hold a space.

### Top-level `%+` lines in older files

| Line | Format | Purpose |
|------|--------|---------|
| `%+HISTORY:` | `%+HISTORY: <base64>` | Undo history in an older binary form. Older files may contain it; it is still read, and the next save writes a `:HISTORY:` block instead. |

Older files may also hold top-level `%+USER:`, `%+COMMENT:` or `%+CHAT:` lines; they are ignored on read.

### Undo History Persistence

When the editor's "Local Undo History" setting is non-zero, the editor saves the document's change log so undo and the undo dialog keep working across reopens. The setting value is also the cap on entries written; `0` saves no history.

History is embedded as a `:HISTORY:` ... `:END:` block placed after the other header blocks and before any `:STYLE:` block. The block contains `%+KEY: value` headers followed by JSON-Lines entries — one line per change, then an optional `%+COMMENT_CHANGES:` separator and one line per comment change. `%+CRC32:` is the first header line, a checksum of the block.

```
:HISTORY:
%+CRC32: 9f3c1a44
%+FORMAT: json-lines/4
%+BODYHASH: 14a1b2c3d4e5f607
%+CURRENT: 1247
{"v":1234,"b":1233,"t":0,"u":"alice","z":1745603521234,"o":[{"o":"+","p":42,"t":"Hello, world!"}]}
%+COMMENT_CHANGES:
{"i":17,"s":42,"e":50,"n":3,"g":1234}
:END:
```

JSON-Lines entries use single-character keys for compactness. To recognize them:

- `t` is the change type, an integer: `0` (edit), `100` (undo), `101` (redo), `102` (revert), `103` (restore), `104` (restore all); other user actions are also integers.
- `o` inside an op object is the op type: `"+"` (insert), `"-"` (delete), `"M+"` / `"M-"` (the two halves of a move). Older files may contain `"S+"` / `"S-"` move labels; they are still read.
- `z` is the time, in milliseconds since the epoch.
- Character ids (an op's `i`, `L`, `R`, `A`, `lc`, `rc`, and the `%+IDS:` / `%+NEXTID:` / `%+IDMAP:` lines) are numbers; negative values are a short form the editor writes for its own local ids. Older `json-lines/2` and `/3` blocks are still read.

`%+BODYHASH:` is a hash of the body the history describes. On open, the editor checks the checksum and the body hash. If the body has been edited outside the editor (the hashes differ), the editor asks whether to discard the saved history or cancel the open — replaying history against text it doesn't describe could corrupt the document. If the block is damaged, the editor warns and starts with an empty history.

A server keeps the same `:HISTORY:` block in its copy of a document when its "Server Undo History" setting is non-zero.

---

## Style Sections

### Basic Format

Style sections are enclosed in `:STYLE:` ... `:END:` blocks. A document can have multiple named style sections (e.g., `:STYLE:`, `:STYLE2:`).

**Multiple style sections.** Because content is style-agnostic, multiple style sections let one
document ship many looks (light/dark, brand-A/brand-B). Select which section renders by name on
the command line — `./ordstyle --pdf doc.ord STYLE2` — or via the style selector in the UI;
the output filename carries the active section's name (e.g. `doc.STYLE2.pdf`). Pair with **design
variables** (`%+VAR:`) so each section just overrides them — change `accent`/`ink` per
section and the whole document re-skins.

```
:STYLE:
%+TITLE: Document Title
%+AUTHOR: Author Name
%+LMAR: 72
%+RMAR: 72
[def]	Noto Serif	12	0	0	0	0	12	0	0	0	0	0
[#1]	SerBd	24	0	0	10	6	0	100	2	1	0	0
:END:
:STYLE2:
%+SLIDE_MODE: 1
%+NO_SIBLINGS: 1
:END:
```

Lines starting with `%+` are document properties. Lines starting with `[` are style definitions.

#### Inheritance: `%+INHERIT:`

A style section other than the first inherits every setting and every row of the style it
**follows**, for anything it does not itself override. By default that is the first declared
style. `%+INHERIT:` names a different one:

```
:STYLE3:
%+INHERIT: STYLE2      STYLE3 follows STYLE2, which follows STYLE
```

* The parent is named, not numbered, so renaming a style carries every `%+INHERIT:` that
  points at it.
* It may name **any style declared earlier**, to any depth (`STYLE3 → STYLE2 → STYLE`). A
  forward reference is refused and the style keeps the default parent — that rule is what makes
  a loop impossible to write down.
* **It must be the first line of its block.** Reading it re-seeds the style from its parent,
  so anything above it would be discarded. The writer always puts it there.
* Absent means the first declared style.

##### `%+INHERIT: none` — a second root

```
:STYLE2:
%+INHERIT: none        STYLE2 follows nothing; it is a root, exactly like the first style
```

`none` does **not** mean "a style with no rows". It means the style is a **root, exactly the
way the first declared style is**: it gets the seeded `[def]` rows, a field it does not set is
the *program* default rather than another style's value, and a row another style declares is
simply not in it. Styles may still follow *it* (`%+INHERIT: STYLE2`), and nothing above it
reaches them.

* On the **first** style the line is meaningless — it is already the root — and is ignored.
* Like any `%+INHERIT:`, it must be the block's first line: reading it re-seeds the style.
* `NONE` is a **reserved style name** (`:NONE:` is refused, alongside `:USERS:`, `:COMMENTS:`,
  `:CHATS:` and `:HISTORY:`), so the token can never be read as a style called `none`.
* A `[key] none` suppression inside a root just removes the row, the same as in the first
  style — there is no parent to suppress anything from.

In the Settings dialog the parent picker's last entry is *(none — standalone)*. Choosing it
**flattens**: everything the style currently inherits becomes its own, so the document looks
exactly as it did and the style is now standalone. *New Style* and *Copy Style* each ask the
same question — which style the new one inherits from, or none. *New* starts at the program
defaults either way; *Copy* starts with the source style's values either way.

#### `%+INSERT_MODE:` — what an untouched row does when its parent changes

```
%+INSERT_MODE: 2       (first style only; 2 = keep following (default), 1 = break off)
```

Document-wide policy, so it is read from the first style's block only. `2` means a row nobody
has touched keeps following its parent when the parent is edited; `1` means the first such edit
breaks it off into an independent copy. Absent means `2`.

#### Saying a row is *not* here

Inheritance is otherwise silent: an inherited row is simply **absent** from the variant's
block, so on disk "I inherited this" and "I never set this" look the same.

To say **this row is not part of the style**, write the key with a bare `none` as the whole
remainder of the line:

```
:STYLE:
[Bd.7@doc]	Seven	Ser	10.6	…      the base declares it
[|Grid]	1	#EEEEEE
:END:
:STYLE2:
[Bd.7@doc]	none                   STYLE2 does not have this row at all
[|Grid]	none                       same for the table plane; [>…] [~…] [&…] likewise
:END:
```

The suppressed row is gone from that style completely — a `[Name]` attach or a positional
selector that would have resolved to it now falls through to the next step of the role cascade,
exactly as if the base had never declared it. Notes:

* **The rule is exact:** a row is a suppression *iff* its entire remainder is the single token
  `none`. A text style whose Name is literally `none` (`[X]<TAB>none<TAB>Ser<TAB>12`) is an
  ordinary row — text rows always carry their Name column, so they can never be mistaken.
* **`[def]` cannot be suppressed** — it is the root the field cascade walks up to. The line is
  ignored.
* **In the first section a `none` line just removes the row** (there is nothing above it to
  inherit from), and nothing is written back on save.
* Suppressing a row the parent does not declare is a no-op and is dropped on save.
* Same vocabulary as `%+REGION<N>: none` — a bare `none` is this format's "explicitly nothing".

In the Settings dialog, inherited rows show in the parent's color and suppressed rows show the
parent's values dimmed and struck through. Right-click a row for *Follow &lt;parent&gt;*,
*Override here*, *Remove from this style* and *Delete everywhere…*; in a variant, Delete means
*Remove from this style*, and in the first section it still deletes the row everywhere.

### Document Properties

#### Page Layout

| Property | Description | Default |
|----------|-------------|---------|
| `%+UNITS:` | Settings-display units: `pt`, `mm`, `cm`, `in` (case-insensitive; the numeric codes 0-3 of older files are still read) | pt |
| `%+PAGE_WIDTH:` | Page width | 612 (US Letter) |
| `%+PAGE_HEIGHT:` | Page height | 792 (US Letter) |
| `%+LMAR:` | Left margin | |
| `%+RMAR:` | Right margin | |
| `%+TMAR:` | Top margin | |
| `%+BMAR:` | Bottom margin | |
| `%+ODD_EVEN:` | Mirror margins for double-sided printing | 0 |

#### Title Page

| Property | Description |
|----------|-------------|
| `%+TITLEPAGE:` | 1 to enable title page generation |
| `%+TITLE:` | Document title (supports `<BR>` for line breaks) |
| `%+AUTHOR:` | Author name |
| `%+TITLE_FONT:` | Font for title |
| `%+TITLE_FONT_SIZE:` | Title font size |
| `%+TITLE_POS:` | Vertical position of title |
| `%+AUTHOR_FONT:` | Font for author |
| `%+AUTHOR_FONT_SIZE:` | Author font size |
| `%+AUTHOR_POS:` | Vertical position of author |
| `%+TITLE_DATE_FONT:` | Font for date on title page |
| `%+TITLE_DATE_FONT_SIZE:` | Date font size |
| `%+TITLE_DATE_POS:` | Vertical position of date |
| `%+TITLE_DATE_FORMAT:` | Date format string |
| `%+DATE_FORMAT:` | Date format for regular dates (default: "MMMM d, yyyy") |
| `%+OTHER_FONT:` | Font for custom text line 1 |
| `%+OTHER_FONT_SIZE:` | Custom text 1 font size |
| `%+OTHER_POS:` | Custom text 1 vertical position |
| `%+OTHER_TEXT:` | Custom text 1 content |
| `%+OTHER2_FONT:` | Font for custom text line 2 |
| `%+OTHER2_FONT_SIZE:` | Custom text 2 font size |
| `%+OTHER2_POS:` | Custom text 2 vertical position |
| `%+OTHER2_TEXT:` | Custom text 2 content |

#### Headers and Footers

Header/footer text is tab-separated into left, center, and right sections. Multiple header/footer sets can be defined by numbering them.

| Property | Description |
|----------|-------------|
| `%+HEADER_FONT:` | Header font |
| `%+HEADER_FONT_SIZE:` | Header font size |
| `%+HEADER_TEXT1:` | Header content for set 1 (tab-separated: left, center, right) |
| `%+HEADER_TEXT2:` | Header content for set 2 |
| `%+HEADER_IMAGE_HEIGHT:` | Height of header image |
| `%+HEADER_SPACE:` | Space between header and body |
| `%+HEADER_SPACE2:` | Space allocated for header itself |
| `%+HEADER_LINE_THICKNESS:` | Header separator line thickness |
| `%+FOOTER_FONT:` | Footer font |
| `%+FOOTER_FONT_SIZE:` | Footer font size |
| `%+FOOTER_TEXT1:` | Footer content for set 1 |
| `%+FOOTER_TEXT2:` | Footer content for set 2 |
| `%+FOOTER_SPACE:` | Space for footer |
| `%+FOOTER_SPACE2:` | Space between footer and bottom margin |
| `%+FOOTER_LINE_THICKNESS:` | Footer separator line thickness |

**Header/Footer Variables:**

| Variable | Description |
|----------|-------------|
| `@@` | Page number |
| `@A` | Level 1 heading title on current page |
| `@B` | Level 2 heading title on current page |
| `@C` | Level 3 heading title on current page |
| `@D`...`@Z` | Corresponding heading level titles (levels 4–26) |
| `@AA`, `@AB`...`@CU` | Level 27, 28 … heading titles. Two-letter codes use bijective base-26 (`A`=1…`Z`=26, `AA`=27, `AB`=28, …), reaching up to level 99. Codes are greedy and same-case, so `@AB` means level 28, not `@A` followed by a literal `B`. |
| `@a` | Level 1 heading numeral (e.g., "I", "1") |
| `@b` | Level 2 heading numeral |
| `@c`...`@z` | Corresponding heading level numerals (levels 3–26) |
| `@aa`, `@ab`... | Level 27, 28 … heading numerals (same bijective base-26 scheme as the title codes) |

In slide mode these resolve at the levels `%+MIN_PARENTS` removes from the slides too — putting
the book or chapter title in the running head instead of on every slide is the point of setting
both. A code whose level has no heading on the page still empties its cell (only that cell — the
three tab-separated cells substitute independently).

A letter code touching a letter or digit on either side is part of a word and stays as typed:
`jg@abc.com`, `@Bob` and `@ordstyle` print literally, while `@a.@b`, `(@A)`, `@A@a` and `Week @a`
substitute. `@@` substitutes anywhere (`p@@` prints `p7`).

A header image can be placed at the start of header text using `[logo.svg]` or `[logo.png]` syntax.

**Background Images:**

| Property | Description |
|----------|-------------|
| `%+BACKGROUND_IMAGE1:` | Page **fill** for page set 1 (see Fill specs below) |
| `%+BACKGROUND_IMAGE2:` | Page fill for page set 2 |
| `%+TITLE_PAGE_IMAGE:` | Page fill for the title page |
| `%+TOC_IMAGE:` | Page fill for the TOC pages |
| `%+LISTS_IMAGE:` | Page fill for the List of Figures / Tables pages |
| `%+INDICES_IMAGE:` | Page fill for the index pages |

The four front-matter keys take the same fill spec as `%+BACKGROUND_IMAGE`*n*, `|ink=` included
(the Settings background-image rows Title Page Image / TOC Image / Lists Image / Indices Image).
Only the exports read them: the LibreOffice export paints all four, the HTML export the title
page's; the PDF does not paint them.

The `%+BACKGROUND_IMAGE`*n* value is a **fill spec** — not just an image path. It can be a
color, a gradient, an image, or an SVG, and it bleeds full-page to the trim edge. Page sets
switch via the **Next Header** style effect, so a run of pages can be a dark color-blocked
chapter, a gradient cover, or a photo background. A raster page fill carrying a tone or
placement modifier — `gray`, `duo:`, `focus:` or `flip` (`img:photo.jpg,cover,gray`) — gets
that modifier and `cover`/`contain` scaling; a plain `img:` page fill (none of those four) is
placed at the top-left, scaled to the page width, whatever `cover`/`contain` says. `|overlay=`
applies either way.

#### Named layout regions (`%+REGION<N>:`)

A region is an author-declared frame on the page (sidebar, band) into which content is
**routed from a style** (see the `region=` presentation-spec key). Regions are page
furniture declared as **numbered per-section sets** riding the same Next-Header counter
as headers/footers/background images: the numeral suffix is the set index, several lines
share one suffix (one per named region), a section that declares no set inherits the
previous one (carry-forward), and `%+REGION<N>: none` explicitly clears.

```
%+REGION1: side  place=right  w=170  fit=content  style=Panel
%+REGION1: hero  place=top  h=70  style=Band  bleed
%+REGION2: none
```

**In a `:STYLE2:`/`:STYLE3:`/… variant block, a declared set REPLACES the one the variant
inherited from `:STYLE:`.** A variant begins as a full copy of the base style, so the rule
is the one headers and footers already follow — declare nothing at an index and you inherit
it; declare anything and the set is yours. The first `%+REGION<N>:` line in the block drops
the inherited set and the block's remaining lines build it up; other indices are untouched
(declaring `REGION2` leaves an inherited `REGION1` alone). Every variant inherits from
`:STYLE:` itself, not from the preceding variant.

There is deliberately no way to *extend* an inherited set — restate the regions you want to
keep. To give a variant **no** regions at an index, declare it empty with
`%+REGION<N>: none`; a bare omission inherits instead.

First token = the region **name** (matched by `region=<name>`); then `key=value` tokens in
any order: `place=` (`outer`/`inner`/`left`/`right`/`top`/`bottom`/`xy`),
`x=`/`y=`/`w=`/`h=` geometry (`Npt`/`N%`; `x`/`w` resolve `%` against the page **width**,
`y`/`h` against the page **height**) — `w` is a **side** frame's width, `h` a
`top`/`bottom` **band**'s height, and `x`/`y`/`w`/`h` together the **`place=xy`** rect.
`x`/`y` are the rect's **origin** (points from the left/top **margin lines**) only where the
frame HAS an origin to declare; on every other placement the frame is derived and `x`/`y`
are a **delta** off it instead — see "Frame position" below. `fit=` (`fixed`/`content`), `top=`/`bottom=` pins,
`anchor=` (`flow`/`page`; default flow for sides, page for bands and `xy`), `overflow=`
(`continue`/`clip`/`body`), `gap=`, `z=`, `style=<BlockStyle>` (**chrome by
reference** — the frame's fill/border/radius/pads come from that block style; no inline
chrome keys), `reserve=0|1` (does the body move for the frame? default `0`),
`bleed`/`bleed=<edges>`, `extent=full`, `valign=`, `rotate=`,
`anchor=after:<region>` (see below), `anchor=block:`/`after:`/`before:<style>` +
`align=` (see below), and `wrap=`
(`snap`/`strips`/`both` — how a `reserve=1` xy rect wraps the body; see
below). Unknown keys are tolerated.

**Region extras.**
- `valign=top|center|bottom`: on a **`fit=fixed`** frame (band/side/xy), the page's
  routed content run shifts down by the frame's free space (`center` = half). Applied
  per page after layout; `fit=content` frames ignore it (they hug content), and a
  **reserved flow-anchored** side frame ignores it with a warning (the anchor y drives
  the body wrap — moving the run would strand the wrap zone).
- `rotate=90|270`: the region's **content and chrome** paint rotated inside the
  declared frame; layout inside uses the rotated box's dimensions (w↔h swap), so a tall
  narrow rail gets long rotated lines. `90` reads top-to-bottom (glyph tops toward the
  right edge), `270` reads bottom-up (the spine-label look). Requires `fit=fixed`; other
  angles or `fit=content` warn once and render unrotated. A rotated region is
  **page-anchored** by definition and never joins same-side stacking; its reservation
  (rail intrusion / xy side-snap) uses the unrotated **page** geometry. HTML export
  ignores the key (PDF is the exact rendering).
- `anchor=after:<region>`: the frame's **top snaps to the named region's frame
  bottom** plus this region's `gap` — the robust region-vs-region composition (stacked
  bands, badges hanging off a band seam) with no absolute `y`. The target must be
  declared **earlier in the same set** (declaration order breaks cycles); a missing/later/self
  target warns once and falls back to the declared absolute geometry. Band body-shrink
  still sums declared heights set-wide, so two stacked reserved top bands displace the
  body by exactly their stacked extent.

**Anchoring a frame to a BLOCK.** A frame with **no routed content** — a rule, a tab,
a plate, a fold — can be pinned to the block that uses a style instead of to the page:

| key | value | effect |
|---|---|---|
| `anchor=block:<style>` | a style name | the frame sits **on** that block's painted box |
| `anchor=after:<style>` | a style name | below it, plus this region's `gap` |
| `anchor=before:<style>` | a style name | above it, minus `gap` |
| …`:first` / `:last` | suffix on any of the three | only that block's **first** or **last** appearance on the page; the default is **one frame per appearance** |
| `align=` | `left`,`right`,`center`,`width`, `top`,`bottom`,`middle`,`height` (comma list) | which of the frame's edges the block pins. Unnamed edges keep the declared `x`/`y`/`w`/`h`; `width`/`height` stretch the frame over the block |

The style is matched on the **full key** (`#2_Ti.first`), on its **role head** (`#2_Ti` — so
one line covers every selector variant), or on its bare **name** (`Head`, which composes to
`Bd_Head`). `x=`/`y=` stay usable as a nudge off the anchor. `anchor=after:<name>` resolves as
a **region** first — a set that declares a region of that name keeps the region-anchor meaning
above — and as a style only when it does not.

> The frame is positioned from content that is **already laid out**, so it cannot also
> receive content: give it a `region=` route as well and it warns and keeps the declared
> rect. A frame that must *hold* text below a block is not this feature. And a
> block-anchored frame never **reserves** — it follows the body, so it cannot displace it.

**A plate that starts where its content starts.** On `place=xy`, `anchor=flow` moves the
rect's **top** to the flow position of the content it holds, keeping the declared **width and
height** (`fit=content` grows the height instead; the two are different tools). `y=` becomes
the offset **below** that flow position and defaults to **0**, not the page-anchored 40 pt.
`reserve=1` is refused with a warning for the same reason as above: a frame that follows the
body cannot displace it. With no content there is no flow to follow and the frame stays put.

**Frame position — `x`/`y` are an origin or a delta, by placement.** A region either
declares where its frame is or derives it, never both, so one pair of fields covers both:

| the frame's position is… | `x` means | `y` means |
|---|---|---|
| declared — `place=xy`, no `anchor=after` | left edge, from the left margin | top edge, from the top margin |
| derived vertically — `place=xy` **+ `anchor=after`** | left edge, from the left margin | **delta** off the anchor's bottom + `gap` |
| derived — `place=left/right/outer/inner` | **delta** off the margin/gap/reserve pin | **delta** off the body band (or `top=`/`bottom=` pins) |
| derived — `place=top/bottom` | **delta** off the text width's left edge | **delta** off the band's page edge |

A delta is points (negative lifts / moves left) or `N%` of the page width (`x`) or height
(`y`). It moves the **frame** — geometry, not paint (unlike the style-spec `offset=`,
which is a paint-only displacement of ordinary blocks and is unrelated): chrome, routing,
`valign` and reservation all follow the shifted frame. Band body-shrink still sums the
**declared** heights, so nudging a reserved band moves its frame without moving the body.
When `anchor=after` fails to resolve, its fallback restores `y`'s absolute reading.

*Older files:* a region line may carry a separate `offset=dx,dy` frame delta. It is still
**read** (folded into `x`/`y` on load) and never written; the one shape it can express that
`x`/`y` cannot is a `%` origin plus a point delta on the same axis — that combination
warns and drops the delta, so restate such an axis in points.

**Reservation (`reserve=1`).** A reserved **band** (`place=top`/`bottom`)
shrinks the body band by its declared height + `gap` on **every page its set is active**
(set-wide, like `HEADER_SPACE`; `fit=content` bands also reserve the *declared* height —
content is never measured for reservation). Page-bottom footnotes stack above a reserved
bottom band. A reserved **side frame** pins its outer edge 4pt inside the trim and grows
*inward* past the margin; the body column narrows around the intrusion (`width + gap −
margin`), the same way it wraps a float. `anchor=page` side frames reserve the full body
band on every page of the set and paint their frame as page furniture even on pages
without routed content; `anchor=flow` (the side default) reserves only where the region
has content, starting at the **anchor y** — text above the anchor keeps full width, and
text below the content bottom reclaims it. Reserved `fit=fixed` frames
paint furniture chrome on every active page; `reserve=0` frames paint their chrome only
where they have content.

**Graphic plates (`z != 0`).** The other way to be furniture: a
`fit=fixed` frame with a non-zero `z` is declared **off the body plane**, so its geometry
cannot depend on content — it paints across its whole set with no content and no
reservation. That is the decorative case: a `z=-1` tint field the body prints over, a
rule, a corner tick, a `z=1` chip or rotated spine. Off-plane frames are page-anchored by
definition (like rotated ones) and reserve nothing, so `reserve=` does not apply to
them; a frame with no `style=` still paints nothing. See
`examples/gallery/g7-impact-report.ord` `:STYLE:` for a page-covering modular grid built
this way.

**`place=xy`.** A fixed rect anywhere on the page,
page-anchored on every page its set is active; `fit=content` grows from `y`. A
`reserve=1` xy rect wraps the body by **side-snap**: per intersected column ONE wrap
strip on the side of the **nearer** column edge (exact tie: the rect anchors right so
text keeps the left strip — reading starts at the left margin); the narrower gap stays
whitespace. A rect straddling a multi-column gutter gets text on both sides (one per
column); side-snap does not wrap both sides within one column (that is `wrap=both`, below). Any strip
narrower than the **min-strip floor** (8% of the page width) is not generated — if no
strip survives at a y, that band reserves **full width** and text resumes below the
rect (never dropped). Overlapping rects reserve their **union** regardless of `z`
(z stays paint-order only); same-side overlaps share the wider gutter, opposite sides
leave the middle channel, crossed overlaps whose gutters meet skip the shared rows.
Special blocks (tables, figures, presentations) crossing an xy band are not band-split.

**Wrap modes (`wrap=snap|strips|both`).** How a `reserve=1`
`place=xy` rect wraps the body; `snap` (the side-snap above) is the default and the
universal fallback.
- **`wrap=strips`** — the rect's y-band becomes a sequential **mini-span**: body text
  flows DOWN the left strip for the band's full height, then down the right strip, then
  resumes full width below (reading order snakes once per band). Strips under the
  min-strip floor are not generated (the span degrades — an off-center rect gives the
  one-strip side-snap look; no surviving strip skips the whole band). The flow continues
  **across block boundaries** inside the band; a run that ends mid-strip leaves the rest
  of the band whitespace. Aligned same-band rects form one N-strip span (an
  x-overlapping aligned pair merges into one hole); a **staggered** overlap (unequal
  y/h) warns once and falls back to side-snap — build it as aligned bands.
- **`wrap=both`** — **per-line** wrap on both sides of the hole: each visual line runs
  across the page, jumping the rect — the left and right segments share a baseline, and
  reading order goes ACROSS the hole, then down (the classic wrap-both-sides look).
  At each row, the surviving x-intervals are the
  column minus float gutters minus every reserve=1 hole at that y (overlapping holes
  merge; intervals under the floor drop), so side-by-side rects give three intervals
  per row and corner overlaps just change the interval set as the rows sweep each
  region edge. A row with NO surviving interval contributes no text (the flow resumes
  below). Justified text keeps its justification per segment.
- **Fallbacks (all warned once per render):** every rect in an overlapping
  cluster must agree on its wrap mode — a mixed cluster (or a wrap rect overlapping a
  `snap` rect in y) side-snaps as a whole; a paragraph carrying **inline objects** or
  **RTL text** side-snaps around wrap rects; balanced-column pages, `_Qt`
  blockquotes, tables and other special blocks side-snap.
  Wrap bands too close to the page bottom may degrade to side-snap (the split must fit
  the page). HTML export ignores `wrap=` (body-flow HTML has no absolute holes; the PDF
  is the exact rendering).

**Inline span `REGION|<name>` … `REGION|1`.** A directive **line** pair (like
`COL|`): every line between them routes into the named region exactly as if tagged
with a `region=<name>` style. Closes only at `REGION|1` or document end; an open span
wins over an enclosing whole-section route until it closes. The directive lines never
reach the output.

**Which route a block takes** — nearest decision first, and the first one that answers wins:

1. an inline `REGION|` span, written at the point of use;
2. the block's **own** style's `region=`;
3. the whole-section route it inherited from a heading.

**A route never makes a block a presentation record.** Field 19 holds two kinds of statement, and
only one of them decides what *kind* of block this is: `region=`, `place=`, `offset=` and `z=` say
**where** the block goes; everything else (`arrange=`, `cols=`, `widths=`, `next=`, `fieldgap=`,
`build=`, …) says what layout **mode** draws it. A tagged line becomes a presentation record only
when its spec makes a mode statement, so `[Pull] text` under a style whose spec is just
`region=ribbon` stays the paragraph it looks like — which is what makes `region=<name>` on a style
exactly equivalent to `REGION|<name>` around the line, declared region or not. State both and they
compose: `region=stats arrange=row cols=3` routes a three-column group into the stats region.

A **bare `[Style]` opener** — the tag alone on a line, with the records beneath it — is a group by
its own syntax, and a routing spec then just says where that group goes. There is no directive
spelling of a group for it to be equivalent to, so the two forms do not have to agree there.

**When the named region is not declared** the content returns to the body flow with a warning, as
the same block it would have been anyway. This matters most across **variants**: a `STYLE2` that
declares its own `%+REGION<N>:` sets does not inherit `STYLE`'s regions.

A decision made *on* the block outranks one made on an ancestor, the way the rest of the
cascade reads — so one style can lift its blocks back out of the region their section went
to without a directive around them. Reach for the directive when the run is a stretch of
several *different* styles, where "everywhere this style appears" would be the wrong claim.
As a diagnostic, running with the environment variable `ORD_ROUTE_DEBUG=1` prints every block
where 2 overrides 3.

Routed content keeps its **block-plane furniture**: a heading's section box / a single block's
box (and its accent bar) and the style's **icon** (slot 18) paint inside the frame, in the frame's
own space — under the frame's rotation where the region is rotated, and under the same clip its
text gets where the region clips. A section box that paginates through a frame paints one band
per page slice, exactly as it does in a column. The HTML and LibreOffice exports carry the
routed band and the block icon too.

Content routed to a region **paginates at block boundaries** into the same region on
following pages (`overflow=continue`, the default); `body` returns the overflow to the
main flow; `clip` truncates with a warning. `keep` is `continue` plus orphan-avoidance:
a `fit=content` panel whose multi-record group would strand only *some* records on a
mid-frame anchor defers **whole** to the next page when it fits there — so a discrete
card/rail stays together instead of leaking one row onto the previous page (it still
splits if the group is taller than a full frame). Content routed to a name absent from
the active set falls back to the body with a warning.

The routing key `region=<name>` lives in a style's **spec** (slot 19), exactly where
`place=margin` lives — but sharing that field with the presentation keys does not make a routed
block presentational (see "A route never makes a block a presentation record" above). It routes
the style's tagged lines / bare-`[Style]` groups into the region (a **bullet** reaches it through the
partial-`Bt` ladder its looks already cascade down — `BtL<n>T<n>` → `BtL<n>` → `BtT<n>` →
`Bt` — since its own key is synthesized, not a name anyone wrote); on a **heading style** (via a
trailing `[Tag]` on the heading) it routes the heading's **whole section** — with
`headbreak=` (`any`/`same`/`lower`/`none`, default `same`) picking the heading that ends
the span and `headfull=0|1` (default 1) deciding whether the trigger heading stays
full-width in the body or routes into the frame.

**A positional selector carries these too.** The whole-section route, `route=head`, and the
Columns field are resolved from a block's **effective** style name — after the selector overlay,
not from the raw cascade key — so `[#6_Ti.2@doc]` routes the *second* level-6 heading and leaves
the first on its role's route. Slot 19 has no per-field cascade, so a selector
that carries **no** `region=` does not hide the one its role carries; the Columns field does
cascade per-field, the way every other look does.

The same spec field carries the **placement keys** `offset=dx,dy` / `z=<int>`:
paint displacement in points and the paint plane for the style's
blocks — flow untouched. See the spec-key table under "The spec — layout only".

**A route-only spec keeps a figure a figure.** `region=` says *where* a block lands, not
*what layout mode* renders it, so a spec carrying nothing but `region=` (plus `offset=` /
`z=` / `place=body`) leaves a `[Name] ![alt](art.svg)` line — or `[Name] ```diagram`,
`CHART|`, `PYTHON|`, `MATH|` — a **figure**, exactly as it would be in the body: the art
paints, the **alt text is the caption**, and `[&Name]` geometry, `[>Name]` box chrome and
`Name_Cp` caption styling all resolve from the one prefix. It is simply placed inside the
frame. Add any real layout key to the spec (`flow=`, `arrange=`, `next=`, `cols=`, …) and
the line goes back to being a presentation **record**, whose image field has no caption
slot and ignores the alt text; a top-level `|` in the line makes it a record regardless.
Ordinary prose under a route-only name is a record either way — only the figure attach
differs.

#### Fill specs

A fill spec is the shared value type for the page background (above), a block-style
**Background** (block-style field 4), and a column `bg=` (the `COL|` spec). One value type,
edited everywhere through the same **Fill** dialog in Settings:

| Form | Example | Meaning |
|---|---|---|
| color / `$token` | `#1a1a2e` · `$accent` | solid fill |
| `grad(linear,<angle>,<stop>,<stop>…)` | `grad(linear,90,#1a1a2e,#0f3460)` | linear gradient (angle in degrees) |
| `grad(radial,<stop>,<stop>…)` | `grad(radial,#FFD194,#D1913C)` | radial gradient from the center |
| `img:<file>[,cover\|contain][,gray\|duo:<color>][,focus:<x>/<y>][,flip]` | `img:cover.jpg,cover,duo:$accent,focus:50/20` | raster image, scaled cover (default) or contain, optionally **toned**: `gray` desaturates it, `duo:<color\|$token>` duotones it (the same treatment the image grammar's `duo=` applies, so a `$token` re-skins the fill with the palette instead of baking one file per colourway). `duo:` wins over `gray`. **`focus:<x>/<y>`** places it: the point X% across and Y% down the picture lands on the same point of the box (CSS `object-position`), so it chooses what a cover crop keeps — `focus:50/0` keeps the top of a portrait; the default is `50/50`, the centre. **`flip`** mirrors the picture left to right before it is placed. Edited in the Fill dialog's **Tone**, **Focus** and **Flip** controls; all three apply to a raster `img:` fill only — an SVG fill is rendered, not toned |
| `svg:<file>` | `svg:motif.svg` | vector image |

A gradient stop is `color` or `color@pct` (e.g. `#000@50`). Trailing `|`-separated options:

| Option | Effect |
|---|---|
| `\|ink=<color>` | **reversed ink** — text/chrome over this fill flips to this color *only when its color is inherited all the way from `def`* (explicitly-colored text keeps its color). Works on **page** fills (rules/folios/header/footer/body) and **block-style box** fills (a section box inks its whole subtree; a single-block box inks itself) |
| `\|overlay=<color>` | translucent overlay color over an image (legibility for text-over-photo) |
| `\|bleed` | extend a column/region fill past the margins to the trim edge |
| `\|extent=full` | fill the full page/section height (column/region scope) |

Example dark gradient cover: `%+BACKGROUND_IMAGE1: grad(linear,90,#1a1a2e,#0f3460)|ink=#ffffff`.

#### Table of Contents

| Property | Description |
|----------|-------------|
| `%+TOC_LEVELS:` | Max heading level in TOC (0=none, 99=all) |
| `%+TOC_FONT:` | TOC entry font |
| `%+TOC_FONT_SIZE:` | TOC entry font size |
| `%+TOC_TITLE_FONT:` | "Table of Contents" title font |
| `%+TOC_TITLE_FONT_SIZE:` | TOC title font size |
| `%+TOC_HEADER_SET:` | Header/footer set for TOC: `Default`, `None`, or `Set_N` (case-insensitive; the numeric codes -1/0/N of older files are still read). Same forms for `%+LISTS_HEADER_SET:` / `%+INDEX_HEADER_SET:` |
| `%+TOC_IMAGE:` | Page fill for the TOC pages (see Background Images) |

#### Outline & Content Control

| Property | Description |
|----------|-------------|
| `%+OUT_LEVELS:` | Max outline levels to output (default: 99) |
| `%+MIN_OUT_LEVEL:` | Min outline level to output (default: 0) |
| `%+OUT_BODY_TEXT:` | Include body text (0 or 1) |
| `%+BLANK_DISABLED_STYLES:` | Slide mode: `1` = **hide** disabled-style content instead of dropping it, `0` = drop |
| `%+BLANK_EXCLUDED_TAGS:` | Slide mode: `1` = hide tag-excluded content instead of dropping it |
| `%+BLANK_BODY_TEXT:` | Slide mode: `1` = hide body text under a title instead of dropping it |
| `%+BLANK_LEVELS:` | Slide mode: hide headings **deeper** than this level (default 99 = hide nothing) |

Despite the `BLANK_` names, nothing is left blank. They choose between the
two ways a slide style can leave content out: **drop it** (the content and the slide it
would have owned both go) or **hide it** (the content goes, the slide stays, showing
nothing and taking no space). Hiding is what keeps two editions of one document — a deck
and a presenter's notes, say — on the same page numbers; a hidden entry's slide simply
holds the previous slide. All four are read in **slide mode only**. Settings presents them
as "Drop it / Hide it" under **Manually align slides**, with `BLANK_LEVELS` as **Max
Visible Level**. In a `SLIDE_FOLLOWS` group they are derived, not authored (see
`%+SLIDE_FOLLOWS:` under Slide Mode).

#### Footnotes

| Property | Description |
|----------|-------------|
| `%+FOOTNOTE_MODE:` | `Off`, `Endnotes_Doc` (end of doc), `Endnotes_Section` (end of level 1), `Footnotes` (bottom of page), `Inline` (case-insensitive; the numeric codes 0-4 of older files are still read) |
| `%+FOOTNOTE_TAB:` | Add tab in footnotes (0 or 1) |
| `%+FOOTNOTE_SUPER:` | Superscript footnote markers (0 or 1) |
| `%+FOOTNOTE_LINE_THICKNESS:` | Footnote separator line thickness |
| `%+FOOTNOTE_LINE_WIDTH:` | Footnote separator line width |

#### Paragraph Control

| Property | Description |
|----------|-------------|
| `%+MIN_PARAGRAPHS:` | Minimum paragraphs after a heading before a page/column break may fall between blocks (does not affect mid-paragraph splitting) |
| `%+MIN_LINES_TOP:` | Minimum lines at top of paragraph (widow control; with MIN_LINES_BOT, governs mid-paragraph splitting) |
| `%+MIN_LINES_BOT:` | Minimum lines at bottom of paragraph (orphan control; with MIN_LINES_TOP, governs mid-paragraph splitting) |
| `%+KEEP_TOGETHER:` | `None`, `Bullets`, `Outlines`, `Both` (case-insensitive; the numeric codes 0-3 of older files are still read) |
| `%+TAB_DISTANCE:` | Tab stop distance in points (default: 36.0) |
| `%+BULLET_INDENT_SPACES:` | Number of spaces added/removed when indenting bullets with Alt+Left/Right (default: 2) |
| `%+TITLE_REPLACEMENT1:` / `%+TITLE_REPLACEMENT2:` | Settings' "Long Title in TOC" / "Long Title in Header" (`0` or `1`, default `1`). A heading has no separate short form, so neither picks a different title. `TITLE_REPLACEMENT1` only decides whether the HTML and LibreOffice contents lists reduce a `{=role= …}` run in a heading to its text (`1`) or pass the heading through as written (`0`); `TITLE_REPLACEMENT2` has no effect |

#### Numeral/Bullet Styles

| Property | Description |
|----------|-------------|
| `%+NUMERAL_STYLES:` | Tab-separated 6-level numeral formats (e.g., `I.\tA.\ti.\ta.\t1.\t#@`) |
| `%+NUMERAL_STYLES_SG:` | Single-item variations |
| `%+TOC_NUMERAL_STYLES:` | Numeral styles for TOC |
| `%+TOC_NUMERAL_STYLES_SG:` | Single-item variations for TOC |
| `%+HEADER_NUMERAL_STYLES:` | Numeral styles for the lowercase header/footer variables (`@a`, `@b`, …) |
| `%+HEADER_NUMERAL_STYLES_SG:` | Single-item variations for headers: a header/footer numeral for an only-child heading (no siblings, not the top level) is taken from this list instead of `%+HEADER_NUMERAL_STYLES:` — the same rule as `%+NUMERAL_STYLES_SG:` below. Same tab-separated per-level format |
| `%+BULLETTYPES0:` ... `%+BULLETTYPES7:` | Custom bullet characters per level |

**Numbering template grammar.** Inside one of the templates above:

| Placeholder | Expands to |
|----------|-------------|
| `1` | Arabic ordinal — 1, 2, 3 … |
| `I` / `i` | Roman ordinal, upper/lower — I, II, III … (arabic outside 1–3999) |
| `A` / `a` | Letters, upper/lower, bijective base-26 — A … Z, AA, AB … |
| `@` `^` `&` `$` | Bullet glyphs • ‣ ⁃ ◦ |
| `#@` `#^` `#&` `#$` | The same glyph repeated once per ordinal, while the sibling count is under `%+MAX_BULLETS:` |
| `\x` | A literal `x` — escapes any of the above (and a literal `\`) |

A placeholder counts only where it **stands alone**: a `1`/`I`/`i`/`A`/`a` welded to
another letter or digit is literal text. So `Article I.` numbers on the `I` and
leaves the word "Article" alone, and `Appendix A.` numbers on the trailing `A`.
Use `\` where adjacency can't decide — `\A 1.` keeps a literal `A` and numbers on
the `1`. A template whose only digit sits inside a longer number (`10.`) has no
placeholder at all, renders the same text at every level, and reports a document
warning.

⚠ **`_SG` is not optional decoration.** A heading that is an **only child** (no siblings at its
level, and not the top level) takes its numeral from `%+NUMERAL_STYLES_SG:` instead of
`%+NUMERAL_STYLES:`. The built-in `_SG` list is
`{"I. ", "\t", "\t", "\t", "\t", "\t"}` — a **bare tab** at levels 2-6 — so blanking only
`%+NUMERAL_STYLES:` still leaves such headings indented by one tab stop with no visible
numeral, which reads as a mysterious indent nothing in the style fields can remove. Blank or
set **both** lists (and `%+TOC_NUMERAL_STYLES` / `%+TOC_NUMERAL_STYLES_SG` for the contents
page). Values in these lists write a literal tab as `<TAB>`.

#### Horizontal Rules

| Property | Description |
|----------|-------------|
| `%+HORIZONTAL_LINE_THICKNESS:` | HR line thickness |
| `%+HORIZONTAL_LINE_SPACE:` | Space around horizontal rules |
| `%+UNDERSCORE_LINE_THICKNESS:` | Underline thickness |

#### Indices and Lists

| Property | Description |
|----------|-------------|
| `%+BIBLE_INDEX:` | Generate Bible verse index (0 or 1) |
| `%+INDICES:` | Generate general indices (0 or 1) |
| `%+LIST_FIGURES:` | Generate list of figures (0 or 1) |
| `%+LIST_TABLES:` | Generate list of tables (0 or 1) |
| `%+LIST_DIAGRAMS:` | Generate list of diagrams (0 or 1) |
| `%+LIST_CIRCUITS:` | Generate list of circuits (0 or 1) |
| `%+LIST_CODEBLOCKS:` | Generate list of code blocks (0 or 1) |
| `%+LIST_BLOCKQUOTES:` | Generate list of blockquotes (0 or 1) |
| `%+NEW_INDEX_PAGES:` | New page even for short indices (0 or 1) |

#### Variables (reusable values: text, color, length, icon)

Define a value once and reference it by name as `$name` from anywhere — body text, a
style field, a block, table, column, fill, or icon. Re-skinning or rewording the whole
document then becomes a one-line edit. The same variable serves as a text replacement and
as a design token.

```
%+VAR: accent #E8543A
%+VAR: muted #6B7280
%+VAR: gap 12
%+VAR: company Acme Corporation
%+VAR: icon.tip char:★
```

One variable per line: `%+VAR: <name> <value>`. The name runs up to the first space (and
may contain `.`, e.g. `icon.tip`); the value is the rest of the line (so it may contain
spaces, e.g. `Acme Corporation`), without its leading and trailing spaces. Settings accepts
a name made of letters, digits, `_`, `-` and `.` only. Reference a variable with a leading `$` — its meaning
comes from **where** you use it:

- **In body text / headers / footers** — `$company` expands to its value. `Written by $company.` → `Written by Acme Corporation.` The reference is
  `$[A-Za-z0-9_-]+`, so a trailing period (`$company.`) and `$5` (no such variable → left
  literal) behave as expected; dotted names like `$icon.tip` resolve only in style fields.
- **Colors** — anywhere a color is read (`[#1]` color field = `$accent`, a block-style
  Background = `$panel`, a column `bg=$accent`, a fill `grad(linear,90,$accent,$muted)`,
  table border colors, the page `ink=$accent`).
- **Lengths** — a numeric value used for spacing/gaps (e.g. `gap 12` → reference as `$gap`).
- **Icons** — a style icon source (`$icon.tip`); register glyphs once as `%+VAR: icon.tip char:★`.

Three built-in variables are always available and are **not** stored as `%+VAR:` lines:
`$DATE` (the render date), `$TITLE` (`%+TITLE:`), and `$AUTHOR` (`%+AUTHOR:`).

An undefined variable resolves to nothing (a color/length falls back exactly like a bad
value; a body `$name` is left literal), so partial sets are safe. Variables **cascade across
sections**: a name resolves first against the active `:STYLE:` section, then falls back to the
**base section** (the first `:STYLE:` block). So you define variables once on the base and
every theme variant inherits them — a variant only re-declares what it *overrides* (e.g.
base sets `accent`/`ink`/`brand`; the dark variant re-declares only `accent`/`ink` and still
gets `brand` from the base).

Variables are also editable in **Settings → (styles) → Variables table** (Variable / Value
columns, with Insert / Delete / Up / Down). The table is per-section (it shows the active
style section's variables) and, on a shared document, edited live with collaborators like
the other style tables.

> **Sigils:** `$name` is for **variables** (values you define). `@` is reserved for
> **references into the document's structure** — cross-references (`@fig:`/`@ref:`/`@tbl:`)
> and header/footer variables (`@@`/`@A`/`@a`). Very old files may use an `@name` token form or
> `%+PALETTE:` / bare `%+KEY:` replacement lines; these are **not** read — restate them as
> `%+VAR:` lines.

#### Highlights (the `%+HIGHLIGHT_*:` directives)

Highlights 1-95 (plus `b`, `i`, `u`) can have custom colors and effects applied to them,
edited on the **Highlights** settings page. You apply one to the current word/selection from
the editor via the **Highlight Word** shortcuts (`Ctrl+Shift+1`…) or `/highlight N`; it is
stored as an **invisible mark** on the text, not typed as visible characters. (Distinct from
*inline content tags* below — `{:name: …}` — which gate conditional content rather than
format it.)

| Property | Description |
|----------|-------------|
| `%+HIGHLIGHT_FOREGROUNDS:` | Space-separated `key:#AARRGGBB` pairs (e.g., `1:#ffff0000 2:#ff00ff00`) |
| `%+HIGHLIGHT_BACKGROUNDS:` | Space-separated `key:#AARRGGBB` pairs |
| `%+HIGHLIGHT_UNDERLINES:` | Space-separated `key:#AARRGGBB` pairs |
| `%+HIGHLIGHT_EFFECTS:` | Space-separated `key:value` pairs |
| `%+HIGHLIGHT_ENABLES:` | Space-separated `key:value` pairs (show/hide each highlight) |
| `%+HIGHLIGHT_DESCRIPTIONS:` | Tab-separated `key:description` pairs |
| `%+HIGHLIGHT_FONTS:` | Tab-separated `key:font` pairs; the font is a `%+FONT_ALIAS:` name (its bold/italic come with it) or a family name, e.g. `1:Monaspace Radon	b:SerBd`. A `b`/`i` row's font replaces the block font's `_Bd`/`_It` alias. Used by the PDF, HTML and FODT output, and by the editor unless the theme's "Show highlight fonts in the editor" is off |
| `%+EXCLUDE_TAGS:` | Space-separated list of tags to exclude from output |
| `%+EXCLUDE_CHILD_TAGS:` | Tags to exclude children from output |
| `%+INVERT_HIGHLIGHT_COLORS:` | Invert highlight foreground/background (0 or 1) |

#### Font Aliases

Map short alias names to actual system font names. Tab-separated.

```
%+FONT_ALIAS: Ser	Noto Serif
%+FONT_ALIAS: SerBd	Noto Serif<bold>
%+FONT_ALIAS: SerIt	Noto Serif<italic>
%+FONT_ALIAS: San	Noto Sans
%+FONT_ALIAS: Mono	Noto Sans Mono
```

Bold/italic modifiers: append `<bold>` or `<italic>` to the font name.

#### Slide Mode

| Property | Description |
|----------|-------------|
| `%+SLIDE_MODE:` | Enable slide presentation mode (0 or 1) |
| `%+SLIDE_PAGE_SIZE:` | Sibling-grouping window size (default 4). In the `legacy` break modes, groups N sibling bullets per slide. In the `outline` modes, each leading body block is its own slide and this controls the rolling-context window: `1` = show only the current bullet, `N` = show up to `N-1` prior siblings as context above. A text style's field 15 (Sibs) overrides it per block; a `.5` fraction there turns on `SLIDE_PAGE_ROUND` for that block |
| `%+SLIDE_PAGE_ROUND:` | Don't leave a lone sibling on a final slide (0 or 1). When a run of siblings is grouped `SLIDE_PAGE_SIZE` to a slide and the last group would hold just one (5 or 9 siblings at size 4), that one joins the slide before. Applies to count-based grouping only, not `SLIDE_FIT_PAGE` |
| `%+SLIDE_FIT_PAGE:` | Fit content to page height (0 or 1) |
| `%+MAX_BULLETS:` | Sibling-count threshold for the repeating bullet placeholders (`#@` `#^` `#&` `#$`, see "Numbering template grammar"): under it the glyph repeats once per ordinal, at or over it a single glyph is drawn (default: 4). Does not limit how many bullets a slide holds |
| `%+MIN_PARENTS:` | Skip top N outline levels in slide mode |
| `%+NO_SIBLINGS:` | Hide sibling sections (0 or 1) |
| `%+SLIDE_VALIGN:` | Vertical anchor of slide content within the page: `Top` (default), `Center` (content centered in the slack between top and the bottom margin/footnote area), or `Bottom` (case-insensitive; the numeric codes 0-2 of older files are still read). Older files may contain `%+SLIDE_ANCHOR_BOTTOM:` instead; it is still read (`1` maps to `Bottom`) and never written |
| `%+SLIDE_BREAK_MODE:` | Slide-break trigger model. One of `outline` (default — break on every leading body block — one slide per piece of content — plus `SLIDE_PAGE_SIZE`-controlled rolling context above each bullet; cascading split for overflow), `legacy` (break where a text style's New Page field (10) asks, carried by the parent titles repeated on each slide, plus `SLIDE_PAGE_SIZE` sibling grouping), `legacy-overflow` (legacy triggers, no auto-break — content paints past bottom margin), `outline-overflow` (same break points as outline, no auto-break — deterministic slide count), `follow` (consume another style's break list for exact alignment; see `%+SLIDE_FOLLOWS`) |
| `%+SLIDE_FOLLOWS:` | Master style name to soft-align with. Required iff `SLIDE_BREAK_MODE=follow`. Follower forces a break at every master fresh-break source; when the master broke at a source the follower has stripped (e.g., master `%+MIN_PARENTS: 2` + follower `%+OUT_LEVELS: 2`), the follower inserts a phantom page that duplicates the immediately preceding page, so the follower's PDF has exactly the same page count as the master's |
| `%+SLIDES_WINDOW:` | Slide window slot this style renders into: `None` or `Window_1`..`Window_4` (case-insensitive; the numeric codes 0-4 of older files are still read) |
| `%+SLIDES_LINK:` | Page-navigation link group; slides with same group navigate together: `None` or `Group_1`..`Group_3` (the numeric codes 0+ of older files are still read) |
| `%+SLIDES_DRAW_SOURCE:` | If 1, this style's slide window broadcasts drawing/text/erase events to followers in its draw-link group |
| `%+SLIDES_DRAW_LINK:` | Drawing link group, independent of `SLIDES_LINK`: `None` or `Group_1`..`Group_3` (the numeric codes 0+ of older files are still read). Sources broadcast to non-source styles sharing this group; followers become read-only with input locked. Follower-side scale mode and live-cursor preference live in editor settings (per slide slot). |

Slide mode does not scale fonts by itself: a slide style that wants a larger deck scale sets
`%+FONT_SCALE:` (see Miscellaneous), e.g. `%+FONT_SCALE: 1.5`. Nor does it invert inline SVGs on
its own: set `%+INVERT_IMAGES: On` (or `Auto`) on dark decks.
Multi-column regions (`COL|` directives or a column spec in a style's Columns field) collapse
to a single top-to-bottom flow in slide mode — column geometry is print-only. A pipe table whose
following `CHART|` has `{table=hide}` is skipped entirely in slide mode (no slide is produced
for it).

#### Bible Version

| Property | Description |
|----------|-------------|
| `%+VERSION:` | Bible translation version: "nasb" or "esv" |

#### Miscellaneous

| Property | Description |
|----------|-------------|
| `%+EXTENDED_STYLES:` | Extended style cascade (0 or 1) |
| `%+GLOBAL_OPT:` | Global style options |
| `%+FONT_SCALE:` | General per-style font-size multiplier (default `1.0`, clamped 0.25–4.0). Every font-size read for the style is scaled — body, headings, measurement, everything — so one line rescales a whole style (e.g. a large-print variant, or `1.5` on a slide style) |
| `%+INVERT_IMAGES:` | Block-image pixel inversion: `Off` (default), `On`, or `Auto` — invert only when the page background is perceptually dark (luminance < 50%; solid fills exact, gradients stop-average, image backgrounds fall back to the `def` style's page color). Usable by any style, slide or print. Applies to standalone image blocks, raster and SVG alike (an inverted SVG is rasterized at 2× for the inversion) |
| `%+FIG_FONT:` | Figure caption font, found in older files: still read, into the `[Cp]` font, and never written. Define captions with the `[Cp]` text style. |
| `%+FIG_FONT_SIZE:` | Figure caption font size, found in older files: still read, into the `[Cp]` font size, and never written. |

#### Dash Handling

Custom dash characters and their behavior when encountered in text.

| Property | Description |
|----------|-------------|
| `%+DASH0:` ... `%+DASH9:` | Custom dash character definitions |
| `%+DASH_ACTION0:` ... `%+DASH_ACTION9:` | Action on encountering dash: `None`, `Paragraph`, `Newline`, `Space`, `Colon` (": "), `Remove_First_Block`, `Remove_Second_Block`, `Remove_First_Section`, `Remove_Second_Section`, `Dash_1`..`Dash_10` (case-insensitive; the numeric codes 0-18 of older files are still read) |
| `%+DASH_SWAP0:` ... `%+DASH_SWAP9:` | Swap left/right parts (0 or 1) |
| `%+DASH_ADD_STYLE0:` ... `%+DASH_ADD_STYLE9:` | Add style tag to new line (0 or 1) |

### Text Style Definitions

Styles control the appearance of headings, body text, and other elements. Each style is defined on a line starting with `[name]` followed by tab-separated property values.

**Heading/Body Styles:** `[name]`

```
[def]		Noto Serif	12	0	0	0	0	12	0	0	0	0	0	#000000	7	normal	0
[#1]	Chapter Title	SerBd	24	0	0	10	6	0	100	2	1	0	0
[#2]		SerBd	18	0	0	8	4	0	100	1	1	0	0
[Bd]	Body	Ser	12	0	0	0	0	12	0	0	0	0	0
```

**Line shape:** `[key]` TAB **Name** TAB *then the numbered fields below*.

The **Name** is the friendly label shown in the Settings Styles table (column 1) and is what a
style picker displays instead of the key. It may be empty — but **the tab must still be there**.
A line that omits the Name column entirely is silently misparsed: every value shifts one place
left, the font name is read as the Name, the size as the font, and the style falls back to
defaults with no error. Compare `[#1]	Chapter Title	SerBd	24…` with `[#2]		SerBd	18…` above —
both are correct; `[#2]	SerBd	18…` would not be.

⚠ **Only text styles have a Name column.** Table (`[|name]`), block (`[>name]`), chart
(`[~name]`) and figure (`[&name]`) lines are `[key]` TAB *field 0* TAB *field 1* … with **no
name**. Writing `[>Qt]	Quote box	0	0	…` shifts every block-style field
one place and the chrome silently vanishes.

The Name is **display only** — the Settings table, style pickers, and the presentation
`slots=name` cell, which injects a row style's Name as a labelled field (see "Presentation
styles"). It is never printed into the page by itself.

Field order (tab-separated), **counting from the font — i.e. the third value on the line, after
the key and the Name.** The numbering below is the one used throughout this document; it is offset by one from the on-disk position and by two from the Settings column
index (Settings column 0 is the key, 1 is the Name, 2 is field 0 here):
0. Font name/alias
1. Font size
2. Indent (negative = outdent)
3. Left margin
4. Right margin
5. Top — space before (length — see **Length values** below)
6. Bottom — space after (length)
7. Line height
8. Height type — `Single`, `Proportional`, `Fixed`, `Minimum`, `Leading` (case-insensitive;
   the numeric codes 0-4 of older files are still read; the Settings dropdown shows "Line
   Distance" for `Leading`)
9. Alignment — `Left`, `Right`, `Center`, `Justify` (case-insensitive; the numeric codes
   1/2/4/8 of older files are still read — a hand-authored numeric outside the closed list, e.g. a combined
   bitmask, passes through unchanged)
10. New Page — a small bitfield. **Low 4 bits = break-BEFORE trigger**: 0=Auto (no forced
    break — the paginator decides, like CSS `break-before: auto`), 1=Always, 2=≥50%,
    3=≥75%, 4=≥90% of page filled before break, 9=never break before this block
    (keep-with-previous — removes the seam from the breaks the engine may choose).
    **Bit 16 = break AFTER** the block — on a heading role (`#N`/`#N_Ti`) after the
    heading's whole outline subtree (the heading and everything beneath it, to the next
    heading of level ≤ its own), like the section-box range. Any combination is valid:
    `16` = after only, `17` = **own page** (Always + After — the style alone puts the
    block or section on its own page, composing with Box Width / H-Align / V-Align for a
    centered plate), `19` = ≥75% + After, `25` = never-before + After. The after-break
    lands on the next block through the same logic as `PAGEBRK` (suppressed when that
    block already opens a page, so it never doubles with an np heading or an explicit
    directive; no trailing blank at document end). Put after-breaks on `#N_Ti`, not
    `#N` — heading np cascades into the body roles by design (each child block would end
    its own page). Older files may hold `5` (read as `16`) and `6` (read as `17`).
    Edited in Settings as Before-trigger radios + a "New Page After" check. The LibreOffice
    (FODT) export mirrors the after-break via `fo:break-before` on the computed target block;
    the HTML export does not reproduce New Page at all — the export is one continuous flow and
    its print sheet forces **no** page breaks anywhere. An explicit `PAGEBRK`
    emits an inert `.ord-pagebrk` marker div, and only break-*avoid* intent
    (keep-with-next, unsplittable figures) reaches the print sheet. Slide outline/follow
    modes ignore after-breaks like every other spontaneous break.
11. Effect bitfield (1=Bold, 2=Italic, 4=Underline, 8=Disable, 16=Numerals in TOC, 32=Numerals in Text, 64=Exclude from TOC, 128=Keep With Next, 256=Next Header, 512=Oblique, 1024=No Line Break, 2048=Column Break, 4096=Hard Break, **8192=Structural**, **16384=End Columns**)

    The field is a **bitfield, inherited whole** — a selector row that sets any bit asserts
    all of them, so a Column Break beside an existing Keep With Next is written `2176`, not
    `2048`.

    **16384 "End Columns"** closes the open column region **after** this block — the
    style-side `COL|1`. `Columns = 1` on a following style closes a region too, but only
    where something with a style follows: where the next thing is a `SPACE|` line, or
    nothing, there is no block to hang the closing spec on and the region swallows content
    that belongs after it. The bit puts the answer on the region's **last** block instead,
    so the region ends exactly where the author means it to. It does what an authored
    `COL|1` at that point does, suppression included (the section's Columns cascade will not
    re-open the region on the very next paragraph), and it reaches HTML and FODT for free —
    both read the same span table. Inert when no region is open. In slide mode it is
    strictly better than the directive: an authored `COL|1` claims a blank slide of its own
    and the effect does not.

    **8192 "Structural (prints nothing)"** is not `8` "Disable".
    Disable drops the line **before it becomes a block**, so the outline level, the style
    scoping it opens and any region route it triggers all die with it — too strong for a
    heading whose only job is structure. Structural keeps the block: it sets the outline
    level, scopes `#N_*` styles to its section, triggers a `region=` route and a `COL|`
    span — and prints nothing, at zero height, in PDF, HTML and FODT alike. It is implicitly
    excluded from the TOC (a heading that prints nothing is not a table-of-contents entry).
    Use it instead of the `size=1` + `#00000000` trick, which reserves a line box and drifts
    with the body type.
12. Color (#AARRGGBB)
13. Verse mode
14. Caps — `Upper`, `Lower`, `Small_Caps`, `First_Letter`, `First_Letter_SC`, `Title_Case`,
    `Title_Case_SC` (case-insensitive; the numeric codes 1-7 of older files are still read)
15. Sibs (number of siblings shown in slide mode)
16. Columns — per-style `COL|` spec that turns this heading's section into a multi-column region (empty = none)
17. Letter spacing — uniform spacing between letters, in points (0 = none; loosen for all-caps headings, tighten display type). (Typographically "tracking".)

(Spacing mode: `%+SPACING_COLLAPSE: 1` makes the gap between two blocks the **larger** of the
first's space-after and the second's space-before, instead of the sum — CSS/Typst-style
collapsing, for even vertical rhythm. Default 0 = additive.)

**Length values.** A length field takes one vocabulary, whichever field it is: an **absolute**
value (`12`, `12pt`, `4mm`, `1cm`, `0.5in`, `16px` — a bare number means points), a
**font-relative** keyword measured against the owning style's metrics (`cap`/`auto` = cap
height, `x` = x-height, `line` = line height, `<n>em` = n × the style's point size), or a
**`$token`** (a variable) resolving to either. Font-relative values track the type: a heading at
`1em` of space-before keeps its proportion when the font size changes. A value that resolves
to none of these is reported on stderr and treated as 0 rather than silently becoming one.

The fields that take a length: text-style **5** and **6** (space before/after) and the
block-style geometry — pads (Left/Right/Top/Bottom), Line Width, Round Size, Left Bar and
Space After Bar. Style **icon** sizes take the same keywords (see field 18). Text-style
Indent / Left margin / Right margin / Line height are plain numbers.
*(There is no OpenType-features field: true small caps come from the **Caps** field;
old-style, lining or tabular figures and ligatures cannot be selected.)*
18. Style icon (see below)
19. Presentation spec (see "Presentation styles")
20. Sequence chain — see "Sequence chaining (`seq=`)" below.

Field 18, the Style icon — a decoration glyph/image stamped on every block using the style. Spec: `<source>|pos=<placement>|size=<W>[x<H>]|fit=fill|gap=<pt>|box=<rect>|line=<ref>|offset=<dx>,<dy>|align=<reg>|tint[=color]|ghost[=pct]|behind|mirror`. A size value is a literal point number or a reference resolved against the style's font metrics: `cap`/`auto` = cap height, `x` = x-height, `line` = line height, `<n>em` = n × the style's point size. `source` is `char:★` (or `char:U+25B6`), an `.svg`, a raster file, or **`$icon.<name>`** — a variable lookup, so a brand registers its glyphs once (e.g. `%+VAR: icon.tip char:★`).

**Several icons on one style** — a top-level **`;`** separates whole specs, `|` separates the options within one, so `char:●|pos=edge.tc;char:●|pos=edge.bc` puts a cap on the block's top edge and another on its bottom without inventing a second style. They paint in the order written. A source needing a literal `;` is not expressible.

**A non-square icon** — `size=<W>x<H>` (or the equivalent `width=` / `height=`) sizes the two axes independently, each taking a number or a keyword: `size=200x4` is a rule, `size=12xline` is a tall thin mark. One value keeps the box square. The source is **aspect-fitted** into the box by default, so a rule SVG drawn at its own proportions comes out exactly its declared size — and **`fit=fill`** (alias `stretch`) scales the art to the box on **both** axes instead, which is what makes one plain rectangle glyph or one square SVG serve as a rule of any width. On a `char:` source `fit=fill` scales the glyph's *tight ink box*, so `char:▬|size=72x6|fit=fill` is a 72 × 6 pt bar with no bespoke asset. Without it a glyph fits the smaller axis.

`pos` placements:
    - `<rel>.<anchor>` — the 9-point grid `tl/tc/tr/ml/mc/mr/bl/bc/br`, with `rel` saying how the icon meets the edge it names: **`inside`** (wholly within, `gap` insets inward — `box` is an equivalent spelling), **`edge`** (the icon's centre lands ON the boundary, half in and half out; `gap` shifts it along the outward normal), **`outside`** (wholly beyond the boundary; `gap` pushes it further out). A centre anchor (`c` / `m`) has no boundary on that axis, so `rel` does nothing there — `edge.tc` straddles the top border and stays horizontally centred. `outside.br` is the hanging corner ornament; `edge.bc` is the cap on a plate's bottom edge.
    - `margin.<side>` — a page-gutter wayfinding marker just OUTSIDE the block edge, level with its first line. `side` is `left`/`inner` (left gutter) or `right`/`outer` (right); `gap` is the offset into the gutter. (`marker` is an alias for `margin.outer`.)
    - `stack.<above|below>` — its OWN reserved line above or below the block, consuming real vertical space (not overlapping the text). Horizontal registration via `align=left|center|right` (default center). Only the FIRST `stack` spec in a `;` list reserves a line.
    - `inline.<before|after>` — a glyph (`char:` only) that flows IN the text run, before or after the block's text — part of the line, so it wraps and sits on the baseline. (`bullet` is an alias for `inline.bullet`.)
    - `watermark` — a faint centered mark (alias for `box.mc` + ghost).

**Which rectangle the anchor names** — `box=`, on the grid placements only:

| value | rect | for |
|---|---|---|
| `chrome` (default) | the box the block PAINTS: its section/single-block band, padding and `Bleed` overhang included. On a **presentation** that is the union of the group box, the record tiles and the cells it draws — a row's padding and its `bleed=` move the anchor with the visible tab. A block that paints no box falls back to its own band — the placement width, with the space-before/after taken off | corner ornaments, tabs, hanging marks — anything registering against the visible plate |
| `content` | inside the box padding, level with the text and inside the style's left/right margins | a badge that must line up with the words, not the plate |
| `spaced` | the block's outer box, space-before/after included | anchoring against the block's whole slot, spacing included |

> `chrome` is the default because `spaced` reaches above a plate by the block's whole space-before: with space-before 60, `pos=box.mc|box=spaced` puts the icon above the painted plate entirely. On a heading whose style paints a **section** box, the painted box is that whole band — reach for `box=content` to anchor on the heading line instead.

**Which line it lines up with** — `line=box` (default for the grid placements), `line=first`, `line=last`. `first`/`last` replace the rectangle's vertical extent with that text line's cap band, so `pos=outside.ml|line=first` is a badge beside the opening line of a multi-line block and `line=last` marks its end. The `margin` placement centres on the first line: it defaults to `line=first`.

**The nudge** — `offset=<dx>,<dy>` (also spellable `dx=` / `dy=`) shifts the icon in points after every other rule has run. It is for optical correction — a glyph whose ink is not centred in its em box, a deliberately asymmetric hang — not for placement: anything structural belongs in the three axes above, which survive a change of type size.

    `tint` recolors a glyph to the style color (or a given color); `ghost[=pct]` fades it (watermark default 12%). `behind` paints the icon BEHIND the block content (z-order) — the default is in front, so a box corner badge sits on top of text while `watermark`/`behind` sit underneath. `mirror` flips the horizontal side on verso (even) pages, so a `margin.outer` marker rides the true outer edge on both recto and verso (recto/verso books). Heading-level icons are heading-scoped: an icon on `#N` (or `#N_Ti`) stamps only the heading block itself — it does **not** cascade to the section's body/bullet/card roles. Icons defined on a *role* (e.g. `Bd`) still cascade normally (`#N_Bd` inherits `Bd`'s icon); a style can set its icon field to `0` to suppress an inherited role icon. Examples: `char:★|pos=box.tr|size=12|tint=$accent` · `char:§|pos=margin.outer|size=14|gap=6|mirror|tint=$accent` · `$icon.tip|pos=box.tl|size=cap` · `crest.svg|pos=watermark|size=200` · `fold.svg|pos=outside.br|size=18x18` · `rule.svg|pos=edge.bc|size=155x2` · `char:●|pos=edge.tc|size=8;char:●|pos=edge.bc|size=8`. (`inline.bullet` prepends the glyph like `inline.before`; it does not replace a list marker.)

Trailing fields are optional; a line with fewer fields takes the defaults for the missing ones.

Closed-list (dropdown) fields — text fields 8/9/14, table-style fields 0/1/20, block-style
fields 15/16, and the `%+KEY` enum lines (`%+UNITS`, `%+KEEP_TOGETHER`, `%+FOOTNOTE_MODE`,
`%+SLIDES_WINDOW/LINK/DRAW_LINK`, `%+DASH_ACTIONn`, `%+*_HEADER_SET`) — persist as a short
disk token: the dropdown label where it's a single word (`Justify`, `Auto`), otherwise a
one-word code or `_`-joined form (`Leading`, `Small_Caps`, `Bullets`, `Endnotes_Doc`,
`Set_2`; the Settings dropdowns keep showing the full labels). Tokens are matched
case-insensitively on read; the numeric codes of older files remain readable, and numerics
outside a field's closed list (e.g. a combined align bitmask) pass through unchanged.

The `[def]` style is the default fallback. `[#1]` through `[#6]` are heading level styles. `[Bd]` is body text. Custom names like `[MyStyle]` can also be defined.

#### Sequence chaining (`seq=`, the "Next / Sequence" field)

A style's **Sequence** field (text-style field 20; Settings column "Next / Sequence")
declares that **the blocks *following* a block of this style continue in a fixed order
of styles** — InDesign's "Next Style", generalized to a whole grammar. Nothing is written
into the document: the rule applies at render, like positional selectors, so typing a new
paragraph after a Kicker simply *is* a Title in the preview (the editor's keystrokes are
unaffected).

Grammar (the same micro-grammar `fields=` signatures use): a fixed prefix + `?`
optionals + at most ONE repeating tail — `A,B,C?,(X,Y)*`. `next=B` is just the length-1
case (`seq=B`); `cycle=A,B` is just the repeat-only case (`seq=(A,B)*`).

| Use case | On style | Sequence |
|---|---|---|
| Front matter | `[#1]` | `Kicker,Title,Sub?,Lead` |
| Name/blurb alternation | `[#3]` | `(HN,HB)*` |
| Sign-off pair (`next=`) | `[Sign]` | `SignSub` |
| Q&A | `[Q]` | `Answer` |

Semantics:

- **Anchors.** On a **heading** style the anchor is the section start — the sequence
  styles the section's leading body paragraphs (the heading itself is untouched; any
  new heading ends all open sequences). On a **non-heading** style the anchor is *any
  occurrence* of that style — an explicit attach, a chain step, or another sequence.
  A positional-selector match does **not** anchor a sequence: chains are assigned
  before selectors run, so a
  style a block receives only via a `.`-selector never fires that style's `seq=`.
- **Nearest anchor wins while active; the outer sequence resumes after.** An explicit
  `[Pull]` attach mid-sequence styles nothing of the outer chain (attach always wins),
  fires its own `seq=` if it has one, and the outer sequence then continues where it
  left off.
- **Loops are the alternation feature** (`A seq=B`, `B seq=A`) — the forward pass makes
  them repeating assignments, never an error.
- **What consumes a step:** plain body paragraphs only. Figures, tables, quotes,
  bullets, presentations and directives neither consume a step nor end the sequence;
  blank lines are skipped. An `?` optional step is included left-to-right while the
  section still has enough paragraphs for the required steps (so `Sub?` appears when
  there are four leading paragraphs and disappears at three).
- **Own-style only** — the field never cascades (a trigger field, like the Presentation
  spec). Positional selectors layer *above* a chain assignment per-field; the chain name
  itself composes like an attach (`#1_Bd_Kicker`), so unset fields fall back through the
  body role as usual. Ladder: explicit attach > selector > chain > role.
- **Unknown style names** in a sequence are allowed and warned (orange cell; the step
  assigns a name that contributes no fields). Renaming a style in Settings rewrites the
  sequences that reference it.
- **Break behavior follows the step style**, like an attach: a step carrying Keep With
  Next, Column/Hard Break or a New page value applies it to the block it lands on (see
  the same note under positional selectors; exclude-from-TOC is the one field that stays
  on the pre-chain role).
- **Slide-mode caveat:** slide-edition grouping (which blocks share a slide, sibling
  re-listing, own-slide flags) is decided from the block's *pre-chain* role — chain
  names, like positional selectors, apply to painting only. A chained block therefore
  paints like its step style but *groups* like a plain paragraph in a slide deck. Where
  a document has slide editions and the grouping distinction matters (alternating
  pairs, sign-offs), keep the explicit attach.

The Settings cell shows the chain (`Kicker → Title → Sub? → Lead`); double-click opens
the **sequence builder** (step list with style dropdowns, optional checkboxes,
reordering, and the "remaining blocks use the normal role" vs "repeat last N steps"
tail choice) with a live teaching line showing the generated spec. As a diagnostic, the
environment variable `ORD_RULE_DEBUG=1` traces the decisions.

#### Style name suffixes

Style names can carry one or more suffixes that mark a style as the role-specific variant of another style. The suffix participates in the cascade: a lookup strips the rightmost suffix and looks up the parent before falling back to `def`. Common suffixes:

| Suffix | Meaning | Example |
|--------|---------|---------|
| `_Ti` | Title (heading) | `#1_Ti` |
| `_Bd` | Body | `#1_Bd` |
| `_Af` | After Title — the body role's variant, so a *leveled* After-Title style is written on the body role. Bare `Af` (any level) is on the chain in its own right | `Af`, `#1_Bd_Af`, `#1_Bd_Hoods_Af` |
| `_Qt` | Quote / frame chrome (also bears the block-style fields) | `#1_Qt`, `#1_Qt_warning` |
| `_BtL<L>T<T>` | Bullet at level `L`, type `T` (1=`-`, 2=`+`, 3=`I.`, 4=`A.`, 5=`1.`, 6=`a.`, 7=`i.`, **8 = the item's continuation text**). `L` and `T` are **independently optional**: `_Bt`, `_BtL<L>`, `_BtT<T>` and `_BtL<L>T<T>` are all valid, cascading `BtL3T2` → `BtL3` → `BtT2` → `Bt` | `#1_BtL2T5`, `#1_BtL3`, `_BtT2`, `Bt` |
| `_Cp` | Caption / figure title (font, size, color, alignment of the caption text) | `Cp`, `#1_Im_Cp`, `#1_Qt_warning_Cp` |
| `_Fn` | Footnote — like `_Af`, a variant of the body role when leveled | `Fn`, `#1_Bd_Fn` |
| `_Tb` | Table (the cell text of a pipe table) — likewise | `Tb`, `#3_Bd_Tb` |
| `_Nl1` ... `_Nl9` | Per-newline style for headings (line 1..9 of a multi-line title) | `#1_Nl2` |
| `_Im`, `_Sv`, `_Di`, `_Ci`, `_Ct`, `_Py` | Image / SVG / Diagram / Circuit / Chart / Python figure | `#1_Im`, `#1_Di_Cp` |

**A bare `[#N]` styles the whole section; `[#N_Ti]` styles only the heading.** The reduction drops
the *leading* part before it drops the heading level, so a level-N body reduces
`#N_Bd` → `Bd` → `#N` → `#N-1` → … → `#1` → `def`. Every role in a section passes through that
section's bare `#N` (and every shallower `#M`) on its way to `def` — by design, so one `[#1]` row
can set the font, size, measure or color of a whole chapter. Anything meant for the **heading
alone** goes on the heading's own title role: **`[#N_Ti]`** for one level, **`[Ti]`** for all of
them. `Ti` is on `#N_Ti`'s chain (`#N_Ti` → `Ti` → `#N` → … → `def`) and on no body role's chain.
This is the same rule the New Page field states above ("put after-breaks on `#N_Ti`, not `#N`") —
it holds for every field, not just that one.

**Canonical suffix order.** A style key is written

```
[#N_]<role>[_<name>][_Qt[_<frame>]][_<sub>]  .<spec>…  /<cell>…  :<pseudo>[(N)]
```

— underscore-joined role parts first, then any positional **selector** specs, then the
presentation **cell** address, then the sub-block **pseudo-element**, in exactly that order
(`[#1_Bd.first:letter(3)]`, `[Pz.{fields=2}.first/2]`, `[Card/a/icon]`). The Build Style
dialog is the authority on the spelling: it parses and re-emits this form losslessly,
so a key it writes is a key the
cascade can reach. One consequence worth knowing: a **numeric** selector spec may itself
contain a `/` (`.2/5` = start at 2, step 5), so a cell address is only recognized after a
brace shape or a *word* selector — `[Pz.{fields=2}/a]` and `[Bd.first/1]` address cells,
`[#2.2/5]` does not.

Color is where authors most often notice it, because of reversed ink: `ink=` / `COL| fg=` flips only
text whose color reaches `def` (see the fill-spec options table). Put the color on `[#N]` and the
section's body is genuinely that color, not `def`'s, so it correctly stops flipping — and restating
a color on `[#N_Bd]` or `[Bd]` to undo the tint makes that body explicitly colored, which stops the
flip for good. Put it on `[Ti]` / `[#N_Ti]` and heading color and reversed ink work together.

#### In-quote element keys

Lines inside a `> ` blockquote frame look up their text style under a per-element key that combines the role suffix with the frame's `_Qt[_name]` suffix. Each of these cascades through both the in-quote variant and the cross-document analog before falling back to `def`:

| Element | Style key | Cascade order |
|---------|-----------|---------------|
| Body text in a quote | `#<lvl>_Bd_Qt[_name]` | `_Bd_Qt[_name]` → `_Bd_Qt` → `Bd_Qt` → `Bd` → `def` |
| Heading in a quote (level N) | `#N_Ti_Qt[_name]` | `_Ti_Qt[_name]` → `_Ti_Qt` → `#N_Ti` → `Ti` → `def` |
| Bullet in a quote (level L, type T) | `#<lvl>_BtL<L>T<T>_Qt[_name]` | `_BtL<L>T<T>_Qt[_name]` → `_BtL<L>T<T>_Qt` → `_BtL<L>T<T>` → `def` |
| A quoted item's continuation line | `#<lvl>_BtL<L>T8_Qt[_name]` | as the bullet row, with `T8` |
| Frame chrome (border, background, padding, left-bar) | `#<lvl>_Qt[_name]` (block-style fields) | `_Qt[_name]` → `Qt` → `def` |
| Frame title / caption | `#<lvl>_Qt[_name]_Cp` | `_Qt[_name]_Cp` → `_Qt_Cp` → `Cp` → `def` |

For non-quote figures (image, diagram, circuit, chart, python, SVG), the caption uses `<frameStyle>_Cp` (e.g. `#1_Im_Cp`, `#1_Di_Cp`). All seven figure-types share the generic `Cp` text style as their cascade fallback, which is seeded from an older file's `%+FIG_FONT:` / `%+FIG_FONT_SIZE:` headers if present.

#### Positional / structural selectors

A style name may carry a trailing **`.`-selector** that targets blocks by their
*position* in the sequence rather than only by role — e.g. the first two level-2
headings, every 2nd body paragraph, the first paragraph of each section. The
selector rides the cascade as an outermost suffix, so it overrides only the
fields it sets and inherits the rest from the base role. (`.` is illegal in an
ordinary style name, so it unambiguously marks a selector.)

Name form: **`<roleKey>.<spec>[@<scope>]`**

- `<roleKey>` is any ordinary cascade key: `#2` (the level-2 heading title),
  `#2_Ti` (same), `Bd` (body, any level), `#3_Bd` (level-3 body only), a bullet
  key like `BtL1T1`, etc. A bare `#N` matches the heading **title** only (not
  level-N body/bullets). Write the role the same way you name any style — no
  leading underscore (`[Bd./2]`, not `[_Bd./2]`); the `_`-prefixed form is
  accepted as a convenience.
- `<spec>` selects which 1-based instance(s) `k` of that role get the style:

| Spec | Selects | CSS analog |
|------|---------|------------|
| `.3` | the 3rd | `:nth-of-type(3)` |
| `.1-2` | range 1–2 (first two) | — |
| `.3-` | 3rd onward | — |
| `./T` | **every** T-th → T,2T,3T | `:nth-of-type(Tn)` |
| `.S/T` | start S, step T → S,S+T,… | `:nth-of-type(Tn+S)` |
| `.even` / `.odd` | even / odd | `:nth-of-type(even/odd)` |
| `.first` | the first | `:first-of-type` |
| `.last` | the last | `:last-of-type` |
| `.last-K` | the Kth from the end (`last-1` = penultimate) | `:nth-last-of-type` |
| `.only` | the sole instance in its scope | `:only-of-type` |

  Note: a bare `.N` is **the Nth** (absolute); "every Nth" always uses the `/`
  form (`./2`). Ordinals are counted among blocks of the same role only.
- `@<scope>` (optional) overrides the reset boundary: `@doc` counts across the
  whole document; `@sec` resets at each heading; `@parent` resets at each parent
  section. Default: heading selectors reset per **parent** section, body/bullet
  selectors reset per **section**.

```
[#2.1-2]   ...   #ffff0000      first two L2 headings under each L1 → red
[#2.2/5]   ...   #ff00aa00      2nd, 7th, 12th, … L2 heading → green
[Bd./2]    ...   #ff0000ff      every 2nd body paragraph → blue
[#3_Bd.first] ...               first body paragraph of each L3 section
```

Precedence & layering: a matching selector **beats an explicit inline `[Style]` attach** on every
field the selector sets; the attach fills the rest. A positional selector names one block by
position, which is a more specific statement than a role attach, so `[Bd.7@doc]` carrying a font
restyles the 7th body paragraph even where that paragraph was written `[Note] …`. The attach still
decides the block's ROLE — and therefore which selectors can match it at all — so the two compose
rather than compete: pick the role with the attach, adjust the instance with the selector. (Note
that a selector's ordinal counts blocks, and `PREZ|` presentation records are not counted, so
attaching a presentation style to a line shifts every later ordinal in that scope.)
When several selectors match one block they **layer per-field** (multi-layer):
each contributes the fields it sets, with the most specific winning per field
(single-index > bounded range > step > every; then the level-qualified role; then
the later-defined style) and the base role filling the rest. A selector's fields reach
**only the blocks that selector matched**: with both `[Bd.2]` and `[Note.2]` defined, a
`[Note]` paragraph that is the second body block takes `[Bd.2]` and not `[Note.2]`, and a
body selector never picks up a heading selector such as `[#1.2]`. Within its layer a
selector still reaches a more specific key that names its role (`[#1_Bd.2]`,
`[Bd_Note.2]`, a matched figure's caption `[#1_Im_Cp.odd]`). Selectors apply to
headings, body paragraphs and bullets, in **PDF, live preview, and HTML export**;
**figures (all six families), tables, quotes and presentation groups** are also
selectable (see "Figure / table / quote selectors" below and "Presentation rules";
footnotes cannot be selected).

A matched block takes its **break behavior** from the selector too, not only its
appearance: the **New page** field and the Effect break bits — Keep With Next,
Column Break, Hard Break, no-line-break and the outline-reset bits — are re-resolved
from the effective name before pagination is decided, so `[#2_Bd.2-3]` carrying Keep
With Next glues its label to the block below exactly as the equivalent attach would.
The one exception is **exclude-from-TOC** (Effect bit 64), which stays on the attached
role: the TOC is built before positions are known, so honoring a selector there would
list an entry the render then suppresses.

##### Figure / table / quote selectors

The same `.spec[@scope]` grammar addresses the structural domains:

```
[&Im.odd]    Align=left  Wrap=image     alternating float sides down a spread
[&Im.even]   Align=right Wrap=image     (works for all six families: Im Sv Di Ci Ct Py)
[&Im.first@sec]  ...                    hero treatment for each section's first image
[|Tb.1@sec]  ...                        the first table of each section
[|Tb.odd]    ...                        zebra-alternating table looks
[>Qt.odd]    ...                        alternating callout chrome
[#2_Qt.first@sec]  ...                  the first quote in each level-2 section
```

Rules may live in any style plane — `[&Im.odd]` figure geometry, `[>Qt.odd]` block
chrome, `[|Tb.odd]` table look, `[#1_Im.first]` text — and resolve per-field through
the usual two-phase cascade (the caption of a matched figure resolves
`#1_Im_Cp.odd → #1_Im_Cp → …`; the text inside a matched quote
`#1_Bd_Qt_warning.odd → …`). Ordinals count among blocks of the same role, reset
**per section** by default (`@doc`/`@parent` override). Because figure float
geometry is resolved while parsing, these domains count **forward only** — `.last`,
`.last-K` and `.only` are not available here (they never match). Code fences share
the quote (`_Qt`) role, so they count in the quote domain.

#### Sub-block pseudo-elements (drop cap, first word, first line)

A style name may also carry a **pseudo-element** (single colon) that styles a
*part* of the matched block. It rides after the positional selector, CSS-style.

Name form: **`<role>[.<spec>][@<scope>]:<part>[(N)]`**

| Pseudo | `(N)` | Bare |
|--------|-------|------|
| `:letter(N)` | sink depth: `N≥2` = sunk **drop cap** over N lines (auto-sized) | `:letter` = inline **raised** initial (sized by the style's font-size) |
| `:word(N)` | first N words | `:word` = first 1 word |
| `:line(N)` | first N typeset lines | `:line` = first 1 line |

```
[Bd:letter]              inline raised initial on every body paragraph
[#1_Bd.first:letter(3)]  3-line drop cap on each chapter's opening paragraph
[Bd:word]                run-in first word (e.g. small-caps) on all body
[#2_Bd.first:line]       styled first line of each L2 section's lead paragraph
```

The pseudo style's normal fields (font/size/color/weight/small-caps) define the
part's look; unset fields inherit the paragraph's own (selector-aware) style. For a
drop cap, an explicit **font-size** overrides the auto-fit (which otherwise sizes the
cap to span exactly N lines), and the **`before` field** acts as an optional vertical
**raise** — a positive value (pt) lifts the cap above its default flush position
(cap-top aligned to the first line's text top). A
bare-role part (`[Bd:word]`) applies to every block of that role; add a `.spec`
to gate it (`[Bd.first:word]`).

**Layering.** On one block, `:line` ⊃ `:word` ⊃ `:letter` layer in that order, and
they **cascade**: each part paints over the one enclosing it, so a field the inner
part leaves unset inherits the *enclosing part* first and the paragraph only after
that. A `:word` under an all-caps tracked `:line` is therefore still all-caps and
tracked unless it names those fields itself — the inner rule overrides, it does not
reset. Note that Caps and Letter spacing have no "off" value (empty = inherit, and
`0` tracking = inherit), so an inner part cannot switch either one back off; put the
device on the inner part and leave the outer plain when you need that, or use one
pseudo per block. `:line` stops exactly at the real break even when it — or a part
layered inside it — changes the font metrics.

Applies to **PDF, preview, and HTML** (native `::first-letter` /
`::first-line` / `float`).

**Table Styles:** `[|name]`

```
[|def]	Left	#EEEEEE	#FFFFFF	0.75	0.75	3.75	3.75	0.75	0.75	0.75	0.75	0.75	#AAAAAA	#AAAAAA	#AAAAAA	#AAAAAA	#AAAAAA	0		4
```

Field order (all pads / rule widths / width in **points**, like every other style
unit):
0. Alignment — `Left`, `Right`, `Center`, `Justify`, `Auto` (case-insensitive, so
   lowercase words read too; so do the numeric codes 1-5 of older files). `Auto`
   right-aligns numeric cells and left-aligns text cells.
1. Alt color 1 (#RRGGBB)
2. Alt color 2 (#RRGGBB)
3. Top padding (pt)
4. Bottom padding (pt)
5. Left padding (pt)
6. Right padding (pt)
7. Side border width (pt)
8. Top/bottom border width (pt)
9. Vertical separator width (pt)
10. Horizontal separator width (pt)
11. Header separator width (pt)
12. Side border color
13. Top/bottom border color
14. Vertical separator color
15. Horizontal separator color
16. Header separator color
17. Table width (pt; 0=auto)
18. Header background — fill color (or `$token`) for the first row, beyond just a border (empty = none)
19. Options — a **bitfield**, numeric on disk like the text styles' Effect field. Add the bits
    you want:
    - `1` **Repeat Header** — when a table splits across pages, every continuation piece
      repeats row 0 above its own rows. PDF draws the header band a second time; HTML emits
      a real `<thead>` and FODT a `<table:table-header-rows>`, so the browser's print engine
      and Writer repeat it natively.
    - `2` **Keep Together** — the table never splits at a row boundary; it moves whole to the
      next page or column. The text style's Effect bit 1024 ("No Line Break") does the same
      thing from the text plane and still works — either one suffices, they OR. A table
      *taller than a fresh page column* has nowhere whole to go, so it splits anyway and
      warns on stderr naming the style (refusing to split would clip the remainder).
    - `4` **Alternate rows** — zebra-stripe with the two Alt colors above. It is **on** in
      the built-in default, which is why the default Opts is `4` and not `0`.
    - `8` **Header bold** — bold the first row's text.

    Sum the bits: `12` = alternating rows with a bold header; `5` = alternating rows that
    repeat the header on every page.

    ```
    [|Tb]	Left	…	#AAAAAA	0		5     ← zebra + repeat the header on every page
    [|Tb]	Left	…	#AAAAAA	0		14    ← zebra + bold header + keep the table whole
    ```

    Being one field, Opts is **inherited whole**, exactly like the text styles' Effect: a
    style that sets any bit asserts all four, so a child cannot take Alternate from its
    parent while overriding Header Bold — spell out the full value on the child.

A table caption is just a styled paragraph above or below the table (give it a `_Cp`-family
or custom style); enabling List of Tables also numbers it "Table N: …".

**Block/Blockquote Styles:** `[>name]`

```
[>def]	12	12	12	12	#EEEEEE	#111111	2	6	16	#808080	#ffd74bdc	6	1
```

Field order:
0. Left padding
1. Right padding
2. Top padding
3. Bottom padding
4. Background — a **fill spec** (color `#AARRGGBB` / gradient / `img:` / `svg:` / `$token`; see Fill specs)
5. Border line color
6. Border line width
7. Corner rounding (pt; clamps **uniformly** at half the box's shorter side, so any large value —
   e.g. `999` — is a content-height-proof **pill/stadium**, matching CSS `border-radius`)
8. Left accent bar width
9. Left bar color
10. Line number color
11. Space after bar
12. Block style effects — bitfield: 1=line numbers, 2=keep format, 4=in index, 8=newline,
    **16=border top, 32=border right, 64=border bottom, 128=border left**, 256=this block only,
    **512=data meter** (presentation columns — see "Data meters"), 1024=full page/section height,
    **2048=oval box, 4096=1:1 square** (see "Shapes" under Presentation styles; oval+1:1 = circle)
13. Bar length % — shortens+centers the accent bar / divider (100 = full)
14. Box width — narrow a section box / single content block / blockquote below its column and **re-wrap
    its text** at that width: `60%` (of the column) or `200pt` (blank/`0`/`100%` = full). *Presentation*
    records narrow via the group/`splits=` `width=` instead (see Presentation styles).
15. Horizontal align — `Left` (default), `Center`, `Right` (case-insensitive; the numeric
    codes 0/1/2 of older files are still read). Positions a **narrowed** box within its
    column width; bites only when the box is narrower than the column (Box width above, or a presentation
    `width=`). On a presentation single-tile card (`next=down`), `.a` left + `.b` right + `rowoverflow=cycle`
    gives the **Zigzag** layout.
16. Vertical align — `Top` (default), `Middle`, `Bottom`, `Justify` (case-insensitive; the numeric
    codes 0/1/2/3 of older files are still read). A **general section box** that doesn't fill
    its (single-column) page sinks to the middle / bottom of the leftover space — only the *terminal* box on
    a page moves (the box keeps its height, it doesn't stretch). On a **presentation record** it
    positions the content within the (uniform) row height (box still fills the row; composes with field
    `valign`): `Top`/`Middle`/`Bottom` move the whole stacked record as a unit, while **`Justify`** spreads
    the spare height *between* the stacked fields — the first field stays pinned to the top and the last
    field drops to the bottom edge (a label-top / value-bottom KPI card; equal-height cards then share one
    value baseline). `Justify` only bites on a **stacked** presentation record inside a uniform-height row
    (`next=right` grid) with ≥2 fields; elsewhere it reads as `Top`. Composes with Box width + H-Align (e.g.
    a narrow card parked bottom-right). Edited in the Block Styles **Box Width / H-Align / V-Align** columns
    in Settings.
17. Shape — **shaped edges** (one token; empty = rectangle): `skew:<angle>` slants both vertical
    edges by `<angle>`° (positive leans right, italic-like; the parallelogram is inscribed in the
    box, width preserved); `slant:<edge>:<angle>` slants one edge (`top`/`bottom`/`left`/`right`;
    positive pulls the far corner inward — the right end of a horizontal edge, the bottom corner of
    a vertical edge; negative mirrors); presets `chevron[:<depth>]` (ribbon — right edge points OUT
    to a mid-height apex, left edge notched IN; depth in points, default half the box height),
    `arrow[:<depth>]` (pennant — right point only), `corner-cut[:<depth>]` (top-right corner cut at
    45°, default min(w,h)/4). `=` is tolerated wherever `:` separates (`slant=right:12`). Fill,
    accent bar, and border all follow the shaped path. A shape **wins over** Round Size / the oval
    bit, and the per-side border bits are ignored while a shape is active (the border strokes the
    full path). Applies everywhere block chrome paints: single-block boxes, section boxes,
    presentation tiles/rows/cells, and region frames (`style=` chrome). Content is **not**
    auto-inset for angle shapes (pad the style like an oval/large radius); explicit-depth presets
    inset (chevron/arrow), and **region frames** get exact worst-point insets (fixed geometry).
    Blockquote (`>name>`) boxes ignore the field (they keep their own painter — degrades to a
    rectangle, same rule as per-corner radius). HTML export approximates via `clip-path:polygon()`
    (exact for explicit-depth presets; em-based approximations for angle forms — the PDF is the
    exact rendering). Curves/blobs stay `svg:` fills by design. Tokens read **case-insensitively**
    (`chevron` and `Chevron` are the same value). `0` = an explicit rectangle that **cancels a shape
    inherited** from a parent style (blank = inherit, the usual cascade rule). Edited in the Block
    Styles **Shape** column in Settings — a builder dialog (kind, then angle / edge / depth) with a
    live preview of the real path; it writes the Title-Case spellings (`Skew:8`, `Slant:Top:4`,
    `Corner-Cut:18`).
18. Bleed — **chrome overhang** (comma-separated edge tokens; empty = none): each of `left` /
    `right` / `top` / `bottom` / `all` extends the painted CHROME (fill, accent bar, border — the
    whole box) outward past the block's own box, optionally targeted: `:frame` (default) — to the
    container frame: the region frame for region-routed content, else the page's content band (the
    margins minus header/footer space); `:trim` — to the page trim edge; `:<N>` — N points PAST the
    container frame edge (the overhanging-ribbon motif, e.g. `left,right:18` spans a rail frame and
    overhangs its right edge), clamped at the trim. `=` tolerated for `:` (`right=trim`).
    **Paint-only**: content, layout, wrapping, and insets are untouched — the ink extends, the flow
    doesn't (the presentation group `bleed=1` look, per-edge and style-driven; extension is
    outward-only, an edge never moves inward). Applies to presentation tiles/rows/cells (body or
    region-routed) and to section boxes / single-block boxes (cascading read there, like the box's
    other fields). NOT applied to: region frame chrome itself (`style=` chrome — the region-line
    `bleed=` governs frame vs trim), blockquote (`>name>`) boxes, and figure chrome. Inside a
    rotated region the page trim has no axis-aligned meaning, so `:trim` degrades to `:frame`;
    inside an `overflow=clip` region the routed content's clip wins (bleed clips with it). HTML
    export draws a bleed only inside a region frame, where there is a frame to reach; elsewhere
    the presentation group `bleed=1` spec key is the HTML-capable full-width band. Tokens read
    **case-insensitively** (`left:trim` and `Left:Trim` are the same value); `0` = no bleed, which
    **cancels a bleed inherited** from a parent style (blank = inherit). Edited in the Block Styles
    **Bleed** column in Settings — a builder dialog with one row per edge (off / to the frame / to
    the trim / N pt past the frame) over a page-trim ⊃ frame ⊃ box schematic; all four edges alike
    collapse to the `All` shorthand on save.
19. Bar Style — **timeline connector** (one token; empty = plain accent bar):
    `<kind>[:<sizePts>]` (`=` tolerated for `:`), where `<kind>` is `timeline`, `rungs` or
    `chevron`. A **leftBar variant** — the bar's width and color still come from Left Bar /
    Bar (fields 8/9); this field REPLACES the accent bar with a **rail that runs mark-to-mark**:
    a **node glyph** sits at the vertical **center of each entry's first text line**, and the
    rail line (bar width/color) connects consecutive nodes — nothing paints above the first or
    below the last mark, and a single-entry rail is a lone mark with no line. The kind picks
    the glyph, and `<sizePts>` measures whichever dimension that glyph is sized by (omit it,
    or use 0, for the bar-width-derived default):
    - `timeline` — a solid **dot** centerd on the bar. Size = diameter; default
      `max(3 × bar width, 5pt)`. Reads as a chronology.
    - `rungs` — a horizontal **ladder tick** running right off the rail, bar-width thick,
      anchored at the bar's outer edge. Size = rung length; default
      `max(6 × bar width, 10pt)`. Reads as entries hung off a spine. Give the box style
      enough Left Pad to clear the rung, or it runs under the text.
    - `chevron` — a downward **arrowhead** centerd on the bar (height ≈ 0.9 × width). Size =
      arrowhead width; default `max(3.5 × bar width, 7pt)`. Reads as a directed process.

    Bar Len % does not apply to a rail. What counts as an entry follows the
    style that carries the token:
    - on a **single-block box** style (`[>Name]` bar on plain `[Name]` paragraphs — see
      "Single-block box" below): each boxed paragraph is an entry; runs of block-adjacent same-style paragraphs
      chain (any other block between them breaks the rail). Heading section boxes chain the
      same way (block-adjacent same-style boxes).
    - on a **presentation group** style: each group (a bare-`[Name]` record group or a
      `[Name] text` inline-record line) is one entry; consecutive same-style groups in the
      same container chain — body runs and **region-routed** runs both work (adjacent
      placements, same style, same page/region/column; any other content between breaks it).
      A record-split continuation (overflow=continue) keeps the rail but adds no new node.
    - on a **presentation row** style (`[>Name/a]`, with `rowoverflow=repeat` for uniform
      rows): every record is an entry — one group renders as a full timeline, and adjacent
      same-style groups still chain into it.
    - on a **column** style (`[>Name/2]`…) of an `arrange=row` group with `bars=divider`: the
      divider drawn before that column IS the rail — the node sits at each record's first
      line, bridged record to record, so the rail runs **between fields** (dates on its far
      side, the classic left-dated timeline). The group's own bar stays a divider/accent.
    `bars=divider` suppresses a group/row bar's rail (the column form above is the one rail a
    divider group can carry). Rails never bridge across pages or columns. Not applied to: blockquote (`>name>`) boxes and figure chrome (as
    with Shape and Bleed), region frame chrome (`style=` chrome — a frame's own bar never rails),
    margin (`place=margin`) notes. The bridge and node are never clipped to the entry's box
    shape; inside an `overflow=clip` region the routed content's clip wins (the rail clips
    with it — the same rule as bleed). HTML export emits the
    `border-left` rail per entry plus the node glyph as a background layer at the first line's
    center (radial-gradient for `timeline`, linear-gradient for `rungs`, an inline base64 SVG
    for `chevron`); the inter-entry gaps are NOT bridged and the rail is not trimmed to the
    glyph span in HTML (best-effort — the PDF is the exact rendering). FODT does the same for a
    single-block box rail — the bar per entry, the node as a shape on the entry's first line,
    the gaps unbridged — and draws no rail at all for entries routed into a region frame.
    Edited in the Block Styles **Bar Style** column in Settings — a builder dialog with the
    kind pick-list, a size spinner (blank/`Auto` = the derived default, and the label names the
    dimension that kind is sized by) and a live three-entry rail preview. Blank writes an empty
    cell (inherit); **None** writes the `0` sentinel, which cancels a rail inherited from a
    parent style and falls back to the plain accent bar.

The border bits (16/32/64/128) draw individual edges instead of the full box: set none and
the border (field 6) is the usual four-sided rounded box; set one or more and only those
edges are drawn (square corners). A bottom-only border is the "rule below" list-separator
idiom; top+bottom caps a category. Edited in the Block Styles **Opts** column in Settings.

**Nestable outline-section box (put a box on a heading).** Define a block style whose name
matches a heading style — `[>#1_Ti]`, `[>#2_Ti]`, or `[>Ti]` for all levels — and the engine
paints that box (fill + border + bar + padding + rounded corners) across the heading's whole
**outline subtree** (the heading and everything beneath it, to the next heading of level ≤
its own). Boxes **nest and layer**: a box on `#1_Ti` fills its section; a box on `#2_Ti`
inside it paints on top within the sub-range — exactly like nested colored panels. The fill
is a full fill spec, so a section can be a gradient or `$token` color. Extra Opts bits:
**256 = this block only** (box just the heading line — combine with a bottom border for a
**heading accent rule**), **1024 = full page/section height**. (A heading box only activates
when you explicitly define it; the default `def` box never boxes sections.)

**A box follows its style's left/right margin.** Text-style fields 3 and 4 (Indent/left margin
and right margin) move the **box**, not just the text inside it — the CSS model the rest of the
style system follows: *margin* moves the box, *padding* insets the content. So an inset band is
just `lmar 40 / rmar 40` on the heading style; the box's own padding still sits inside it, and a
bar-only box's rule moves with the text it marks. This applies to heading section boxes and to
single-block boxes alike, in the body and inside a region frame.

A box with a visible fill or border therefore occupies the **measure**, and its left/right padding
narrows the text rather than pushing the box out past the margin — the same way its top/bottom
padding is reserved inside the block's own height. Where the box also carries an accent bar, the
bar rides the box's left edge and the text clears **leftBar + left pad** (the HTML export's
`border-left` + `padding-left`). Two exceptions: a box spanning a heading's whole **subtree**
narrows nothing inside it, so that band still hugs its text and grows outward by the padding; and
under `bleed=` the padding is still measured from the measure while the chrome runs on to the
trim, so the visible gap on a bled edge is larger than the pad.

**Bar-only boxes (accent bar, no visible fill, no border).** The bar becomes the block's
**left edge**: it draws at the text's original left margin and the text is indented past it
by leftBar + space-after-bar (fields 8 + 11) — the pull-quote idiom. This applies to a box
on a single content block and to a **256 this-block-only heading accent rule** (matching the
HTML export's `border-left`). A bar-only box on a full **subtree** section (no 256 bit)
instead hugs the bar just outside the section's text, in the margin, offset by the
space-after-bar gap. A transparent `#00000000` fill counts as "no fill"; any visible
fill/border keeps the bar on the box's own left edge as authored.

**Single-block box (put a box on any one block).** The same mechanism
also boxes a single ordinary content block. Define a text style and a matching `[>name]` block
style with a visible box (fill / border / accent bar), then apply the text style to a paragraph
with `[name] paragraph text`:

```
[card]		Ser	12	0	16	16	8	8	130	1	1	0	0	#1B2430	0	0	0		0
[>card]	14	14	10	10	#EEF3FC	#2D6CDF	1	8	5	#2D6CDF	#000000	8	0
...
[card] This whole paragraph renders inside its own panel.
```

A non-heading block is inherently *this-block-only* (it never spans a subtree), and the box is
**inset to the block's content**: the box padding sits inside, while the block's own
space-before / space-after (text-style fields 5/6) form the gap *outside* the box, so it is
separated from its neighbors by the normal inter-block spacing and never overlaps them.
Per-side borders apply here too — a bottom-only border (Opts bit 64) on a single block is the
"rule below" / list-separator idiom. Structural blocks that already paint their own box —
quotes (`>name>`), images, SVGs, tables, footnotes, captions, diagrams, circuits, python,
charts, math — are never single-boxed. Like the heading box, it only activates when you
explicitly define the `[>name]` block style.

---

## Content Syntax

### Headings

Headings use `#` prefixes (1-6 levels):

```
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 Heading
```

**A `#` heading needs a space or tab after the hashes.** `#define MAX`, `#+FORMAT: cid/1` and
`#1 - Title Level` are ordinary text, and so is a line of bare hashes (`###`). The editor reads them
that way, and section numbering agrees: a line that is not shown as a heading never takes
a section number. (The `=` family below is the exception — there the space is optional.)

Headings are not recognized inside a code fence either — see the Code Blocks section. A fence holds
code, so `#include <vector>` and a shell script's `# comment` keep their hashes and take no section
number.

**A closer** (an anti-title) ends a section without starting a new one. It is a line of only `=`
signs, and the number of signs is the level the text after it returns to:

```
# Level 1
## Level 2
Text under Level 2.
=
Text under Level 1 again.
```

- A line of n `=` ends every section deeper than level n. The text after it continues the level-n
  section: moving a section, folding and merging concurrent edits all treat it so.
- The closer renders nothing, takes no section number, and has no title text. A line starting with
  `=` that holds anything else is ordinary text.
- The body after a closer uses the `_Af` (After Title) style suffix, so it can be styled apart from
  the body before the subsection. The suffix rides on the **body** role: the leveled key is
  `[#1_Bd_Af]` after a level-1 closer. `[Af]` alone covers every level.
- A closer may carry a style for the body after it: `== [A]` returns to level-2 body styled
  `[#2_Bd_A_Af]`.
- In the editor a closer is dimmed and indented like the body it returns to.

A custom style can be applied to a heading with bracket syntax:

```
# [CustomStyle] Heading Text
## [MyStyle] Another Heading
```

### Body Text

Plain text on lines under a heading becomes body text. Every line is its own paragraph; a blank
line between paragraphs is dropped and adds no space (`SPACE|N` is the deliberate gap). Blank
lines still separate where a section says so — a presentation group, two adjacent tables.
A custom style can be applied:

```
[CustomStyle] This paragraph uses a custom style.
Regular paragraph text with default body style.
```

### Inline Formatting

| Syntax | Effect |
|--------|--------|
| `**text**` | **Bold** |
| `*text*` | *Italic* |
| `***text***` | ***Bold + Italic*** |
| `__text__` | Underline |
| `~~text~~` | ~~Strikethrough~~ (Format > Strikethrough toggles it) |
| `^x` or `^{text}` | Superscript (e.g., `E=mc^2` or `x^{n+1}`) |
| `_x` or `_{text}` | Subscript (e.g., `H_2O` or `a_{n-1}`) |
| `{SC:text}` | Small caps |
| `@@` | Bullet symbol (U+2022 •) — only mid-line; leading `@@` is indentation, see below |
| `--` | Em dash (U+2014 —) |

**Boundary Rules:** Bold, italic, underline and strikethrough markers require non-word characters (not alphanumeric) immediately outside the markers. The content must not start or end with whitespace. A `~` beside a strikethrough marker breaks it, so a `~~~` script terminator is never one.

**Literal `<`:** a `<` renders literally unless it opens a supported **inline** tag. It must be followed by a letter, `/` or `!`, a `>` must close it later on the same line, and the tag name must be one of:

`a b i u s em strong del ins sub sup span font br img code tt big small nobr cite var samp kbd`

Everything else is prose and renders as typed — `<100`, `a < b`, `<<`, and block-level tags such as `<pre>`, `<div>`, `<p>`, `<table>`, `<h1>`, `<ul>`. A block tag inside a paragraph has no meaning the renderers agree on, so it is not treated as markup in any of them.

The HTML export is a web page, so it drops what would run in its reader: event-handler attributes (`onclick=`, `onerror=`, any `on…=`) and `javascript:`, `vbscript:` or `data:` URLs in `href`/`src` (a `data:image/` picture stays), however they are spelled with entities or spaces.

**Literal `$%%$`:** the internal line-separator sequence may appear literally in blockquote/code/diagram/python content; it is escaped at parse time and renders as typed.

### Fractions

Standalone number/number patterns are auto-converted to fractions:

```
1/2 becomes a formatted fraction (superscript numerator, fraction slash, subscript denominator)
3/4 also converts
```

Only matches standalone numeric fractions, not in URLs or alphanumeric contexts.

### Links

**Markdown-style links:**

```
[Display Text](file.ord)             Link to another .ord document
[Display Text](file.ord#Section)     Link to a section in another document
[Display Text](#SectionTitle)        Link to a section in the current document
[](#2.1)                              Link to section number 2.1 (auto-generates display text)
```

A plain path is resolved wherever the document holding it is: against the current directory
for a file on disk, against the document's folder on the server when it came from one. The link
is marked broken when nothing is at that path, whatever kind of file it names. Web links
(`https://…`) and `mailto:` links are never marked.

**Bare URLs:**

```
See https://example.org/guide for details.     The address alone is a link
```

An `http://`, `https://` or `ftp://` address written as plain text is a link, with itself as the
text: the editor colors it like a bracket link and a click follows it, and the PDF, HTML and FODT
exports make it a hyperlink. Punctuation that ends the sentence stays out of it — in
`https://example.org/guide, then…` the comma is not part of the link; a URL never ends in `.`,
`,`, `:` or `)`. In the editor, a URL inside a `[text](target)` link or an `![alt](target)` embed
belongs to that link, and one inside a code fence or a python embed's content is code. In the
exports, a URL inside an HTML tag or an `<a>` element written in the text (`<a
href="https://example.org">the site</a>`) belongs to that element; one in angle brackets
(`<https://example.org>`) is still a bare URL. The editor opens only web and mail links, so
clicking an `ftp://` address is refused (the exports still link it).

**Links to a server (`ord://`):**

```
[Display Text](ord://host/Plans/q3.ord)          Document on `host`, default port
[Display Text](ord://host:9000/Plans/q3.ord)     …on an explicit port
[Display Text](ord://host/q3.ord#Budget)         …at a section of it
[Display Text](ord://10.0.0.7/q3.ord)            IPv4 address
[Display Text](ord://[2001:db8::1]/q3.ord)       IPv6, bracketed
[Display Text](ord://10.0.0.7:1234/localshare)   A local share — the invite link
[Display Text](ord://host:9000)                  The server itself; opens the file navigator
```

An `ord://` link carries the server with it, so it works from anywhere — including from a
document open offline. Following one connects to the named server first, asking for a password
(and for a username, if the server is not in your list yet, offering to save it afterwards).
Following a link to the server you are already on just opens the document.

- The port may be left out; it then means **8642**, the default this program's server listens on.
- The path is server-absolute — it starts at the server's root, never at the current folder.
- `..` is refused, and `%XX` escapes are decoded (so `(` and `)`, which would otherwise end the
  link target early, can appear in a document name as `%28` and `%29`).
- A `?` starts a query, as in any URL, so a document name containing one writes it `%3F`. The only
  query keys read are the pairing ones a phone scans when it pairs with a server
  (`?pair=…&fp=…&alt=…`); others are ignored, so they do nothing in a document's link.
- **`/localshare`** is a local share, not a document: following it joins the share the way
  Browse Local Shares does, and the share asks for its own password if it has one. That exact
  name is reserved at the top level of every server, so no document, file or folder can be
  there to be confused with it. Only at the top level and only spelled exactly — `/sub/localshare`
  and `/localshare.ord` are ordinary documents.
- **A link with no document** — `ord://host` or `ord://host/` — connects and opens the file
  navigator to pick one.
- **Collaboration → Copy Document Link** puts the whole `[name](ord://…)` for the open server
  document — or for the share being hosted or joined — on the clipboard, ready to paste into
  another document. **Collaboration → Open Link…** is the other direction: somewhere to paste
  one that arrived by mail or chat. The same URLs work in place of a filename on the command
  line (`ordstyle ord://host/q3.ord`).
- A broken-link mark on one of these means either that the URL does not parse, or that you are
  connected to the server it names and the document is not there. A link to some other server
  is left unmarked — being elsewhere says nothing about what is on it. A share or bare-server
  link is never marked: it names no document to be missing.
- Following a link while **hosting** a share is refused — connecting elsewhere would end the
  share for everyone on it. Stop sharing first.

**Internal links by name (an older form, still read):**

```
[[*Section Title]]                    Link to internal section by name
```

**URLs:** Raw URLs starting with `http://`, `https://`, or `ftp://` are automatically linked in PDF output.

### Inline Tags

Conditional content that appears only when a tag is enabled:

```
{:tagname: This content only appears when tagname is enabled}
```

A whole line is tagged by a bare `:tag:` anywhere in it — what Insert Tag (Ctrl+:) writes at
the end of the line when nothing is selected; with a selection it wraps it as `{:tag: …}`. Several tags join with colons (`:draft:notes:`). The marker is removed from the
printed line. A line whose tag a style excludes is dropped, and a tagged **heading** drops its
whole section with it (`%+EXCLUDE_CHILD_TAGS:` drops the section under a heading but keeps the
heading itself).

```
The pilot runs through May. :draft:
# Open questions :draft:
```

Tag names use lowercase letters, digits, `@` and `_` only (`[a-z0-9@_:]+`). The bare form is
matched anywhere on a line, so any text of the shape `:x:` with lowercase/digit content becomes a
tag: `10:30: now` loses `:30:` and is tagged `30`. Uppercase never matches (`:STYLE:` and
`:END:` are not tags). Tags can be enabled/disabled via style settings and excluded with
`%+EXCLUDE_TAGS:`.

**Named character styles** — apply a full text style to an inline
span, so the body declares the *role* of a run and one style edit restyles every instance:

```
A {=term=design variable} is looked up with {=code=resolveColor()}.
```

`{=role= text}` styles `text` with the text style `role` (its font, size, color, weight,
caps and letter-spacing — `$token` colors resolve). Define `[term]`, `[code]`, etc. like
any text style. Works in both PDF and HTML.

Insert one from **Format → Character Style…**. The Style field is an **editable combo box**
listing the document's own text styles — each entry drawn in its own font, size, weight, caps
and color, so the list reads as a specimen sheet — and you can type a name that does not
exist yet and define it afterwards in Settings → Styles. The Text field is pre-filled from the
selection; leave it empty and the cursor parks inside the braces ready to type. Headings,
positional selectors (`Bd.first`) and presentation cells (`Spec/name`) are left out of the
list: an inline run cannot be one of those. The role charset is `[A-Za-z0-9_]+`, and the
marker is matched **per line**, so a run cannot span a paragraph break — the action refuses a
selection that does, because the opener and closer would land on different lines and both
would render as literal text.

### Audience Fences

A fenced region marks every line inside it as belonging to one conditional-content track,
without prefixing each line with `:tag:` by hand:

```
:::slide
- Evaporation
- Condensation
- Precipitation
:::

:::notes
Facilitator prose that only appears in the notes edition.
:::
```

- An opener is a line whose trimmed text is `:::` immediately followed by one tag name from the
  existing tag charset `[a-z0-9@_:]+` (e.g. `:::slide`, `:::notes`, `:::handout`). Multiple
  tags join with `:` — `:::slide:handout` puts every line in both tracks.
- A closer is a line whose trimmed text is exactly `:::`.
- Every line inside behaves **exactly** as if written `:name: <line>` — so a line in `:::slide`
  is dropped from any style whose `%+EXCLUDE_TAGS:` lists `slide`. Ordinary structure (bullets,
  paragraphs, even nested `#` sub-headings) parses and renders normally inside a fence.
- Fences **nest**: `:::slide` inside `:::handout` unions the tags; the closer pops the innermost.
- The `:::` marker lines render nothing (they are consumed like a directive). They are literal
  lines in the `.ord` file and round-trip untouched on save.
- A `:::` inside a code/blockquote/diagram block is literal block content, not a fence marker.

This is the idiom for authoring parallel editions (e.g. projection slides vs. facilitator
notes) in one file: author the `#` beat heading *outside* any fence so both editions share it as
the page anchor, fence the per-track content under it, and select the edition at render time via
the style's `%+EXCLUDE_TAGS:`.

### Tab Indentation

Leading `@@` at the start of a line adds indentation (half a tab distance per `@@`):

```
@@Indented text
@@@@Double indented text
```

Note: any `@@` remaining mid-line *after* the leading runs are stripped is replaced with the bullet character (•).

### Comments

Lines starting with `%` (but not `%+`) are comments and are ignored during rendering:

```
% This is a comment and won't appear in output
```

### Horizontal Rules

Three or more of these characters on a line create a horizontal rule:

```
---
***
___
```

Each rune maps to its own style, set per `:STYLE:` section, so the three sequences can
look completely different:

| `:STYLE:` line | Drives | Default |
|---|---|---|
| `%+HR_DASH:` | `---` | a thin rule |
| `%+HR_ASTERISK:` | `***` | a thin rule |
| `%+HR_UNDERSCORE:` | `___` | a thin rule |

Each value is either a **plain rule** `thickness,width%,color` (e.g. `1.5,60,#888888` — a
1.5 pt rule spanning 60% of the text width) **or an SVG ornament** `file.svg,height` (e.g.
`flourish.svg,24` — the SVG centered, scaled to 24 pt tall, capped at the text width). The
SVG resolves against the document directory, then `:/resources/`, then embedded data. Use
an ornament to get a typographic flourish or asterism instead of a plain line.

The color accepts a `$token` (`0.75,100,$rule`) like every other color field; an unresolvable
value falls back to the `def` style's ink.

Neither grammar has to be typed by hand: **Settings → Output** shows the three fields as the
rule they draw rather than as text, and each opens an HR Style builder (thickness / width /
color, or an ornament file and its height) with a live preview. A blank cell previews — and
prints — the default full-width rule at `Horizontal Line Thickness`.

### Images

Markdown-style image syntax with optional attributes. Relative paths
resolve against the **document's directory first**, then the current
working directory. A missing image file renders a dashed
placeholder box with the file name (plus a console warning) instead of
silently collapsing to zero size.

```
![Caption](image.png)
![](diagram.svg)
![Caption](photo.jpg){scale=0.5}
![Caption](image.png){scale=0.8 align=center}
![Caption](image.png){align=left width=30% wrap=image}
![Caption](image.png){scale=0.5 align=left width=auto wrap=image}
```

A caption may contain a `|` — only a **top-level** pipe separates record fields (see
"A line carrying top-level field separators is a record"), and a pipe inside the `[…]` is
never one. `\|` there is the same literal pipe, spelled defensively; both render as `|`.

#### Images written inside a paragraph

A marker that owns its whole line is a **figure** — everything below applies to it. A marker
written **inside** a line of text is an **anchored float**: the line carrying it finishes at the
full measure, and from the next line down the picture takes the margin while the rest of the
paragraph flows beside it. When the picture is cleared the measure opens back out.

```
…a little way into the sentence. ![](assets/plate.svg) From here the text flows beside it…
…and on the other side. ![](assets/plate.svg){align=right width=25%}
```

| Attribute | Meaning |
|-----------|---------|
| *(none)* | `width=33%` of the measure, on the left |
| `{align=right}` | hold the right margin instead |
| `{width=N%}` | a fraction of the measure — the usual way to size one |
| `{width=90pt}` · `{size=…}` · `{height=…}` | any length the vocabulary spells (**Length values**, above); the other axis follows the art |
| `{aschar}` | *not* a float — see below |

Anchoring to the **bottom** of the marker's line is what makes this predictable: every line at or
above the marker is full width whatever the picture does, so where you write the marker within a
sentence never changes where the words above it break. The float belongs to the page, not the
paragraph, so a paragraph that runs out before the picture does leaves the next one flowing
beside it — ordinary float behavior.

**`{aschar}` asks for the other thing:** a picture that IS a character in the run. Qt breaks lines
around it, it sits on the baseline, and it grows the height of the line it lands on; nothing wraps
around it, because nothing wraps around a letter. Its default size is `cap` — as tall as a capital
in this style's font — and `{size=line}`, `{size=1.5em}`, `{size=WxH}`, `{width=}` / `{height=}`
all apply. Use it for a mark inside a sentence: a warning glyph, a small logo, a dingbat.

A marker whose target will not load — a `.ord` embed, a `.py` script, a missing file — stays
visible as written, the same answer a broken figure gives.

Carried by all three outputs. PDF anchors a float zone under the marker's line and flows the
paragraph's remaining bands beside it; HTML says the same thing in one word (`float:left`, which
wraps the rest of the paragraph natively); FODT uses a `text:anchor-type="char"` `draw:frame` with
`style:wrap="parallel"`. An `{aschar}` picture is a document resource in the PDF, an `<img>` with
`vertical-align:baseline` in HTML, and an `as-char` frame in FODT.

#### Anchoring a figure beside a paragraph (`@float:`)

An inline marker floats a picture written *in* the sentence. **`@float:Name`** does the same for a
figure that keeps its own source: a chart, a diagram, a circuit, a python or math block, an image,
or a blockquote. Write the figure normally, give it a name, and put the anchor in the paragraph it
belongs to:

```
[Adoption] CHART|Adoption|0.62|1|left|33
Uptake tripled over the period. @float:Adoption From here the paragraph flows beside the chart…

>Pull> The measure of a layout engine is what it does when the author writes something reasonable.
The paragraph begins at the full measure. @float:Pull From the next line down the quote holds…
```

The name is the one the block already declares — a figure's **`[Name]`** prefix (which the reader
composes onto its role) or a blockquote's **`>Name>`** token. No new naming syntax.

The anchor obeys the same rule as an inline marker: the line carrying it finishes at the full
measure, and the figure takes the margin from the next line down. The figure contributes no space
where it is written — it is placed entirely by the paragraph that anchors it — and it takes its
side and width from its own attributes (`align=`, `width=`), defaulting to a third of the measure
on the left.

**The figure must be ADJACENT** — the block immediately before or after the anchoring paragraph,
blank lines aside. That is where a figure and the prose about it are written anyway, and it keeps
the two on the same page by construction. An anchor that names nothing adjacent prints nothing and
says so on stderr.

`@float:` is a paged-layout instruction, so HTML and FODT drop it: the anchor prints nothing and
the figure exports in flow, where it was written — the same as everything else in those exports
that depends on page geometry.

**In the editor** the marker stays where you wrote it, colored as the image reference it is, and
the picture is shown in a strip under the paragraph at the size it will print — an editor cannot
flow text around a float, so it shows one the way it shows any other figure. An `{aschar}` picture
is different: it is drawn *in* the line at the box its marker's characters reserve, and putting the
caret inside that marker turns it back into text to edit. Both follow the "Hide image embeds"
per-theme switch. A marker that opens its line is a figure and keeps its own preview card, and a
presentation record's image fields get no preview, because those are panels — an image opening any
field is still colored as an image reference. A marker whose target is missing is marked red
wherever it is written.

**Attributes (in curly braces) — the ONE image grammar.**
The same vocabulary sizes and places every figure family (`![…]` images/SVG/Python,
` ```diagram`, ` ```circuit`, `CHART|` via its positional fields) **and** presentation
image cells; the figure-style table (`[&name]`, below) supplies the same keys as
cascading defaults.

| Attribute | Values | Description |
|-----------|--------|-------------|
| `width` | `N%`, a length (`N`/`Npt`/`mm`/`cm`/`in`/`px`), `auto`, `0` | **The one width concept.** `N%` of the container (column, float zone, or slot); a length is absolute (bare `N` is points; an unreadable one warns and reads natural); `auto` the natural rendered width; `0` explicit natural (a cascade negation). When `wrap` is set, `width` doubles as the **float-zone width**. A non-floating `width=50%` sizes the image at half the column with no wrap. |
| `height` | a length (`N` points, or `pt`/`mm`/`cm`/`in`/`px`) | Single-axis fixed image height, aspect kept (letterbox). With **both** `width` and `height` set the pair is a fixed box — see `fit`. |
| `wrap` | `none` (default), `image`, `column`, N (pt) | **The float trigger AND the wrap-zone extent in one key** (needs `align=left`/`right`). `image` = zone matches the image height (text widens once it clears); `column` = zone runs to the column bottom (sidebar); `N` = explicit zone height in points. `wrap`'s value sizes the TEXT wrap zone, not the image — a `wrap=column` sidebar still has a short image. A `width` with no `wrap` just sizes/pins the image. No-ops inside a presentation slot (no text wraps a cell). |
| `scale` | Float (e.g., 0.5, 1.0) | Zoom from natural size. SVG default: 1.0; PNG/JPG default: 0.5. Ignored when the image fills a float zone. In a slot, zooms from natural when no `width` is given. |
| `align` | `left`, `right`, `center` | Horizontal placement within the column (or slot — overriding the cell's text-align). **Default is left.** `center` cannot float: `align=center` + `wrap` warns and ignores the wrap. |
| `margin` | Float, or `T,R,B,L` | Outside spacing in points (within-cell spacing in a slot). `margin=N` sets all four sides; `margin=T,R,B,L` uses CSS shorthand order (no spaces). Per-side overrides: `marginTop=`, `marginRight=`, `marginBottom=`, `marginLeft=`. For floats, the wrap-facing side defaults to 5pt when unset. |
| `border` | `N` or `N:color` | Draw a hairline border `N` pt wide around the image (default color `#888888`; accepts `$token`). |
| `radius` | N (points) | Round the image's corners by N pt (the image is clipped to the rounded box). |
| `shadow` | N (points) | A soft drop shadow offset N pt down-right. |
| `mask` | `<file.svg>` (optional `svg:` prefix) | **SVG alpha mask**: the SVG is stretched over the image and its alpha becomes the image's alpha — hard shapes clip (blob/organic crops), soft-alpha SVG feathers. Affects image pixels only: `border`/`shadow` still follow the rectangular frame. Missing mask ⇒ console warning + unmasked paint. HTML: CSS `mask-image` with the SVG inlined. |
| `gray` | (flag) | **Grayscale**: desaturate the image, alpha untouched. HTML: `filter:grayscale(1)`. |
| `duo` | color or `$token` | **Duotone**: grayscale, then colorize — the duo color's hue/saturation with each pixel's luminance (black stays black, white stays white, midtones take the color). Wins over `gray` when both are set. HTML approximates with a grayscale+sepia+hue-rotate filter chain (PDF is exact). |
| `fit` | `cover` or `contain` | The fit rule: with BOTH `width` and `height` set the default is **cover** (scale to fill the box, crop the overflow); with one axis the default is **contain** (letterbox to the requested size). `fit=cover` crops **SVG** exactly like raster (viewport clip). |
| `focus` | `X/Y` (percentages) | **Where the picture sits in its box**: the point X% across and Y% down the picture lands on the same point of the box, as CSS `object-position` does. With `fit=cover` it chooses what the crop keeps — `focus=50/20` holds a face near the top of a tall portrait in a round frame; with `contain` it places the letterboxed picture. Default `50/50`. Figures and presentation image cells; an inline `{aschar}` marker takes size keys only. HTML: `object-position`; FODT: the crop is baked. Edited in the Insert/Edit Image dialog. |
| `flip` | (flag) | **Mirror the picture left to right** before it is placed, so `focus` reads the picture as it is shown. HTML and FODT embed a mirrored copy of a raster (HTML mirrors an SVG with a transform). Edited in the Insert/Edit Image dialog. |
| `bleed` | (flag) | **Full-bleed** — extent is context-derived: to the page trim edges in body flow (a banner / section opener), over the row chrome in a presentation stack (the photo-header card). |

**Older keys** (older files may contain them; still read, and a current key in the same spec
wins): `floatWidth=N|auto` → `width=N%|auto` **plus** `wrap=image`; `floatHeight=column|N` →
`wrap=column|N`. **`box=WxH` is not read** (console warning) — `width=Wpt height=Hpt`
*is* the fixed box, and the cover default gives the same crop.

**Floating example.** A right-floated figure that takes up about a third of the column, with text wrapping on its left:

```
![Schematic](diagram.svg){align=right width=35% wrap=image}
This paragraph wraps along the left side of the figure. Once enough lines
have been laid out next to it, the float clears and full-width lines resume.
```

Floats inside a `COL|...` column block wrap against the column edge, not the page edge, so a percent `width=` is interpreted relative to the column the float sits in. Without `wrap=`, `align=left`/`align=right` simply pin the image to that side with no text wrap. The caption (the `[...]` text) is rendered under the image at the image's rendered width and centered, so long captions on small figures may be clipped — keep captions short, scale the figure up, or use a wider `width=`.

Supported formats: PNG, JPG, GIF, BMP, SVG. WebP loads only where Qt's WebP image plugin
(`qtimageformats`) is installed; without it a `.webp` picture renders as "Image not found".

### Document Embeds

Embedding another `.ord` document (or a section of it) inline:

```
![Title](other-document.ord)
![Title](other-document.ord#SectionName)
![Title](other-document.ord#2.1)
```

When the filename ends in `.ord`, the content is embedded rather than treated as an image.

#### Embed Attributes

Attributes can be specified in curly braces after the embed:

```
![Title](other-document.ord){absolute}
![Title](other-document.ord){sameLevel}
```

By default (relative mode), heading levels in the embedded document are adjusted so
that the top-level heading becomes one level below the parent heading. For example, if
the embed sits under a `##` heading, the embed's `#` headings become `###`.

| Attribute | Description |
|-----------|-------------|
| `absolute` | Preserve the embedded document's original heading levels without adjustment. |
| `sameLevel` | Adjust heading levels so the top-level heading is at the same level as the parent heading, rather than one level below. Has no effect if the embed has no parent heading. |

### Tables

Tables use pipe-separated columns:

```
| Header 1 | Header 2 | Header 3 |
| Cell 1a  | Cell 1b  | Cell 1c  |
| Cell 2a  | Cell 2b  | Cell 2c  |
```

- The first row is treated as the header row
- No separator row (like `|---|`) is needed
- Rows may be ragged: short rows are padded with empty cells to the widest row
- Alignment is controlled by the table style definition, not inline markers
- A table taller than the page splits at row boundaries and continues on the
  next page (the header row repeats only with the table style's Repeat Header
  option; tables containing footnote refs stay atomic).
- `\|` is a literal pipe inside a cell: `| A \| B | C |` is two cells, the first
  reading `A | B`. The table commands (Move Column, Add Column, Tab) and the
  merge of concurrent edits read cells the same way, as presentation records do.

#### Table Formulas

Cells can contain formulas using `=FORMULA=RESULT` syntax. The formula is between the first two `=` signs, and the displayed result follows the second `=`.

```
| Product | Price | Qty | Total          |
| Apples  | 1.50  | 10  | =B2*C2=15     |
| Oranges | 2.25  | 8   | =B3*C3=18     |
| Total   |       |     | =SUM(D2..D3)=33 |
```

**Cell references:** Column letter + row number (1-based). `A1` is the first column, first row. Ranges use `..` (e.g., `A2..A8`).
A reference reaches only the table it is written in; there are no cross-table references.

**References follow structural edits.** The Table menu's Add / Move / Delete Row and Column
commands rewrite every formula in the table so each reference keeps naming the cell it named
before, then recalculate. Only references whose target
moved are rewritten, in uppercase; the rest of the formula is left as typed. Ranges follow
LibreOffice's default rules:

| Edit | Single reference | Range (e.g. `D2..D6`) |
|------|------------------|------------------------|
| Insert a row/column | shifts past the new line | grows when the line lands after its first row and at or before its last (Add Row Above on row 6 → `D2..D7`); shifts when the line lands at its first row (Add Row Above on row 2 → `D3..D7`); unchanged when the line lands just past its last row (Add Row Below on row 6 keeps `D2..D6`) |
| Delete a row/column | `#REF` if it was the deleted line, else shifts | shrinks; `#REF` when every line of it was deleted |
| Move (swap with a neighbor) | follows its cell | a range one line thick along the moved axis follows its line (Move Column Left on D turns `D2..D6` into `C2..C6`); a thicker one keeps its place, so a row swapped across its first or last row leaves the range and the neighbor joins it |

`#REF` is written into the formula itself (`=#REF*0.08=#REF`) and evaluates to `#REF` wherever
it appears.

**Errors carry through, as in LibreOffice.** A formula cell whose result is an error (`#REF`,
`#DIV/0`, `#NUM`, `#CIRC`, `#ERR`) passes that error on: a reference to it (`=D7*0.08`) is that
error, and so is `SUM`, `AVERAGE`, `MIN`, `MAX`, `MEDIAN`, `MODE`, `PRODUCT`, `STDEV`, `VAR`,
`LARGE` or `SMALL` over a range holding it — the first error reading the range column by column.
`COUNT` counts only the numbers and `COUNTA` every filled cell, errors included. Other text,
including text typed into a plain cell that only looks like an error, is skipped by the
aggregates and is `#NUM` in arithmetic.

**A `|` line inside a fence is not a table.** The strokes of a ```` ```diagram ````, a pipe in
fenced code, the body of a python embed — none of them are touched by the table commands or the
formula recalc, however much they look like rows. Outside a fence, a line beginning with `|`
is a table row.

**Supported functions:**

| Category | Functions |
|----------|-----------|
| Aggregate | `SUM`, `AVERAGE` / `AVG`, `MIN`, `MAX`, `COUNT`, `COUNTA`, `COUNTBLANK`, `MEDIAN`, `MODE`, `PRODUCT`, `STDEV`, `VAR`, `LARGE(range,k)`, `SMALL(range,k)` |
| Math | `ABS`, `ROUND(val,digits)`, `FLOOR`, `CEIL`, `INT`, `MOD(a,b)`, `POWER(base,exp)`, `SQRT`, `LOG(val,base)`, `LN`, `SIGN`, `PI()` |
| Logic | `IF(cond,true,false)`, `AND(...)`, `OR(...)`, `NOT(val)` |
| Operators | `+`, `-`, `*`, `/`, `==`, `!=`, `<`, `>`, `<=`, `>=` |

**When results update:** editing a number in a table recalculates its formulas about a third of a
second after you stop typing — not on every keystroke, since each result is a real edit to the
document. The pass rewrites the results, re-pads the columns exactly as Tab would, and counts as
one undo step ("Recalculate Table"); it leaves the caret where you left it, wherever that is by
the time it runs. Two cases still wait for Tab: a cell you are part-way through typing a *formula*
into, so a half-written `=SUM(A1..A` is never answered with an error, and a table pathological
enough that a pass would stall (formulas × cells past 5M — far past a 500-row table totalled both
ways, which takes about 3 ms).

### Figure cross-references

Label a figure/table caption with `{#label}` and refer to it by name; the reference always
shows the right number even after you insert or reorder:

```
![The site map {#map}](map.png){scale=0.5}
As shown in @fig:map, the layout is regional.
```

`@fig:label` (also `@ref:label`, `@tbl:label`) is replaced with the kind + number (e.g.
"Figure 3"). The `{#label}` marker is stripped from the caption. The on-page caption number
comes from **List of Figures / List of Tables**, so enable those (`%+LIST_FIGURES: 1` /
`%+LIST_TABLES: 1`) to show the matching number on the figure itself.

### Table captions

A pipe table has no title slot, so its caption is a separate **`TBLCAP|`** line placed
directly **adjacent** to the table — *above* the table renders the caption above it, *below*
renders it below (no blank line in between). The caption is drawn with the shared `Cp` caption
style (seeded small/centered, same as figure captions; restyle via the `Cp` text style):

```
TBLCAP| Quarterly revenue by region {#rev}
| Region | Q1 | Q2 |
| West   | 12 | 18 |

| Product | Units |
| Widget  | 200   |
TBLCAP| Units sold this period
```

When **List of Tables** is enabled (`%+LIST_TABLES: 1`), the caption is numbered
("Table 1: …") and a `{#label}` on it resolves `@tbl:label`; with List of Tables off the
literal caption text renders with no number. A caption stays with its table across page and
column breaks.

### Stats, cards, leaders, sidenotes → presentation styles

Stat callouts, KPI card rows, dot-leader lines, and Tufte sidenotes have no one-line markers of
their own — they're **presentation styles**. Give a style a layout (Settings → Styles →
Presentation) and write `|`-fielded records; see "Presentation styles (layout modes)" below.
A layout is a few orthogonal choices — `flow` (packer vs aligned table), `next` (packer direction),
`arrange` (how one record's fields arrange), `place` (body or margin) — so a stat is the default, a
card row is `next=right cols=3`, a leader line is `arrange=leaders`, a sidenote is `place=margin`. The same content
flips between them by editing only the style; all box/border/background **chrome** comes from the
style's **Block Style**, not the spec.

### Blockquotes

Lines starting with `>`:

```
> Simple blockquote text
> Second line of blockquote
```

**With a named style:**

```
>stylename> Blockquote with custom style
```

**With a title:**

```
>style>Title> Blockquote with style and title
```

**Nested blockquotes:**

```
> > Nested blockquote
> >innerstyle> Nested with style
```

The blockquote continues as long as lines start with `>`. Blockquote styles are defined with `[>stylename]` in the style section.

**Callout / card block styles are NOT seeded:** a basic document shows only `def` in the Block
Styles tab, and `>note> …` in a document that never defines `[>note]` renders as a plain
blockquote, not a blue panel. The four conventional names, and the look each is usually given:

| Write | Look, once its `[>…]` style is defined |
|---|---|
| `>note> …` | light blue field, blue accent bar |
| `>warning> …` (or `>warning>Heads up> …`) | amber field, amber accent bar |
| `>tip> …` | green field, green accent bar |
| `>card> …` | neutral rounded, lightly-bordered container, no bar |

**Table-border idioms.** A table's style key is `<context>_Tb`, so to restyle tables you
set the document's `[|Tb]` table style (or a heading-scoped `_Tb` variant). Paste-able
field sets for the three common border idioms (fields: `align alt altCol1 altCol2 padT padB
padL padR sides topbot vert horz head sidesCl topbotCl vertCl horzCl headCl width`):

```
[|Tb]	left	#EEEEEE	#FFFFFF	3	3	4.5	4.5	0.75	0.75	0.75	0.75	0.75	#BBBBBB	#BBBBBB	#BBBBBB	#BBBBBB	#888888	0		0   ← full grid
[|Tb]	left	#EEEEEE	#FFFFFF	3	3	4.5	4.5	0	0	0	0	0.75	#BBBBBB	#BBBBBB	#BBBBBB	#BBBBBB	#333333	0		0   ← header rule only
[|Tb]	left	#EEEEEE	#FFFFFF	3	3	4.5	4.5	0	0.75	0	0.75	0.75	#BBBBBB	#CCCCCC	#BBBBBB	#DDDDDD	#333333	0		0   ← horizontal lines
```

### Code Blocks

Fenced with triple backticks, with optional language identifier and title:

````
```
Plain code block
```

```python
def hello():
    print("Hello, world!")
```

```cpp`My Title
int main() {
    return 0;
}
```
````

- The language identifier (after the opening ` ``` `) enables syntax highlighting via KSyntaxHighlighting
- A title can follow the language, separated by a backtick: `` ```language`Title ``
- If no language is specified, defaults to "code" style
- Supported languages include all KSyntaxHighlighting languages: `python`, `cpp`, `c`, `rust`, `javascript`, `java`, `sql`, `bash`, `go`, `ruby`, `php`, `html`, `css`, `json`, `yaml`, `xml`, and many more

### Lists / Bullets

**Unordered lists:**

```
- Item one
- Item two
+ Alternative bullet
```

**Ordered lists:**

```
1. First item
2. Second item
a. Lettered item
A. Uppercase lettered
i. Roman numeral
I. Uppercase roman
```

**Nested lists** use indentation (tabs or spaces):

```
- Top level
  - Nested item
    - Deeply nested
1. Numbered top
  a. Nested lettered
    i. Nested roman
```

**Custom style on list items:**

```
- [CustomStyle] List item with custom style
1. [MyStyle] Numbered item with custom style
```

### Columns

Multi-column layout is controlled with `COL|` directives:

```
COL|NumColumns|[Mode]|Width1|Width2|...|Gap|[Options]
```

**Parameters:**

| Parameter | Description |
|-----------|-------------|
| NumColumns | Number of columns (2, 3, etc.) |
| Mode | Optional: `bal` (balanced), `indep` (independent), or omitted (flow/sequential) |
| Width1..WidthN | Column widths as percentages |
| Gap | Gap between columns (percentage of the available width) |
| Options | Optional `key=value` settings (any order, see below) |

**Options (all optional, `key=value`):**

| Key | Form | Description |
|-----|------|-------------|
| `minPar=` | `minPar=N` | break-before paragraph count |
| `minTop=` / `minBot=` | `minTop=N` | mid-paragraph split minimums |
| `gaps=` | `gaps=3,5` | per-gap widths (N−1 values, same % units as `Gap`); unspecified gaps fall back to `Gap` |
| `bg=` | `bg=#eef`, `bg=#fff,#eee,#fff`, or `bg=grad(linear,90,#16213E,#7d3cff),#fff` | column background fill spec — one value applies to all columns, a comma-list (paren-aware) assigns per column; each value is a color/`$token`/`grad(...)`/`img:`/`svg:` (empty/invalid entry = no background) |
| `border=` | `border=1:#888:6` or per-column comma-list | column border as `width:color:radius` — width and radius in **points**; one triple applies to all, a comma-list assigns per column |
| `fg=` | `fg=#fff`, `fg=#fff,#f00` | per-column **foreground** (reversed-ink) color — recolors that column's text whose color is inherited from `def` (explicitly-colored text is unchanged); one value applies to all columns, a comma-list assigns per column. A block-box `ink=` on the same text wins over a column `fg=`. |
| `pad=` | `pad=8` | inner padding (points) between a column's decoration box and its content, on **all four sides**; defaults to a small value when `bg=`/`border=` is present. `extent=full` sets the box's vertical extent outright, so the padding there is horizontal only |
| `spacebefore=` | `spacebefore=24` | blank space (points) above the **whole region**. Every column starts below it and the region's background band moves with it — neither of which a space-before on one block can do, because with `headfull=0` the trigger is the first block of column 0 and its top margin moves that one column. This is the field a `SPACE\|N` line sitting between two regions moves onto. Exported as the same spacer HTML/FODT emits for `SPACE\|N`. |
| `headfull=` | `headfull=0`/`1` | (specs on a style) `1` = the styled trigger line spans full width above the columns (default); `0` = it is the first block of column 0. No effect on an inline `COL|` (no trigger line). |
| `route=` | `route=head` | (with `region=` on a HEADING style) route the **trigger heading alone** into the frame and leave the section body in the ordinary flow — the side label / rotated spine, written as a real heading instead of a `text=$var` riding a hand-placed frame. It routes the heading by definition, so `headfull` defaults to `0` there and `headbreak` is moot (the route closes at the heading). Default `route=section` routes the whole section. |
| `headbreak=` | `any`/`same`/`lower`/`none` | which heading ENDS the region — see below. Default `same` for a style spec, `none` for an inline `COL|`. An unrecognized value keeps the contextual default (console warning). |
| `boxfill=` | `boxfill=0`/`1` | `1` = all column boxes share a uniform height (default); `0` = each box hugs its own content. On a **continuation page** of a multi-page region, a column with no content there gets no box even under `boxfill=1`. |
| `bleed` | `bleed` | the outer columns' backgrounds extend past the margins to the page trim edge — the split-panel chapter-opener / colored-rail look |
| `extent=full` | `extent=full` | column backgrounds fill the full page height (a divider panel) instead of just their content; with `bleed`, full physical height |

Column `bg=` takes a full fill spec per column (comma-separated): a color, `$token`,
`grad(linear|radial,<angle>,<stop>,<stop>...)`, `img:<file>`, or `svg:<file>` — the same
fill model used by page and block backgrounds. The comma-split respects parentheses, so a
`grad(...)` value (which itself contains commas) counts as one column's fill.

Width tokens must be positive numbers: a width ≤ 0, or `key=value` options sitting in the
width positions (`COL|2|bg=#eef|…`), make the parser fall back to **equal widths** (a
console warning is emitted for out-of-range widths; options are still applied). An option
directly after the widths does not consume the gap slot — the default gap applies. Each
`COL|` parses fresh: a region never inherits the previous region's gap, `bleed`, or
`extent=full`.

**Column Modes:**

- **Flow (default):** Text flows from one column to the next, filling each column top-to-bottom before moving to the next.
- **Balanced (`bal`):** Content is distributed evenly across columns so they end at approximately the same height.
- **Independent (`indep`):** Each column's content is specified separately, separated by `COLBRK` markers.

**Examples:**

```
COL|2|50|50|5
Two-column flow layout text...
COL|1

COL|3|bal|30|35|35|5|minPar=0
Balanced three-column layout...
COL|1

COL|2|indep|50|50|5
Left column content here.
COLBRK
Right column content here.
COL|1

COL|2|50|50|6|bg=#fff5e6,#e6fff0|border=1:#cc8844:8|pad=8
Per-column background + rounded border with inner padding...
COL|1

COL|3|34|33|33|3|gaps=2,10
Custom per-gap spacing (small gap, then a large gap)...
COL|1
```

**End columns:** `COL|1` returns to single-column mode.

A `COL|` directive is legal as the document's **very first** block.

**Specs on a style (heading or not):** Any text *style* can carry a column spec
in its **Columns** field (Settings → Styles table) — the `COL|` body, everything
after `COL|`, e.g. `2|50|50|5|bg=#eef|border=1:#88a:6`. The styled line is the
*trigger*: a paragraph with that style opens a column region. On a heading style
this turns the heading's outline section into columns; on a non-heading (body)
style it turns the run starting at that paragraph into columns. `headfull` places
the trigger line full-width above (default) or in column 0; `headbreak` (below)
ends the region at headings. On disk this is text-style field 16 (the 17th
tab-separated field of a `[name]` style line).

`headfull` and `headbreak` work the **same way** on an inline `COL|` directive,
with one difference: an inline `COL|` has no trigger line (so `headfull` is a
no-op) and defaults to `headbreak=none` (it ends at an explicit `COL|1`) — set `headbreak=` explicitly to make it auto-end at a heading. A spec
on a style defaults to `headbreak=same`.

`headbreak=` controls which heading **ends** the column region (independent of
`headfull`), measured against the trigger's **enclosing section level** (a
heading trigger uses its own level). For a spec on a level-2 (`##`) heading,
given the outline `## Part One`, `## Part Two`, `### Detail`, `## Part Three`,
`# Conclusion`:

| `headbreak=` | Ends the region at | Columns contain |
|---|---|---|
| `any` | the very next heading, any level | each `##` body alone (and a nested `###` ends it too) |
| `same` *(default)* | the next same-level-or-shallower heading; a **deeper** heading stays in | `Part One`; `Part Two`+`Detail`; `Part Three` — each `##` its own region |
| `lower` | only a **shallower** (lower-number) heading | `Part One`→`Part Three` (incl. `Detail`) flow as ONE region, ending at `# Conclusion` |
| `none` | no heading — only an explicit `COL|` directive or end of document | everything from the heading onward, including `# Conclusion` |

**To end a region somewhere no heading follows**, put the **End Columns** effect (bitfield
`16384`, field 11) on the region's last block — a positional selector is the usual way to reach
it. `headbreak=` can only name a *heading*, and `Columns = 1` needs the next block to have a style
to hang the closing spec on; where the next thing is a `SPACE|` line, or nothing, neither works and
the region swallows what comes after. The effect says "end here" on the block that ends it. It does
exactly what an authored `COL|1` at that point does, so replacing the directive with the effect
changes nothing in the output. A region that runs to the end of the document needs no
closer at all, and back-to-back regions need none either — a later style whose resolved spec
differs replaces the open one.

**A spec carried by a positional selector spans differently** — on a **body**
line. On a heading, a selector chooses which headings trigger and the region is still the section,
exactly as for the `region=` route a selector can carry. On a body line a selector does not address
a section, it addresses a *set of blocks*, so it needs no `headbreak` and no closing marker: `[Bd.3-6@doc]` carrying a spec means "these blocks are two columns", and the region is the
**maximal run of consecutive blocks whose effective spec is equal**. The run ends at the first
block whose spec differs — *including empty*, so an unspec'd heading inside the selector's range
ends one run and the next addressed block opens another. `headfull` has no meaning there (there is
no trigger line distinct from the span). This is chosen by **how the spec reached the block**: a
spec on the style the author tagged the line with — an attach like `[Duet] …`, or a heading style —
keeps the open-here-close-at-a-heading behavior above.

A region opened **before any heading** (a body-style trigger in the preamble) closes at the
first heading of any level under `same`/`lower`. Two interaction rules inside an active
style-driven region: an **explicit `COL|N`/`COL|1`** overrides the section's style spec for
the REST of that section (the field-16 cascade into the body style does not re-open a
region until the next section boundary); a **nested trigger with a different resolved
spec** — a sub-heading with its own spec, or a named body style like a `[colcard]` — closes
the active region and opens its own (a nested trigger resolving the SAME spec simply
continues). Style triggers never hijack an explicit inline region while it is open.

**Column break:** `COLBRK` on its own line forces a break to the next column (in flow mode) or separates column content (in independent mode). In a single-column region a `COLBRK` is consumed as a harmless no-op (it never prints). In **slide mode** every column region collapses to a single top-to-bottom flow — column geometry is print-only.

**Page break:** `PAGEBRK` on its own line forces a new page. Unlike `COLBRK` it is not tied to columns — it always ends the current page (inside a multi-column region the columns resume on the new page).

**Fixed spacer:** `SPACE|N` on its own line inserts exactly N points of vertical space and paints nothing — deliberate breathing room without faking it with blank lines.

**Layout markers in slide mode.** `COL|`, `COLBRK`, `PAGEBRK` and `SPACE|` are *markers*: they
say where the flow goes and print nothing. In slide outline/follow modes they therefore claim
**no slide of their own** and carry no ancestor-heading band — they ride on the slide they land
in, invisibly, the way `REGION|` does. In the paged medium all four do their usual jobs.

### Presentation styles (the table model)

> **A presentation IS a styled table.** *Layout* lives in the style's **Presentation spec**; every
> *look* — boxes, fills, dividers, alignment, injected icon/name — lives in the **block styles** of the
> group, its rows, and its columns.

A named style can carry a **Presentation** spec. The document holds only **content** — positional
fields separated by `|` (`\|` is a literal pipe; a field may be text or an `![alt](path)` image) — and
the **style** picks the layout. The *same* content re-renders differently by editing only the style;
nothing in the document changes.

Two forms (both reuse the `[StyleName]` paragraph-style mechanism):

```
[Spec] Weight | 1.2 kg          # a single record (one line)

[Spec]                          # bare [Style] opens a GROUP:
Weight | 1.2 kg                 #   each following line is a record;
Height | 30 cm                  #   a blank line / new [Style] / heading closes it
```

If the style has no Presentation spec (the default), `[Style] …` behaves as an ordinary named
paragraph and `|` is literal.

Editing reads a group as a table either way: a bare `[Style]` group's records, or a run of one-line
`[Style] …` records of one name. Add Column and Move Column (`Alt+Shift+Left/Right`,
`Alt+Left/Right`) add a field beside the caret's in every record, or swap it with its neighbor in
every record.

#### Group, rows and columns (where the looks live)

Three block-style levels, addressed by the **suffix** on the bound style `[Spec]`:

| level | style | role |
|---|---|---|
| **group** | `[Spec]` | the box around the **whole group** (border + fill + radius). Carries the layout spec (slot 19). |
| **row** (record) | `[Spec/a]`, `/b`, … | per-record box / fill / **icon / name** — addressed by **letters** |
| **column** (field) | `[Spec/1]`, `/2`, … | per-field **text + box** — addressed by **digits**, **1-indexed** (field 0 → `/1`) |
| **cell** (row × column) | `[Spec/b/2]` | **one** cell — the row letter, then the column number |

Letters = rows, digits = columns — one namespace, no collision. Rows and columns are looked up
**positionally** (record *i* → `/<letter(i)>`, field *j* → `/(j+1)`), governed by per-axis **overflow**.

**One cell** (`[Spec/<letter>/<n>]`) addresses the intersection, on both
planes — `[Spec/b/2]` for text, `[>Spec/b/2]` for chrome. It **beats both** the row and the column,
and it is honoured even under a row that paints its own box, which the row/column pair cannot
express: "band columns 2–5 of row d" is four cell styles.
Row **overflow** still applies (a `cycle` row letter reaches every *n*th record); the column number
is literal. A row that exists ONLY as cells is still a row — it does not need a `[Spec/b]` of its own.
The Build Style dialog offers it as the cell kind **"one cell (/a/1 …)"**.

> **Separator note.** Cells are addressed with **`/`**; `.` is a positional selector (`.` picks
> *which blocks*; `/` addresses *cells inside a group*). Older files may spell a cell with a dot
> (`[Spec.1]`); that spelling is **not** read as a cell — such a row is an ordinary positional
> selector.

**The cascade.** Every property of a cell resolves **record (row) → field (column) → group**, first
defined wins, and a defined **row blankets its whole record**. *Text* and *chrome* are separate domains
(text lives in the Styles tab, chrome in the Block-Styles tab), so a row authored as a **block-only
fill** leaves the per-column text/ladder intact — zebra rows and distinct column text coexist. Define
nothing → everything cascades to the group; define a row → only that record changes.

A row that sets **only furniture** — an Icon (field 18), a Presentation spec (19) or a Sequence
chain (20), and no text field — does **not** blanket: the per-column `[Spec/N]` styles stay in
charge. That is what lets a stacked record carry a per-record bullet *and* a distinct style per
line. An **all-empty** row entry still blankets; that is the deliberate "this record has its own
text plane" marker.

**Overflow** decides what an *undefined* position does (`K` = highest defined index + 1):

| mode | undefined position → | result |
|---|---|---|
| **clamp** *(default)* | fall back up the cascade (column → group) | only the rows/columns you name are styled |
| **cycle** | wrap by modulo `K` | **zebra** rows / alternating column stripes |
| **repeat** | hold the last defined | extend the last row/column down |

So `rowoverflow=cycle` over `/a`/`/b` gives zebra; `rowoverflow=repeat` over `/a` boxes **every** card;
`coloverflow=repeat` over `/1`/`/2` gives **label + values** (`/1` the key, `/2` repeated).

#### Uneven air between stacked fields

`fieldgap=` is one number for the whole record, so "more space under field 2 than under field 3"
needs the fields themselves. In an **`arrange=stack`** record a cell's own **Top** (field 5) and
**Bottom** (field 6) add to the gap beside it: the gap between two fields is
`fieldgap + the upper field's Bottom + the lower field's Top`. Three rules make it predictable:

* **Between fields only.** The first field's Top and the last field's Bottom are *not* spent — a
  record's air against its own edge is the row/group box's padding, and spending it here would
  move the chrome around every record.
* **No cascade.** The value must be on the cell (or on the row that blankets it). An unset field
  does **not** inherit the group's, because a group's Top/Bottom is the whole *block's* margin —
  inheriting it would repeat the block's margin between every pair of fields.
* **`arrange=stack` only.** A row arrangement advances horizontally and a `flow=table` group is
  laid out as a table; neither reads these.

A `bars=divider` rule stays centred in the gap it sits in, so widening the gap moves the rule with
it. HTML mirrors all of this (a margin on the flex child); the LibreOffice (FODT) export carries
it only where a group exports as art.

#### Two records, one rail — the date-column pattern

A record whose content needs *several styled lines beside a narrow label* — a dated timeline
entry, a spec row — is two **records**, not one record with a stack nested in a field
(arrangements are flat; a field cannot itself be a stack). Make the label its own record, let
the entry join it, and put the rail on the entry's row:

```
[#5_Pz.{fields=1-4}]   … next=right cols=2 gap=9 arrange=stack bars=divider
                         rowoverflow=cycle splits=/stack/28.7%;/stack/
[#5_Pz.{fields=1-4}/a]   the LABEL record — a text-defined row blankets its single field
[#5_Pz.{fields=1-4}/1…4] the ENTRY record's stacked lines, per column
[>#5_Pz.{fields=1-4}/b]  Left Bar + `timeline` ⇒ the rail, drawn in the gap before the entry
```

```
2021 – 2025
Principal Designer | Lumen Digital |  | Led design for the payments platform…
```

`cols=2` pairs each label with its entry, the blank `dir` in `splits=` leaves that wrapping
alone while giving the two tiles their different widths, and `rowoverflow=cycle` alternates
the row styles so `/a` styles every label and `/b` carries the rail on every entry. The rail's
nodes land on each entry's first line and bridge to the previous one, so it reads as one
continuous line with the labels on its far side.

#### Dividers — the bar does double duty

Every block style has a **bar** (Block-Styles **Left Bar** width + **Bar** color) plus a **Bar Len %**
field (default 100, shortens + centers it). With the group-wide **`bars=divider`** toggle the bar is drawn
**centerd in the gap *before* the piece, oriented across the flow** — a **column** style's bar → a vertical
rule between columns; a **row** style's bar → a horizontal rule between records — interior gaps only.
Without the toggle the bar is the normal left **accent** bar (Bar Len % shortens it too). *A bar is an accent
**or** a divider, not both.*

#### The spec — layout only

The spec is `key=value` tokens (**Settings → Styles → Presentation** builds it behind a 5-button type
selector — None / Leaders / Stacks·Cards·Grids / Table / Margins — with a **preset row** that seeds
ready-made looks and a **live preview** rendered through the real painter):

| key | values | meaning |
|------|--------|---------|
| `flow`    | `pack` (default) · `table` | the **packer** (records flow into lines) vs. the column-**aligned** table |
| `next`    | `down` (default) · `right` | packer direction — `right` joins the current line; `down` = the record **owns its own line** (breaks before it when the line has members, and after it — so a cycled banner split re-banners) |
| `arrange` | `stack` (default) · `row` · `leaders` | how one record's fields lay out: stacked · side-by-side · inline columns with fill |
| `place`   | `body` (default) · `margin` | normal flow, or floated into the page margin (a sidenote) |
| `cols` (int·`auto`), `minw` | `next=right` | break every N (auto-wrap); `minw` = by-width wrap threshold |
| `width` (`60%`/`200pt`) | a `splits=` record **or group default** | tile width for this record (a `splits=` width), or a **group-level default** applied to every record (others equal-split the rest). A `%` is a share of the line after its gaps; on a `cols=`/`minw=` grid it is a share of a *full* line, so a short last line sizes its tiles like the lines above it. A narrowed single-tile (`next=down`) record can then be shifted with the row style's **H-Align** — the Zigzag pattern |
| `widths` (`30,70`) | `arrange=row`, `flow=table` | per-field-panel / per-column sizes (`%`/`pt`/`auto`), by display position |
| `valign` (top/center/bottom/baseline) | `arrange=row` | vertical align of unequal panels |
| `height` (`uniform`·`hug`) | packer | records sharing a line take the tallest record's height (`uniform`, the default — equal-height cards) or each hugs its own content (`hug`). The dialog's **Record heights** combo (Fields section; packer only, so it is not in the shared section) |
| `gap` (pt) · `rowoverflow` | all | space between records — **packer and `place=margin` only**; a table's row spacing comes from the row/cell block-style padding, and the table branch never reads `gap`. **Row overflow** (clamp·cycle·repeat) for `/a-n` rows **and** the `splits=` list, this one on every type |
| `colgap` (pt) · `rowgap` (pt) | packer, `place=margin` | per-axis overrides of `gap`: `colgap` is the space between records sitting **side by side on one line**, `rowgap` the space between **one line and the next**. Either one absent falls back to `gap`, so `gap=` alone still means both. The shape that needs them is chrome that must **join across a line**: a bottom border on two paired records reads as one unbroken rule only while the tiles touch, and `gap=0 rowgap=N` gives that rule its air below without opening a hole in the middle of it. Edited as **· side by side** / **· line to line** under **Between records** in the Presentation dialog, where the minimum reads "same as between records" and writes no key |
| `roworder` (`3,1,4,2`) | all | **record display order, 1-based**: the listed records render first in the given order; unlisted records follow in natural order; out-of-range/duplicate indices are skipped. A style-plane view — the document keeps its order, so each style section can order the same records differently. Everything positional follows the **displayed** order: `/a-n` row letters + `rowoverflow`, the `slots=num` ordinal, and slide `build=` reveals. Distinct from `slots=`, which reorders **fields** within a record; `roworder=` reorders the **records**. PDF, HTML and FODT all honor it. Edited in the Presentation dialog's **Show records in this order** field — in the shared section the Stacks·Cards·Grids and Table pages both use, so it survives switching between them (the field reads "rows" on Table; the live preview permutes its sample records). |
| `fieldgap` (pt) · `coloverflow` | all | space between fields — **packer and `place=margin` only** (a table's columns are set by `widths=` and cell padding). One number for the whole record; for *uneven* air, see the cell's own space-before/after below. **Column overflow** (clamp·cycle·repeat) for `/1-n` columns, this one on every type |
| `bars` | `divider` | draw block-style bars as **dividers** in the leading gaps (else they are left accents); in `flow=table` they are the table rules. A **column** style's divider rules between fields, a **row** style's between records — vertically when the records sit side by side (`next=right`), horizontally above an interior line. Either one becomes a **timeline rail** when its Bar Style carries the `timeline` token |
| `bleed` | `1` | the **group chrome** paints to the page trim edges horizontally (color-blocked band / dark hero panel); content stays in the text column. Single-column regions |
| `slots` (`icon,name,num,0`) | `arrange=…` | explicit panel sequence — tokens `icon`, `name`, `num` (the record's 1-based ordinal, styled by `[Spec/num]`) and data-field indices (see below). Any non-natural order or injection serializes as `slots=` |
| `splits` (`down/row;right/stack`) | packer | inline per-record **layout** list — `;`-separated, each split is `dir/arrange/tilewidth/fieldwidths/valign` (trailing blanks omittable), governed by `rowoverflow`. Built by the dialog's **Record layout** list ("+ Add another layout" for a second entry). **Leave `dir` blank** and the list supplies only width/arrange/valign — the group's `next=`/`cols=`/`minw=` wrapping still decides the lines. That is how two records of *different* widths pair on one line: `next=right cols=2` + `splits=/stack/26.5%;/stack/` gives a narrow record and a wide one, alternating by `rowoverflow`. Set `dir` on any split and the list takes the line structure over completely (`down` = the record owns its line, breaking before **and** after) |
| `between`/`sep`/`gappad`/`minfill` | `arrange=leaders` | gap fill = dots/dashes/line/gap/sep, separator text, fill padding, min fill |
| `transpose` | `flow=table` | `transpose=1` swaps records↔fields |
| `side` | `place=margin` | margin side `right`/`left`/`inner`/`outer` — with `gap` (space between the note's records), the whole of what `place=margin` supports. Older files may carry `width`/`collide`/`anchor` here; they are ignored — a `%+REGION` frame, which declares `w=`/`anchor=`/`fit=`, is the tool for that. A margin group taller than the page's margin **paginates at record boundaries** into the following pages' margins; a single record taller than an empty margin is placed and clipped with a warning — never silently dropped |
| `offset` (`dx,dy` pt) · `z` (int) | **any** spec — or standing **alone** on an otherwise plain style | **placement keys** (the straddle kit). `offset=dx,dy` paints the style's blocks displaced by (dx,dy) points while the **flow still reserves their original space** (pull a card up over a band seam); `z=N` picks the paint plane (0 = body; `<0` behind, `>0` above — the same planes region frames use). Paint-only: pagination, wrapping, footnotes, and coverage are computed from the undisplaced slot. A spec carrying **nothing but** `offset`/`z` does **not** make the style a presentation — the tagged line stays a plain paragraph (and a `[Name] ![](…)` line still figure-attaches — unless it carries top-level field separators, which make it a record); the keys apply through the style's trailing-tag suffix chain. Adding `region=` and nothing else keeps the **figure attach** too (a route-only spec places a figure, it doesn't re-render it as a record — see "the routing key" above), though there the tagged prose line does become a record. On region-**routed** content the region's own `z` wins; the offset still applies inside the frame |
| `overlap` (pt·`Nem`·`N%`) | `arrange=stack` | pull the stacked fields together so they interpenetrate — **Layered Text** (see below). `Nem`/`N%` resolve against the `front` field's size/height |
| `front` (1-based) · `dx`/`dy` (pt) | overlap | which field paints **last** (default: the last field); `dx`/`dy` nudge it |
| `blend` (solid·multiply·halo·outline·weave) | overlap | the front field's treatment; alpha overprint is free (put alpha in its `#AARRGGBB` color) |
| `halo` (`W`·`W:color`) · `stroke` (pt) | `blend=halo`/`outline` | knockout-halo width + color (default paper white); outline stroke width |
| `weave` (`NN%`) · `mix` (0–100) | `blend=weave` | target % of each front letter shown + area-vs-alternation balance |
| `bits` (hex) | `blend=weave` | manual override: one byte per weavable letter, section _j_ (left→right) = bit (7−j), MSB first, 1 = shown |
| `build` (default·`all`/`off`) | **slide mode only** | progressive reveal — see below. The dialog's **Reveal the records** combo (shared Slides section; reads "Reveal the rows" on Table) |

**Progressive reveal (slide mode).** In a slide style a multi-record presentation block **builds
one record at a time** by default: the first slide shows record 1, the next shows records 1–2, and
so on, cumulatively, until the whole block is present (each record stays put as the next appears —
just like sibling bullets already reveal one per slide). Every frame is laid out as the finished
slide, so a card that arrives beside another never resizes the ones already showing. Records that no longer fit the slide height
start a fresh slide, so a tall block splits across slides with the heading context intact. Set
**`build=all`** (aliases `off`/`none`) to show the whole block on one slide (still split by height if
it overflows) — the "all at once" override. Builds are baked into the PDF as extra pages, so the
slide viewer, `Left`/`Right`, and PDF export all just step through them; nothing builds in a print
style. A `flow=table` block reveals its header row as its own first frame (it is record 1).

There is no `list`/`grid`: a **list** is `next=down` (the default); a **grid** is `next=right` with a wrap
rule (`cols`/`minw`); each line **equal-splits by its member count**. Familiar presets: **Stack** =
(default); **Split** = `arrange=row`; **Cards** = `next=right cols=3` (+ a `.a` row box, `rowoverflow=repeat`);
**Leaders** = `arrange=leaders`; **Table** = `flow=table`; **Sidenote** = `place=margin`.

**Tables consume the same chrome family**: the header row IS `.a`
(text + fill), zebra = `.a`/`.b` + `rowoverflow=cycle`, cell boxes + padding come from the field's
column style (uniform 5 pt pad when unstyled), interior rules come from the row/column **bars** with
`bars=divider` (row bar → the rule above that row, column bar → the rule before that column, `Bar Len %`
honoured), and the group box outlines the table. A **single-field record spans all columns** — an
in-table section subheader styled by its row (non-transposed). Bands/rules follow the rendered
geometry under `transpose=1`; text and cell boxes follow the data.

**Alignment** is per-column: it comes from each `[Spec/N]` column style's text-align (Styles tab), not a
spec key. **Retired** — older names whose work the keys above now do; don't use them: `align`, `cycle`, `overflow` (→ `rowoverflow`/`coloverflow`), `hrule`, `vrule`, `fieldrule`,
`order` (→ `slots`), `header`/`tblstyle` (→ the `.a-n`/`.1-n` chrome family), and
`width`/`collide`/`anchor` on `place=margin` (→ regions; see the `side` row).

**Layered Text** (overlap lockups) — an `arrange=stack` record whose fields **interpenetrate** instead of stacking with
a gap: a bold headline and a serif echo woven into one display unit. Add `overlap=<pt|Nem|N%>` to the
group spec and the stacked fields are pulled together by that much (`Nem`/`N%` resolve against the `front`
field). Every field but `front` paints solid; then the front field paints on top with its `blend`:

| `blend` | Effect |
|---|---|
| `solid` (default) | front field simply on top; combine with an `#AARRGGBB` color for **alpha overprint** |
| `multiply` | front field multiplied into what's under it (ink deepens where the two cross) |
| `halo` | front field carries a **knockout halo** — a `halo=<W>` (pt) channel of paper color that clears the back where they touch, so the front reads on top. `halo=6:$paper` sets width + color (default white) |
| `outline` | front field drawn as an **open outline** (`stroke=<pt>`, default 1.5) — the back shows through the letters |
| `weave` | the front field **interlaces** with the back: at each crossing it goes over *or* under, per `weave=` |

`weave=NN%` sets the target: per letter, the visible crossing subset is chosen so that roughly `NN%` of that
letter's ink shows in front (`82%` = default; `100%` = the whole echo forward). `mix=0–100` balances the two
rules that decide which crossings show — `100` = purely hit the area target, `0` = purely alternate over/under
(neighboring crossings, and successive single-crossing letters, flip), `85` = default (a small nudge toward
alternation). For full manual control, `bits=<hex>` overrides the score letter by letter: one hex byte per
weavable letter (in order), and within a letter section _j_ (left→right, so section 0 is the leftmost
crossing) is taken from **bit (7−j)** — MSB first, `1` = shown, `0` = hidden. A single-section letter uses
only the MSB (e.g. `80` = shown, `00` = hidden). A short mask controls the first letters and the rest fall
back to the score; unlisted lower bits (letters with fewer than 8 sections) are ignored. As a
diagnostic, run with the environment variable `WEAVE_DEBUG=1` to print each letter's current byte
(`bits=NN`), then tweak from there. `front=<1-based>`
chooses which field paints last (default: the last field); `dx`/`dy` nudge it
in points. The weave renders by glyph outline, so inline
per-span faces (`**bold**`, `{=role=}`) don't apply *inside* a woven field — set the whole field's face on
its column style. **HTML export** reproduces overlap geometry, `front`, alpha, `multiply`, `halo`, and
`outline` in CSS; `weave` degrades to a solid overlap there (the interlace is a PDF-only refinement).

**Data meters** — a **column** block style with Opts bit **512 "Data meter"** renders its field's
leading number as a track + fill bar under the cell text: thickness = Left Bar (default 4 pt), color =
Bar, track = the same color at 18% alpha, rounded ends. `72%` → 0.72, `35/50` → 0.70, bare `72` → 0.72
(0–100 scale); a non-numeric field draws no meter. Trailing unit text is ignored and thousands
separators are tolerated, so `3,122 km` reads as 3122 — which makes unit-bearing columns meterable
when the group spec also gives the column a scale: **`metermaxN=<max>`** (per 1-based column, like
`meterN=`) divides a **bare** number by `<max>` instead of 100 (`671,000 km` with `metermax2=1250000`
→ 0.54). Explicit `%` and `n/m` values keep their own denominators; `metermaxN` does not affect them.
The meter *consumes* the bar (no accent/divider from that style). Works in pack and table flow.

**Micro-graphic shapes** — a 512 column defaults to a `bar`, but the group spec can render its number
as another shape via `meter=<shape>` (group default) or `meterN=<shape>` (per **1-based** column):

| Shape | Input | Draws |
|---|---|---|
| `bar` (default) | `72%`, `35/50`, `72` | horizontal track + fill (the classic meter) |
| `ring` / `gauge` | one value | a donut arc / a 180° half-gauge, filled to the fraction |
| `dots` / `pictogram` | `7/10` or a % | N pips (circles / squares), the filled count set by `n/m` or `round(frac·10)` |
| `battery` | `4/5` or a % | 5 (or `m`) segments, filled left-to-right |
| `waffle` | one value | a 10×10 grid, `round(frac·100)` cells filled |
| `stars` | `4/5` or a % | star pips, the dots count rule: a small `n/m` denominator (≤12) renders literally, a % scales to 10 stars |
| `dots-partial` / `battery-partial` / `waffle-partial` / `pictogram-partial` / `stars-partial` | a % / fraction | like the base shape but the transition cell is **fractionally** filled left-to-right instead of rounded — `64%` dots = 6 full + 40% of the 7th; `3.5/5` stars = 3 full + a half star |
| `traffic` | one value | a status dot: red `<34%`, amber `<67%`, green above |
| `arrow` | a **signed** value | ▲ green (≥0) / ▼ red (<0) delta triangle |
| `bullet` | `v;target` | fill bar + a target tick (tick color = Line color, slot 5) |
| `slider` | one value | fill bar + a round **knob** at the value (knob color = Line color, slot 5; else the bar color) — the skill-slider idiom |
| `range` | `lo;hi;v` | a low–high band with a value marker dot |
| `dumbbell` | `a;b` | two dots joined by a line (before → after) |
| `diverging` | a **signed** value | a bar growing left (red) / right (green) from center |

Multi-number shapes take numbers separated by `;` or spaces (e.g. `72;90`). Colors come from the same
block-style fields as the bar (thickness = Left Bar, primary = Bar, secondary/target/ref = Line color);
`traffic`/`arrow`/`diverging` use built-in green/amber/red. PDF and HTML render identically (HTML emits
inline SVG). Example: a group spec `flow=table … meter=ring` with a 512 column, or `meter2=bullet
meter3=dots` for per-column shapes.

**The track** — the unfilled part of the meter — is the primary color at 18% by default, which always
tints toward the fill. Two more spec keys override it, each with an optional `N` suffix that scopes it
to one 1-based column (per-column key first, then the bare group default, exactly like `meter=`/`meterN=`):

| Key | Value | Effect |
|---|---|---|
| `metertrack[N]=` | `<color>` or `$token` | the track color — e.g. a **white** track for sliders on a tinted panel |
| `meterstroke[N]=` | `<pt>[:<color>]` | an outline around the track; the color defaults to the bar's |

Both absent ⇒ the default track. Shapes with no track (`arrow`, `traffic`, `dumbbell`)
ignore them; on the pip shapes (`dots`/`pictogram`/`battery`/`waffle`/`stars`) the outline rings **every**
cell, filled or not, since each cell is a track cell.

**The graphic without its number** — **`meternumber[N]=off`** (per-column key first, then the bare
group default, like `meter=`/`meterN=`) renders the **shape alone**: the cell's text line is not
composed at all, and the glyph drops the 3 pt lead-in it normally leaves for the number above it.
The cell's inner height then **is** the glyph, so `valign=center` centres the *ink* on its label
instead of centring `text + 3 pt + shape` — which is what a bar/dots/stars column beside a label
almost always wants. Accepts `off` / `0` / `no` / `hide` / `none`; anything else (or absent) keeps
the number. Ignored on a column with no meter (a plain column keeps its text).

> Do **not** hide the number with a transparent 2 pt text style. That still composes a line box, so
> the shape lands `(lineBox + 3 pt) / 2` below the row centre and the only repair is a fudge pad on
> the *label* column — which grows the row and re-centres the meter downward again. Any change to
> the body type then breaks the alignment. `meternumber=off` is exact and stays exact.

Edited in the Presentation dialog's **Number graphics** list (in the
section shared by the Stacks and Table pages): one row per column — Field (1-based; "all" = the bare `meter=` group default), Shape,
Max (`metermaxN=`, the bare-number denominator), Track (`metertrackN=`, blank = the 18% tint),
Outline (`meterstrokeN=`, 0 = none, blank color = the bar's) and **Number** (unchecked =
`meternumberN=off`); the keys round-trip through the dialog.

**Per-corner radius**: the block-style **Round Size** field accepts `N`
(uniform) or **`tl,tr,br,bl`** — four point values clockwise from top-left, each
CSS-clamped to half the shorter side. It applies to presentation tiles, region frames,
section boxes and column decorations, and to the image **`radius=`** treatment (`{width=200 radius=24,0,24,0}` — the tr= pipe form carries
the same 4-value in its radius slot). HTML emits the equivalent 4-value `border-radius`.
A single giant corner (`36,0,0,0`) is a common panel motif.

**Shapes** — two block-style Opts bits. **2048 "Oval box"**: the chrome is the ellipse inscribed in the
box (Round Size is ignored; the per-side border bits win), and in presentation cells the slot's
*content* is clipped to it — an image field with `{width= height= fit=cover}` becomes a circular/oval
**avatar crop**. **4096 "Box: 1:1 square"**: a presentation badge cell squares around its content's
natural size (placed per the column's text-align / the record's valign, content centerd); on a
**record tile** it grows the tile's height to at least its width. **Oval + 1:1 = a circle** — number
badges (`slots=num`) that stay circular at any digit count, status dots, icon chips. 1:1 applies to
pack-flow slots and record tiles; group boxes and table cells ignore it (band/grid geometry wins).
Blockquote/code boxes ignore both (context-specific bits, like Line Numbers).

**Per-field text** uses the column style `[Spec/N]` if it defines text, else the **emphasis ladder**:
f0 = the style's own text, f1/f2 = the seeded `Pres1`/`Pres2` tiers (smaller/dimmer) — a stat or card
gets "big number over small label" with no per-style work. The ladder applies to **stacked** fields;
side-by-side panels / table columns default to equal styling. Override globally (`[Pres1]`) or per
column (`[MyStyle/1]`). **Leaders** slots run the same inline-markup pipeline as every other layout
(`**bold**`, `{=role=}`, bold-alias faces) in their column-resolved text styles, baseline-aligned;
the fill dots stay in the group/row base font.

**Style-injected fields.** A row style can contribute its own **Name** and **Icon** (slot 18) as virtual
panels, placed among the data fields via `slots=` — so the document stays content-only. `slots=icon,name,0`
renders the row style's icon, then its name, then data field 0; because they come from the **row** style
they **vary per record for free** (a status legend: define `.a`/`.b`/`.c` rows each with a colored-dot Icon
+ a Name). The injected name is styled by a `[Spec/name]` sub-style (falls back to the row); the icon
honours its own tint. Set the Icon's **placement to "Presentation field"** (`pos=field`) so it is drawn by
`slots=icon` and not also stamped on the block. A row style's icon with any **ordinary**
placement (`box.*`/`inside.*`/`edge.*`/`outside.*`/`margin.*`/`stack.*`) is stamped on that
**record's tile** instead — the same rectangle the row's block chrome, insets and bar already
use — so a badge or a hanging bullet rides each record without becoming a panel in the
arrangement. Only the row's **own** field 18 counts (an inherited group icon would double with
the block-level stamp), and `box=`/`line=` are inert on a tile, which names one rectangle.
`pos=margin.left` is the hanging bullet beside a stacked record: outside the tile's left edge,
level with its top. The **`num`** token injects the record's **1-based
ordinal** (numbered steps / ranked lists / big section numerals), styled by `[Spec/num]` — text falls
back row → `[Spec/num]` → row style; give it a filled/rounded `[>Spec/num]` block for a number pill.
Add these via the reorder list's **+ Icon** / **+ Name** / **+ №** buttons.

The spec lives in the style (slot 19), so it persists with the document and is shared with
collaborators like any other style value. A `place=margin` style reserves no flow height (give the page a wide
`%+RMAR:`/`%+LMAR:`); `side` = `right`/`left` (fixed) or `inner`/`outer` (recto/verso).

**Image fields** work in **every** layout: a field that is a lone `![alt](path)` is drawn as an image
(SVG renders as crisp vector). In the block layouts (Stack, Split, Cards, Table, Sidenote) an image fills
its slot/panel/cell; in **Leaders** it becomes an inline icon sized to the line. Options in a trailing
`{…}` block:

- **`{width=N%}`** (fraction of the slot) or **`{width=Npt}`** — draw width (default: fill the slot);
- **`{height=Npt}`** — fixed slot height; the image letterboxes (contain) inside it;
- **`{fit=cover}`** — scale-FILL and crop about the center instead of contain (with `height=` this is
  the photo-thumbnail crop; both raster and SVG);
- **`{bleed}`** — a **first-slot image of a STACK record whose row defines chrome** extends over the row
  box's padding to the box edges (top/left/right), clipped to the box corner radius — the photo-header
  card. Combine: `![](photo.jpg){bleed height=70 fit=cover}`.

#### Worked example — a zebra spec sheet, boxed, with a column divider

```
:STYLE:
[Spec]    block: rounded box, light border        (the group box)
[Spec/a]  block: white fill                        (odd rows)
[Spec/b]  block: pale-gray fill                    (even rows — zebra)
[Spec/2]  block: bar 1pt #ccc, Bar Len 60%         (vertical divider before column 2)
[Spec/2]  style: text-align right                  (values right-aligned)
:END:

[Spec]   arrange=row bars=divider rowoverflow=cycle widths=40,60
Weight | 1.2 kg
Height | 30 cm
Power  | 60 W
```

→ one rounded box around all three rows (`[Spec]`); rows alternate white / gray (`/a`/`/b` with
`rowoverflow=cycle`); a short centerd vertical hairline between the label and value columns (`.2`'s bar,
`bars=divider`); values right-aligned (`.2`'s text-align).

#### Presentation rules (`[Pz…]`) — activation with no attach

**A presentation spec describes a shape of data; the engine finds runs of that shape;
nothing else forms a group.** That is the whole model. The document holds only content;
the style sheet says what shapes exist and how they look. A `[Style]` attach in the body
still works and is still the right answer for a one-off a rule cannot describe, but a rule,
not an attach, is the general way to announce grouping.

**A record** is a unit of `|`-separated fields. It comes from **a body line** or
**a table row** — nothing else about the two sources differs: same predicates, same
cascade, same renderer. `\|` is a literal pipe. A body-line record gets the anonymous
role **`#<lvl>_Pz`**, and under a named heading (`### [Mine] Heading`) the name rides
along: **`#<lvl>_Pz_Mine`**. A table row takes the role of its context, with the `_Tb`
dropped — a table under `[Cards]` is `Pz_Cards`, not `Pz_Cards_Tb`.

**A run** is a maximal stretch of consecutive records that all satisfy a rule's per-record
predicates, inside that rule's scope. It ends at the first record that fails a predicate,
or at a structural edge: a heading, a figure, a directive, a fence, a tagged line, the end
of the scope. A **blank line does not** end it unless the rule asks with `blanks=split`,
and a single record is a group when the rule asks with `records=1` — both are defaults an
author overrides, not fixed properties of the format (see "Defaults" below).

**Detection alone changes nothing**: like every role, an unmatched `Pz` role is inert —
the pipes render as literal text. Only when a matching `[Pz…]` style resolves a
Presentation spec does the run become a presentation, so authoring the rule is the opt-in.

**Bounding a group, in decreasing robustness.** Reach for the first that works;
each rung below it is more sensitive to editing than the one above.

1. **Describe it** — the run ends where the content stops matching (`fields=2`,
   `f2=money`, `f1=img`).
2. **Count it** — `per=N` cuts the stretch into consecutive groups of N.
3. **Mark it** — `blanks=split`, or leave the `[Style]` attach in the body.

Segmentation is **per rule**: the engine finds maximal stretches of adjacent records once,
then each rule splits those stretches by its own per-record predicates and tests its
record-level ones on what it found. Two rules can therefore describe different extents
over the same records — the more specific rule wins the ground it covers, and rules that
found the *same* extent layer their specs onto it.

**A line carrying top-level field separators is a record, not a figure.** "Top-level"
means an unescaped `|` outside the image's `[…]`, `(…)` and trailing `{…}`, so an alt
text, a path or an attribute brace may hold pipes freely. That is what lets an image-led
photo card (`![](p.svg){bleed height=70} | Name | Blurb`) join a run and be selected by
`f1=img`; a `![…](…)` line with no separators is an ordinary figure.
The statement is position-free — an image is equally selectable in field 3 through
`has=img` — and it applies to a `[Name] ![…](…) | …` line too: the name stays on the line
as a body attach instead of being peeled into a figure role the record never reaches.

In slide-mode editions, rule-fused groups behave exactly like attach-opened ones (the
grouping happens before the document is split into slides), so converting attaches to rules
is safe in decks too.

**Grouping changes counting.** Fusing a run removes its lines from the ordinary paragraph
domain and adds one candidate to the `[Pz.K]` ordinal domain, so converting an attach to
a rule renumbers every bare-ordinal rule after it — and a selector elsewhere meaning "the
third paragraph" may now point at a different one. This is inherent to rule-driven
grouping, not a defect: describe groups by shape (`fields=`, `f1=`, `records=`) rather
than by ordinal wherever the data allows, and re-check `[Pz.K]` rules after any
conversion. As a diagnostic, the environment variable `ORD_RULE_DEBUG=1` prints the
candidate list and the ordinal each rule assigned.

**What stays tagged.** A hand-picked pull quote in the middle of a chapter is one
paragraph among many structurally identical paragraphs; no shape, no position and no scope
distinguishes it, because what distinguishes it is editorial judgment. Those keep their
`[Style]` attach and should. The rule model is for the repeated structures — the cards,
the ledgers, the spec sheets, the timelines — where the data itself says where one unit
ends and the next begins.

Rule spellings (all compose with the cell grammar — `.` picks *which groups*, `/`
addresses *cells inside* a group):

| Rule | Matches |
|---|---|
| `[Pz]` | every identified group (carries the default spec + group chrome) |
| `[Pz.2]` | the 2nd group **in the document** (bare `Pz` ordinals count `@doc`) |
| `[#2_Pz.first]` | the first group in each level-2 section (level-qualified ordinals count `@sec`; `@doc`/`@sec`/`@parent` override) |
| `[Pz.{fields=2}]` | every run whose records all have 2 fields (shape rule) |
| `[Pz.{fields=2 f2=numeric}]` | 2-field runs with a quantitative value column |
| `[Pz.{fields=1,3*}]` | a template signature: one 1-field record then any number of 3-field records |
| `[Pz.{has=img}]` | runs with an image field anywhere |
| `[Pz.{fields=3-4}]` | a range: runs whose records all have 3 or 4 fields |
| `[Pz.{fields=2 records=1}]` | a **single** piped line — one record is a group when the rule says so |
| `[Pz_Mine.{fields=1}]` | **claims the plain paragraphs** of every `[Mine]`-named section (see below) |
| `[Pz.{fields=1 f1=glyph}]` | a type-specimen strip: bounded by a type, so no named scope needed |
| `[Pz.{fields=1 f1=label per=2}]` | cuts a stretch of short lines into consecutive pairs |
| `[Pz_Notes.{fields=1 blanks=split}]` | a blank line ends the run — inside `[Notes]` sections only |
| `[Pz.{fields=2}.first]` | ordinal *within* the shape class |

**Positional selectors on an attach name.** `[Card.first]` beside a spec-bearing `[Card]`
picks among the groups the `[Card]` tag opens: each group is one ordinal (a bare `[Card]`
opener and its records, or a one-line `[Card] a | b`), counted across the whole document unless
the selector names a scope (`[Card.first@sec]`). Every ordinal form works — `.first`, `.last`,
`.2`, `.odd`, ranges. The matched group's name becomes `Card.first`, which resolves field by
field to `[Card.first]` and then `[Card]`, so the selector row carries only what differs — a
color, a font, a box — and the spec, cells and chrome come from `[Card]`. In the live preview the
ordinals come from the last whole-document pass, as other positional selectors' do. The
`ORD_RULE_DEBUG=1` diagnostic prints each `attach ordinal` it applied.

```
[Card]          EB Garamond  10 ...  arrange=leaders between=dots
[Card.first]    EB Garamond SemiBold  10 ... #9A3B2E
```

**The field-type system** (shape predicates sniff parse-time content only — they select
the style, they never feed alignment/formatting into the engine). Before sniffing, a
field is normalized: inline markers strip (`**$2.1B**` is still money) and a trailing
`{…}` options brace is ignored. Types, most-specific-first:

| Type | Matches | Examples |
|---|---|---|
| `empty` | whitespace only | `\|\|` |
| `img` | an `![alt](path)` field | `![](rocket.svg)` |
| `pct` | number + `%`, optional sign/space | `+18%`, `33 %` |
| `money` | currency symbol + number, optional K/M/B, optional sign | `$2.1B`, `€40`, `-$1,200.50` |
| `num` | bare number, thousands separators, optional K/M/B | `12,400`, `3.14`, `96k` |
| `unit` | number + short unit word (≤4 chars) | `1.2 kg`, `30 cm`, `45 min` |
| `date` | ISO `2026-08-02`, or a short form carrying a month name | `14 March 2026`, `Sept 2026` |
| `time` | clock or am/pm forms — tested **above** `unit`, so `9am` is a time | `14:30`, `9pm`, `11:05 pm` |
| `url` | a scheme, a `www.` prefix, or a domain-shaped token | `example.org`, `https://…/guide` |
| `email` | `name@host.tld` | `hello@example.org` |
| `glyph` | one grapheme, or a very short run of pure symbols | `A`, `&`, `→` |
| `text` | anything else (fallback) | prose |
| `label` | `text` refinement: ≤ ~4 words; `label(N)` caps the words at N | `Members`, `f1=label(2)` |

All-numeric slash forms (`3/4/26`) are deliberately **not** dates — that is a locale
ambiguity no sniff can resolve honestly. `phone`, `bool`, `range` and `code` are out for
the same reason.

Plus the coarse alias **`numeric` = `num|pct|money|unit`** — `f2=numeric` says "column 2
is quantitative" without caring how (`$40` / `12%` / `1.2 kg` in one column all pass).
A type slot may list **alternatives**, comma-separated: `f2=label,unit` matches a meta
column that says `50 minutes` in one record and `1 hour` in the next. (`fields=` lists
*positions*; a type slot lists *alternatives* — one comma, two meanings, kept apart by
which key it rides.)

Quantifiers: **`f<i>=type`** is positional (every record's field *i*; **empty fields are
wildcards** — a ledger with one blank amount cell still matches `f2=money`, though
`f2=empty` means *all* empty and an all-blank column proves nothing); **`has=type`** is
existential (any field of any record); **`records=N`/`N+`/`N-M`** constrains the record
count; **`fields=N`/`N+`/`N-M`** requires every record to have that count, and
**`fields=` lists** (`2,3,1` exact / `1,3*` open tail / `Sub?` optionals) are per-record
signatures in the same micro-grammar `seq=` uses. The range form is spelled like the
selector range (`[#2.1-2]`); "at most N" is `1-N`, since a record cannot have zero
fields. A column mixing non-empty types is `text` — never a majority vote. Exact
signatures are edit-fragile (inserting a record silently detaches the rule) — prefer
`N+`/`*` forms outside templates.

**Counts only ever TEST; a separate key CUTS.** `records=` and `fields=` describe the run
the engine found — they never create one. **`per=N`** cuts a matched stretch into
consecutive groups of N (thirty-six lines meaning twelve three-line cards); a remainder
shorter than N does not match and stays ordinary text. `per=` takes a single integer
only: if the unit size varies, the data does not say where one unit ends and the next
begins. `blanks=split` segments first, then `per=` cuts inside each segment.

**Defaults, and why they are written down.** A spec that describes no shape claims
nothing new: `records=2+`, `fields=2+`, `from=nottable`, blank lines invisible — "two or
more consecutive lines that all have fields". So `records=1` (a single piped line) and
`fields=1` (plain paragraphs) are the author overriding that default. Each rule counts its **own** candidates, so a bare `[Pz.2]` ordinal only
ever counts groups of that default shape.

**A deliberately blank cell still needs a character in its first field.** A record written
`|` alone has nothing before the separator, so it is not a two-field line, so it does not
satisfy the default `fields=2+` — and because a non-record **breaks the run**, the damage
lands on its *neighbours*: the records either side can drop below `records=2+` and fall out
of the group, rendering as literal source text. Put any non-empty character in the field —
U+200B ZERO WIDTH SPACE is the safest, being invisible, zero-width, and not whitespace, so
no trimming pass can eat it. The `ORD_RULE_DEBUG=1` diagnostic reports it in one line: *this line fits the
record shape, but the run around it does not satisfy records=2+*.

**Blank lines are invisible to a rule** unless it opts in with **`blanks=split`**, which
makes a blank line end a run. Declare it on the narrowest rule that needs it: a rule
scoped to recipe sections makes blank lines structural inside recipe sections only, and
an author reflowing whitespace elsewhere cannot disturb it. There is no document-level
switch — a rule's behavior must not depend on a distant header.

**Where records come from (`from=`).** A pipe table is a stretch of records too — the
rows of one table, self-delimiting, normalized the way a chart reads them: outer pipes
stripped, the markdown `|---|` separator row dropped, ragged
rows padded to the widest.

| `from=` | Records come from |
|---|---|
| `nottable` | body lines only — **the default** |
| `table` | table rows only |
| `any` | both |

The default keeps a document that has `[Pz.{fields=3}]` rules and ordinary pipe tables
from rendering its tables as cards: a table is claimed only by a rule that asks for it. A table consumed as records inherits everything a body run
inherits — arrange / slots / chrome cascade / valign / icons / meters — because it goes to
the same renderer. Its first row is simply its first record, so under `flow=table` the
header row lands in the slot `flow=table`
synthesizes and the body rows in the lettered/cycled ones.

**A table can be records *and* a chart source.** The two uses are not mutually exclusive.
A `CHART|` under a consumed table still reads the same rows, and the chart's series tags
(`[Bar]`, `[X]`, `<…>` overrides) stay header *syntax*: the chart consumes them, and the
displayed record strips them exactly as a displayed table header strips them.
`TBLCAP|` is unaffected.

**Why a rule and not a selector.** Rules group the document *before* it is split into
blocks and slides, while chains and positional selectors are applied afterwards, to painting
only. That is why converting an attach to a rule is safe for a slide edition and converting
it to a selector is not: a rule cannot move a slide-mode style's slide breaks.

**Claiming plain paragraphs (`fields=1`).** A `fields=1` rule takes ordinary paragraphs
as records with no per-paragraph markup; the run ends at a heading, a figure, a directive
or an explicit `[Style]` attach, and new paragraphs typed into it join automatically.
Because that is a wide net — most documents hold runs of adjacent plain lines that are not
presentations, such as an opening kicker/title/blurb — a
`fields=1` rule must be **bounded**: by a named scope (`[Pz_Mine.{fields=1}]` under
`### [Mine] Heading`), or by a record count, a field-type predicate, or `blanks=split`.
An unbounded, unscoped one is warned about and ignored. Remember that the section's own
prose is a one-field record too: `f1=label` is usually what separates the cards from the
paragraph introducing them. The Pz cascade is
`#3_Pz_Mine → Pz_Mine → #3_Pz → Pz → def` — the section name **strips away** (a claimed
group never inherits fields from the heading's own `[Mine]` text style).

Looks resolve exactly like attached presentations: the spec from the most specific
matching rule (then down the Pz chain), group chrome from `[>Pz…]`, rows/columns/cells
via `[Pz/a]`, `[Pz/1]`, `[&Pz/2]` (a rule-specific cell like `[Pz.2/1]` wins over
`[Pz/1]` for groups matched by that rule), and the `Pres1`/`Pres2` emphasis ladder as
usual.

**Seeing what a rule did.** Because rule grouping is not visible in the document text,
the editor reports it. Put the cursor on a line and open Styling Help:

- **Claimed** — `matched [Pz.{fields=2}]: 4 records · record 2/4 · run: lines 12–15`.
  Which rule, how big the run is, where this line sits in it, and — the part a rule-grouped
  document cannot show you — where the run starts and stops.
- **Not claimed** — `no rule claimed this line · nearest [Pz.{fields=2}]: this line has 1
  field, the rule wants fields=2`. The rule that came closest and the first predicate that
  turned it away. A line that fits the record shape but is still unclaimed reports the
  run-level reason instead ("the run around it does not satisfy records=3"), which is the
  "why did my run stop here" question.

Ordinary prose stays quiet: a near miss is only reported for lines that look like they
were meant to be records (two or more fields), or against a rule that claims plain text.
As a diagnostic, the environment variable `ORD_RULE_DEBUG=1` prints the whole picture to stderr — every rule, every candidate, every
fuse, every overlap yielded, and every miss.

**Authoring a rule.** The shape lives in the style **name**, so it is built by the style
NAME builder: **Build Style…** in the Styles toolbar. Choose Role
▸ *Presentation rule (Pz)* and the shape controls appear — field count (exact / at least /
between / signature), record count, per-field types, `has=`, and a **Records** row for
`from=`, `blanks=split` and `per=`. The type combos are editable, because a type slot may
list alternatives (`label,unit`) or take a word cap (`label(2)`), neither of which is a
fixed list. With a style row selected the dialog opens in EDIT mode and renaming carries
the style's whole **cell family** — `/1`, `/a`, `/num`, and the `[>…]`, `[&…]`, `[|…]`,
`[~…]` planes — because a rename that missed them would detach the look silently.
The Presentation dialog (the spec cell) says what the group *draws*.
Build Style is what it *selects*. When several rules match one run, their spec suffixes layer most-specific-first
(more predicates > ordinal tier > longer role > later-defined), per-field like
positional selectors. **Precedence overall:** an explicit `[Style]` attach always wins
(attached lines never join a run). Identified piped runs and claimed groups share ONE
`[Pz.N]` ordinal domain, in document order.

Everything here is render-time only (nothing is written into the document; typing the
2nd line of a run "pops" the presentation in, like pipe tables) and is inert when no
`[Pz…]` styles exist. The `ORD_RULE_DEBUG=1` diagnostic traces rule decisions.

**Style-driven breaks (Effect column):** a style's **Effect** field has break toggles that apply to every heading/body block using that style, so you don't need a directive line:

- **Column Break** — the block starts a new column. Only acts inside a multi-column region; does nothing with a single column. It is *soft*: skipped when the current column is still empty, so it never leaves a blank column.
- **Hard Break** — forces the Column Break unconditionally, even when it would leave an empty column. (Has no effect on its own; it modifies Column Break.)
- **Keep With Next** — the block must not be separated from the block after it by a page or column break; if they would split, both move together to the next column/page. Use it to keep a caption/label with its figure, or a heading's body with a non-splittable element. (An explicit Column Break / Hard Break still wins.)

### Diagrams

ASCII-art style diagrams using a fenced-code-style opener with an optional title and an attribute block. Inline (non-float) diagrams render anchored at the left margin of the column; the `align=` attribute affects float behavior only, not inline placement.

```
```diagram Title {scale=80, align=left, width=30%, wrap=image, margin=4}
+-------+    +-------+
| Box A | -> | Box B |
+-------+    +-------+
```
```

The block is terminated with a closing ```` ``` ```` fence on its own line. The opener is ```` ```diagram ```` followed by an optional title and an optional `{...}` options block.

| Attribute | Values | Description |
|-----------|--------|-------------|
| `scale` | Integer (default 80) | Size multiplier as a percent. |
| `fullwidth` | Flag (no value) | Stretch the diagram to fill the column width. |
| `align` | `left`, `right`, `center` | Horizontal placement within the column. With `wrap=`, `left`/`right` make the diagram float and let following paragraphs wrap around it. |
| `width` / `wrap` | see Images | The unified grammar: `width=N%|Npt|auto` sizes the float zone, `wrap=image|column|N` floats + sets the wrap extent. `width=auto` measures the diagram's natural width. Figure-table defaults (`[&Di]`/`[&Ci]`) apply; the brace wins per key. |
| `margin` | Float, or `T,R,B,L` | Outside spacing in points. Same semantics as the image `margin=` attribute. |

### Circuit Diagrams

Electronic/logic circuit diagrams using markdeep-style notation, in the same fenced-code-style format as Diagrams:

```
```circuit Title {scale=80, align=right, width=40%, wrap=image}
*--+--R--+
   |     |
   C     L
   |     |
GND-+----+
```
```

Same opener/options/terminator format as Diagrams; the only difference is ```` ```circuit ```` vs. ```` ```diagram ```` in the opening fence. Uses markdeep circuit notation for rendering.

### Charts

Charts render data from the **preceding table** as a single-line directive. Inline (non-float) charts fill the available column width (full-width minus margins), anchored at the left margin; the `alignStr` field affects float behavior only.

```
CHART|Title|Ratio|Scale
CHART|Title|Ratio|Scale|alignStr|floatWidth
CHART|Title|Ratio|Scale|alignStr|floatWidth|m=T,R,B,L    (floatWidth: percent, "auto", or "Npt")
CHART|Title|Ratio|Scale|m=T,R,B,L
CHART|Title|Ratio|Scale|{flat options}
```

| Field | Description |
|-------|-------------|
| `Title` | Chart title (caption beneath the chart). |
| `Ratio` | Height-to-width ratio (default 0.6). |
| `Scale` | Size multiplier (default 1.0). For flat charts (below) it zooms the default type/line/marker sizes instead. |
| `alignStr` | `left` or `right` for floats. Optional 5th field. |
| `floatWidth` | The float-zone width: a percent of the column, `Npt`, or `auto` (the chart's intrinsic `800·scale` width). Optional 6th field. When absent, a `[&Ct]` figure-style row with Align + Wrap supplies the float. |
| `m=T,R,B,L` | CSS-style margin in points (top, right, bottom, left). Always emits all four values; unlike the image `margin=` attribute there is no single-value shorthand. May appear at any pipe position after `Scale`. |
| `{...}` | Flat-chart options field (any pipe position; recommended last). |

Charts are single-line directives (no terminator). They automatically use the data from the most recently defined table. Series tags in the table's header row (`[Line]`, `[Spline]`, `[Area]`, `[Scatter]`, `[Bar]`, `[HBar]`, `[StackedBar]`, `[StackedHBar]`, `[PercentBar]`, `[PercentHBar]`, `[Pie]`, `[Donut]`, plus `[X]`, `[Names]`, `[BarCategories]`, `[HBarCategories]`) pick each column's series type; the tags (and any `<...>` override braces) are stripped from the *displayed* table header.

#### The flat chart engine

One renderer sits behind `CHART|`: the **flat engine** — hand-painted, palette-token-aware, gradient-capable, identical in PDF/HTML/FODT. The `Scale` field acts as a chart zoom, clamped to 0.25–3 (so a canvas-sized value an older file may hold, like 55, can't blow the chart up).

**Options** (space-separated `key=value` inside the braces; no `|` characters; all sizes points, all colors `$token`/`#hex`/named):

| Option | Default | Meaning |
|---|---|---|
| `palette=c1,c2,…` | `$chart1…$chart12` tokens if defined, else a built-in 10-color cycle | series color cycle |
| `fill=solid\|gradient\|none` | area `gradient`, bar `solid`, line `none` | series body fill; `gradient` on a line fills under the curve |
| `bg=<color\|$tok\|grad(...)>` | none (page shows through) | chart panel background (the fill-spec `grad()` syntax, comma stops) |
| `ink=` / `muted=` | page-ink chain / ink@62% | primary / secondary text+axis color |
| `grid=y\|x\|xy\|none`, `gridcolor=` | `y`, ink@10% | gridlines |
| `gridtop` | off | draw the under-line shading (an `[Area]` band, or `fill=gradient` under a line) *below* the grid, so the gridlines stay continuous through the fill and only the series stroke rides on top. Bars are unaffected — they always cover the grid they span |
| `font=`, `fs=` | the `_Ct` style's font, 8 pt | chart typography; `axisfs= legendfs= labelfs= centerfs=` per role |
| `lw=`, `axislw=`, `gridlw=` | 1.8 / 0.9 / 0.6 | stroke widths |
| `marker=` | 5 | scatter marker diameter |
| `points=1\|end\|named` | off | vertex dots on lines (paper-colored halo); `end` marks only the last point; `named` dots+labels only vertices whose row has a non-empty `[Names]` cell (points of interest on a profile) — works on `[Area]` series too |
| `vline=`, `hline=` | — | dotted reference lines: `;`-separated `<value>[:<label>]` entries, `_` → space in the label (`vline=5.6:treeline_·_10,900_ft`). `vline` marks a value on whichever axis runs horizontally (x/category normally, the value axis on HBar charts); `hline` the vertical axis. Muted-ink dotted stroke, label at the top (vline) / right end (hline) |
| `barradius=`, `bargap=`, `groupgap=` | 1.6 / 0.32 / 0.08 | rounded bar ends; category / intra-group gaps (fractions) |
| `xmin= xmax= ymin= ymax=`, `ticks=` | auto (nice bounds; bars include 0), ~5 | axis ranges / target tick count. An explicit `ymin=` also lifts the bar/area zero-basing, so an elevation-profile area can start at `ymin=8000` with sanely-stepped ticks |
| `format=` / `yformat=` / `xformat=` | auto (grouping ≥10k, SI ≥1M) | `si`, `percent`, `int`, `dec:N`, optional currency prefix (`$si`) |
| `yunit=`, `xunit=` | — | unit suffix on the axis' extreme tick only (`yunit=ft xunit=mi` → "11,000 ft" on the top value tick, "7 mi" on the rightmost x tick); `_` → space. `yunit` follows the value axis (bottom edge on HBar charts); `xunit` needs a numeric `[X]` axis (ignored for category labels) |
| `axis=none` | — | sparkline mode (no axes/grid/labels) |
| `legend=bottom\|top\|left\|right\|end\|none` | none (1 series) / bottom (2+) / right (donut rings) | `end` = direct series labels at line/area ends |
| `labels=1`, `labelformat=` | off | value labels (bar ends, stack totals, line last point; pie: `value` shows raw values) |
| `pielabels=out\|in\|legend\|none`, `labelmin=` | `out` single ring / `legend` multi-ring, 3% | slice label mode; sub-`labelmin` slices get no leader |
| `hole=`, `ringgap=`, `startangle=` | 0.62 / 1.2 / 90 | donut hole fraction, ring gap, start angle (90 = 12 o'clock) |
| `center=`, `centersub=` | — | donut center metric: `total` (sum of outer ring, formatted) or literal text (`_` → space) + sub-caption |
| `table=show\|hide` | `show` | `hide` suppresses the chart's SOURCE pipe-table entirely (data still feeds the chart) — per chart here, doc-wide via the chart-style "Src Table" field |

Any option may be given the value `auto`, meaning the engine's context-dependent default.

**Per-series overrides** in the table header cell, inside `<...>` (space-separated): a color (`<$accent>`, `<#d64545>`), a `grad(...)` fill, `lw=N`, `dash`; a bare integer sets a pie's label position (1=outside, 2-4=inside). Example: `| Fit [Line] <#8A8F98 lw=1.2 dash> |`.

Both vertical and horizontal bar families can't share one plot (vertical wins); line/spline/area/scatter mix freely with vertical bars (combo charts) on a shared value axis. Multiple `[Donut]` columns are concentric rings, outermost first, inner rings desaturated stepwise; multiple `[Pie]` columns render the first only.

#### Chart styles (`[~Name]`)

A fourth style plane next to text `[Name]`, table `[|Name]`, and block `[>Name]` lines: a **chart style** line carries tab-separated fields that pre-set the flat-chart options for every chart that resolves to it. Chart styles cascade through the same name hierarchy as table styles (a chart block is `#N_Ct`, so `[~def]` styles everything, `[~#2_Ct]` overrides charts under level-2 headings) and support the `*`/`+` relative ops.

```
[~def]	$brand,$accent,#6CC5B0			#1A1A1A		y		Ser	8	2.2		2	40	bottom	yes				90
```

Fields (in order): palette, fill, background, ink, muted, grid, grid color, font, font size, line width, marker, bar radius, bar gap %, legend, labels (yes/no), format, pie labels, hole %, start angle, axis (normal/none), src table (show/hide). Bar gap and hole are percents in the style (the `{}` options use fractions).

Every document gets a seeded `def` chart style carrying the **engine defaults**, visible and editable on the settings page (it serializes only once edited). Fields with a fixed default show it explicitly (grid `Y`, font size `8`, line width `1.8`, marker `5`, bar radius `1.6`, bar gap `32`, labels `No`, start angle `90`, axis `Normal`, src table `Show`); context-dependent fields are left **blank** and resolve at render time (palette: `$chart1…` tokens → built-in cycle; fill: per series type; legend/pie labels: per chart shape; hole: donut 62% / pie 0; ink/colors/font: the document chain). A blank field cascades like any other style field. Enum values are case-insensitive, so hand-authored lowercase (`y`, `yes`, `normal`, `show`) works as well as the capitalized dropdown forms. To get a context-dependent default, leave the field blank.

Inline `{...}` options always override the style per chart. Chart styles are edited in Settings on the **Table & Chart Styles** page, are shared with collaborators like the other style planes, and persist as `[~Name]` lines in the `:STYLE:` block.

### Figure Styles: `[&name]`

A sixth style plane: **cascading, name-referenceable defaults
for the unified image grammar**, one column per key. One `[&def]` row can float every
figure right; a `[&Ct]` row restyles only charts; a `[&Hero]` row is opted into by name.
Read ONLY by the six figure families (`Im Sv Di Ci Ct Py`) and presentation image cells —
a populated `[&def]` can never affect a paragraph or heading.

```
[&def]	right	auto	 	 	image	 	 	 	 	 	6	2	
[&Hero]	 	100%	 	 	 	cover	 	 	 	 	8	 	
```

**Columns** (tab-separated; blank cell = inherit; values are the grammar's own spellings, read
**case-insensitively** — the Settings pick-lists offer the Title-Case forms `Center`, `Cover`,
`Yes` …, and `center` / `Center` are the same value):

| Fld | Column | Values | Class |
|-----|--------|--------|-------|
| 0 | Align | `left` `center` `right` | Layout |
| 1 | Width | `N%` · `Npt` · `N` · `auto` · `0`=natural | Layout |
| 2 | Height | pt · `0`=natural | Layout |
| 3 | Scale | factor · `1`=natural | Layout |
| 4 | Wrap | `none` `image` `column` · `Npt` | Layout |
| 5 | Fit | `cover` `contain` | Layout |
| 6 | Bleed | `yes` `no` | Layout |
| 7 | Fullwidth | `yes` `no` | Layout |
| 8 | Border W | pt · `0`=none | Frame |
| 9 | Border Color | color / `$token` | Frame |
| 10 | Radius | pt · `0`=square | Frame |
| 11 | Shadow | pt · `0`=none | Frame |
| 12 | Margin | `N` · `T,R,B,L` · `0`=none | Margin |

**Cascade: per-FIELD, first non-empty cell wins**, walking the ordinary reduction
(`#N_Im → Im → def`; with a name attached `#N_Im_Hero → Im_Hero → Hero → def`; prez cells
`Spec/1 → Spec → def`). `[&def]` can carry a doc-wide `Radius=6 Shadow=2` that survives
any narrower row's layout overrides untouched. **Unset = inherit; negation is explicit** —
a narrower row cancels an inherited value only by stating the off-value (`Wrap=none`,
`Bleed=no`, `Width=0`, `Height=0`, `Scale=1`, `Radius=0`, `Margin=0`). Relative ops
(`*1.5`, `+2`) work on the plain-numeric fields (Height/Scale/Border W/Radius/Shadow).
Validation runs **after** the full style+inline merge (`align=center` meeting an inherited
`wrap` warns and drops the wrap; the `fit` default is computed from which sizing axes are
present). In Settings the closed-list columns are pick-lists and **Wrap opens a builder
dialog** (inherit / none / image / column / an explicit zone height in points), since the
numeric form is invisible in a plain list.

**Precedence, low→high:** type default < figure table (per-field via the cascade) <
inline `{...}` (per-key).

**Five override scopes**, no new machinery:

| Set fields on… | Affects |
|-----------------|---------|
| `[&def]` | all six types, all levels |
| `[&Im]` `[&Sv]` `[&Di]` `[&Ci]` `[&Ct]` `[&Py]` | one type |
| `[&#1_Im]` (etc.) | one type at one level |
| `[&Name]` + a **`[Name]` prefix** on the figure | any figure that opts in by name |
| inline `{...}` | that one instance |

**The `[Name]` figure prefix.** The same style-attach headings and body already have:
`[Hero]![…](p)` / `[Hero] ```diagram …` composes the role as `#N_Im_Hero` / `#N_Di_Hero`,
so **one prefix resolves three planes** — `[&Hero]` figure geometry, `[>Hero]` box chrome,
and the `Hero_Cp` caption style. The prefix is only peeled when a figure opener follows
(and never when the name is presentation-bound — `[Spec] ![…] | caption` stays a
presentation record); prose lines starting with `[word]` are untouched.

**Figure chrome (the `[>name]` box on figures).** A figure whose role resolves an
explicitly-defined non-`def` `[>name]` with a visible box (fill / border / bar) paints
that box around image + caption: pads inset the content and narrow its container, the
accent bar and per-side border bits work (the list-separator / pull-quote idioms on
figures), and a float's zone includes the pads (the wrap gutter sits outside the box).
Two radii, two planes: block slot 7 rounds the **box**, the figure table's Radius rounds
the **image** — they compose. `[>def]` never cards figures (activation requires an
explicit non-def box); `bleed` beats chrome; presentation image cells keep their CELL
chrome and never run figure chrome (no double box). Block slots 14/15/16 (Box Width /
H-Align / V-Align) are inert on figure blocks — the figure table's Width/Align are the
one geometry source.

**Presentation slots — the default rule.** *Inside a presentation, layout is the
presentation's business; looks may be document-wide.* An image cell's **Layout-class
fields (0-7)** resolve only from the presentation's own rows (`[&Spec/1]` → `[&Spec]`);
with neither set the slot keeps its native behavior (fill the slot, aligned by the
column's text-align). `[&def]`'s **Frame/Margin fields (8-12)** DO fall through — a
doc-wide `Radius=6` reaches presentation images — but its Layout fields are ignored in
slots, and the `Im` family never reaches a cell's chain. Presentation images take the
full treatment set (`border`/`radius`/`shadow`/`scale`/per-image `margin`) through the
shared grammar.

Figure styles are edited in Settings on the **Block & Figure Styles** page,
are shared with collaborators like the other style planes, and persist as `[&Name]`
lines in the `:STYLE:` block. `width=auto` works for all six families (charts use the
intrinsic `800·scale` width; Python runs the script to measure).

### Python Blocks

Execute Python code during PDF generation to produce SVG or image output. The opener uses markdown image syntax with a `.py` filename, followed by optional input lines and a `~~~` terminator:

```
![Caption](script.py){scale=1 align=left width=30% wrap=image margin=4}
input data line 1
input data line 2
~~~
```

The opener accepts the same attribute set as the Image syntax (`scale`, `align`, `width`, `wrap`, `margin`, …) — see the **Images** section for details. The body lines are passed to the Python script as stdin; the script writes a PNG/SVG to stdout that is embedded in the document.

`width=auto` runs the script once to measure the produced figure (cached like the paint pass).

**Where the script may be, and who runs it.** The script must be a file in the document's folder
or below it; an absolute path or one that climbs out of the folder is refused. A script runs only
once the reader approves it (File ▸ Review Scripts...): until then the figure's place shows
"Script not run". The scripts that ship with the program's examples need no approval, and
running with `--allow-scripts` runs every script without asking. A script still running
after 10 s is stopped.

`qtdraw.getMetadata()` tells the script the page it is being drawn on: the measure and margins,
the body font and size, and `foregroundColor` / `backgroundColor` — the **ink and paper of the
section the figure sits in**, which is the box's `ink=` if it is in one, else the page fill's
`ink=` and that fill's color, else the style's own text color on white. A script that wants to
adapt should read the **contrast direction** (`lum(fg) > lum(bg)` means a dark ground) rather
than either color alone; `schem_bode.py` in the bundled guide examples is the worked example.

### Editing Existing Figures

The four Format ▸ "Insert" items — **Insert Image**, **Insert Python**, **Insert Circuit/Diagram**, **Insert Chart** — are context-sensitive on the cursor's block. When the cursor sits inside a figure block of any of these four types, the matching edit dialog opens (regardless of which insert item the user picked) with all fields pre-filled from the parsed source. The OK button reads "Update", and the source range is replaced on accept. **Insert Columns** does the same on a `COL|` line that opens columns.

Multi-block selections short-circuit detection and run the requested insert path instead.

**Where an insert lands.** Everything that owns its lines — a chart, diagram, circuit, python
block, embed, code block, quote, table, `COL|`, `COLBRK`, `PAGEBRK` — goes on the cursor's line
when that is empty, else on a new line under it. When the line belongs to a table, a fence or a
quote, it goes under the whole of that instead, so nothing splits one: under a table means under
its `CHART|` lines too, so **Insert Chart in a table puts the chart under it**. A break or `COL|`
with the cursor at the very start of the line goes above it instead, since it acts on what
follows. A new table is kept apart from a table next to it by a blank line. An image goes at the
cursor (inside a paragraph it is an anchored float), except in a table or a fence, where it
takes a line of its own under it. Footnotes, links and tags go at the cursor.

### Math Blocks

Mathematical notation blocks:

```
MATH|Title|Scale
math content...
+END
```

Terminated with `+END`.

### Footnotes

Footnotes use **markdown-style `[^name]`** markers, where `name` is alphanumeric (the pattern is `\[\^([A-Za-z0-9]+)\]:?`). A
definition line whose name has anything else in it (`[^my-note]:`) is not a footnote and gets a
document warning.

**Inline reference:**

```
This text has a footnote[^1] in it.
```

**Footnote definition (on its own line, marker followed by a colon):**

```
[^1]: This is the footnote text.
```

The org-style `[fn:name]` form is not recognized and renders as literal text.

A name defined twice keeps its last definition, in every mode and every export; the earlier one
is dropped, with a warning on the console.

Reference names are alphanumeric. The footnote mode (`%+FOOTNOTE_MODE:`) controls whether footnotes appear at the bottom of the page, end of section, end of document, or inline.

**A long footnote continues on the next page** (bottom-of-page mode). A note taller than half
the page body is cut at line boundaries into parts of at most that height. Its reference page
shows the first part, and each following page starts its footnote area with the next part, above
that page's own notes, until the note is done. A continued part carries no second number. Parts
still left after the last page of the document get pages of their own. A note that fits is
placed whole. In the HTML export a note is never cut, and in FODT LibreOffice
continues it by its own rules.

### Index Entries

Create entries for document indices:

```
[idx:IndexName:EntryName]
[idx:IndexName:EntryName_SubEntry]
```

- `IndexName` is the name of the index (e.g., "Key Concepts", "Terms")
- `EntryName` is the main entry
- `_SubEntry` (after underscore) creates a sub-entry

Indices are generated at the end of the document when `%+INDICES: 1` is set.

### Bible Verse References

Automatic Bible verse lookup and insertion. Recognized book abbreviations include standard short forms:

```
Gen 1:1
Joh 3:16
1Jo 4:12
Eph 1:18; 2:1-4, 7
Rev 5:1-5
```

- Supports ranges (`1:1-5`), multiple verses (`1:1, 3, 5`), and cross-references (`;`)
- The range separator may be an ASCII hyphen `-` or any Unicode dash (en `–`, em `—`, minus `−`, etc.) — all are parsed identically, so a smart-dash from autocorrect or the `%+DASH_ACTION` substitution won't break a range
- Version controlled by `%+VERSION:` (e.g., "esv", "nasb")
- `%+BIBLE_INDEX: 1` generates a Bible verse index
- Styled with `[Vs]` (verse text) and `[Rf]` (reference text) styles

---

## Summary of Block Types

| Syntax | Block Type | Terminator |
|--------|-----------|------------|
| `# ` ... `###### ` | Headings | Next heading or block |
| `> ` | Blockquote | Line not starting with `>` |
| ` ``` ` | Code block | Closing ` ``` ` |
| `\|` | Table row | Line not starting with `\|` |
| ` ```diagram ` | Diagram | Closing ` ``` ` |
| ` ```circuit ` | Circuit | Closing ` ``` ` |
| `CHART\|` | Chart | Single line (no terminator) |
| `!\[…](*.py)` | Python | `~~~` |
| `MATH\|` | Math | `+END` |
| `COL\|` | Column directive | Single line (no terminator) |
| `COLBRK` | Column break | Single line |
| `PAGEBRK` | Page break | Single line |
| `!\[` | Image or embed | Single line |
| `---` / `***` / `___` | Horizontal rule | Single line |
| `%` | Comment | Single line |
