# Design guide: how to hit a visual target with a `:STYLE:` block

`ordSyntax.md` is the **reference**: it will tell you exactly what block-style field 18 is. This is the
**decision guide**: it tells you *which mechanism to reach for*, and — the part that is easiest to get
wrong — **how that mechanism behaves when the content reflows.**

The one sentence, if you read nothing else:

> **A plate that must follow its content is a `fit=content` frame or a section box. A mark that must sit
> on a block is a style icon. An absolute region is for page furniture only.**

A design built from hand-placed regions has to be re-measured by hand every time the type changes. A
design built from those three mechanisms follows its text.

---

## 1. The model

A page is built in six layers. Deciding which layer a design element belongs to is most of the job.

| layer | what it is | moves when the text reflows? |
|---|---|---|
| **page** | trim size, margins, running heads, background fill | no |
| **frames** | `%+REGION` rects and `COL\|` columns — the containers content is poured into | only if you ask it to |
| **flow** | the sequence of blocks inside a frame | yes, by definition |
| **block** | one paragraph / heading / record group and the box it occupies | yes |
| **chrome** | the fill, border, bar, radius, shape and bleed that block paints | yes — it *is* the block's box |
| **decoration** | style icons, rails, meters, drop caps — marks on or beside a block | yes, if you anchor them to the block |

### The one test

Before you place anything, ask: **if the text above this grew by one line, where should this thing be?**

- *"One line lower"* → it belongs to the **flow**: a block, its chrome, or a style icon anchored to it.
- *"Exactly where it is"* → it belongs to the **page**: a region at an absolute `x/y`.

There is no third answer, and picking the wrong one is the single failure this whole document exists to
prevent. A full-bleed wash, a hero photograph, a corner ornament, an edge rail: those are page furniture
and a region is exactly right for them. A rule under a title, a dot on a rail, a band on a table row, a
triangle hanging off a tab: those are content-anchored, and an absolute region will be wrong the moment
anyone changes a font size.

---

## 2. A starter

Everything later in this guide is a change to a block like this one. It sets the page, three fonts,
three colors, the body, two heading levels and one boxed paragraph, and it renders as one clean page.
The gaps inside the rows are **single TAB characters** — copy them as tabs.

```
:STYLE:
%+TITLE: Field Notes
%+PAGE_WIDTH: 612
%+PAGE_HEIGHT: 792
%+LMAR: 72
%+RMAR: 72
%+TMAR: 72
%+BMAR: 72
%+SPACING_COLLAPSE: 1
%+HEADER_SPACE: 0
%+HEADER_SPACE2: 0
%+HEADER_LINE_THICKNESS: 0
%+FOOTER_LINE_THICKNESS: 0
%+FOOTER_FONT: Sans
%+FOOTER_FONT_SIZE: 9
%+FOOTER_TEXT1: 		@@
%+NUMERAL_STYLES:
%+NUMERAL_STYLES_SG:
%+TOC_NUMERAL_STYLES:
%+TOC_NUMERAL_STYLES_SG:
%+FONT_ALIAS: Ser	EB Garamond
%+FONT_ALIAS: Sans	Noto Sans
%+FONT_ALIAS: SansSb	Noto Sans SemiBold
%+VAR: ink #1E2328
%+VAR: accent #1D5C8C
%+VAR: panel #EEF3F8
[def]		Ser	11	0	0	0	0	0	0	0	Left	0	0	$ink
[Bd]		Ser	11.5	0	0	0	0	8	140	Proportional	Left	0	0	$ink	0	0	0		0
[#1_Ti]	Heading 1	SansSb	22	0	0	0	0	12	115	Proportional	Left	0	0	$accent	0	0	0		0
[#2_Ti]	Heading 2	SansSb	13	0	0	0	16	6	120	Proportional	Left	0	0	$ink	0	0	0		0
[Note]	Note	Ser	11.5	0	0	0	6	12	140	Proportional	Left	0	0	$ink	0	0	0		0
[>Note]	12	12	9	9	$panel	0	0	4	3	$accent	0	10	0
:END:
# Field Notes

The first paragraph sits under the title at the body size. Every line of text is its own paragraph, and the space between paragraphs comes from the style, not from blank lines.

## What the style block sets

The page is US Letter with one-inch margins. The body is EB Garamond at 11.5 points on a 140% line, the headings are Noto Sans SemiBold, and the colors are three variables, so changing a palette is three edits.

[Note] A paragraph written with a style name in front of it takes that style. This one has a matching box style, so it sits on a tinted panel with an accent bar.

## What to change first

The fonts in the alias lines, the three colors, and the margins. Everything else follows from them.
```

What each choice is doing:

- **A text row is `[key]`, TAB, a Name, TAB, then the fields** (§5.1). The Name may be empty, but its
  tab may not: `[Bd]<TAB><TAB>Ser…` is an unnamed row. Block rows (`[>Note]`) and the table, chart and
  figure rows have **no** Name column.
- **Heading looks go on `[#1_Ti]` and `[#2_Ti]`**, the heading's own title role. A bare `[#1]` styles
  the whole section, body included (§17.1).
- **`[Bd]` is defined in full**, so body text never picks up a heading's size, caps or tracking.
- **Both numeral lists are cleared.** Headings carry outline numerals by default, and clearing only
  `%+NUMERAL_STYLES:` leaves an only-child heading indented by a stray tab.
- **No running head, so no header space.** `%+HEADER_SPACE` and `%+HEADER_SPACE2` sit *inside* the top
  margin; at their defaults the text starts 17 pt below `%+TMAR`.
- **Colors are `$tokens`** so a second style can re-skin the document by redeclaring three lines (§6).
- **The fonts ship with the program**, so the page renders the same on every machine (§5.2).
- **`[Note]` plus `[>Note]`** is a single-block box: the text row and the box row share a name (§8).

Notes about the file belong **below** `:END:` (a line starting `%` is a comment). A `%` line *above*
`:STYLE:` makes the whole style block read as body text.

---

## 3. The decision table

Read this the way you would read a lookup table. The **never** column is not a style preference; each
entry is a mechanism that breaks as soon as the text reflows.

| I want… | mechanism | never |
|---|---|---|
| a panel behind a section | heading section box `[>#N_Ti]`, or a `fit=content` frame with `style=` | a second fixed region behind a content frame |
| a panel behind a column | `COL\|` `bg=` / `border=` / `pad=` / `bleed` / `extent=full` | a region the size of the column |
| a panel behind one block | a single-block box: define `[card]` **and** `[>card]`, apply `[card]` | a region at the block's `y` |
| a rule under a title | Opts **256** (this block only) + border bit **64** (bottom), with Box Width (14) + H-Align (15) | a `place=xy` rect at the title's `y` |
| a mark on / beside a block | a **style icon** (field 18) — `pos=`, `size=`, `box=`, `line=` | a `place=xy` rect at the block's `y` |
| a picture beside a paragraph | write `![](art.svg)` **inside** the paragraph: the marker's line finishes, then the picture takes the margin and the text flows beside it | a figure on its own line above it, then hand-tuning the wrap |
| a CHART / diagram / quote beside a paragraph | name it (`[Adoption] CHART\|…`, `>Pull> …`) and put `@float:Adoption` in the paragraph beside it | duplicating the figure into a region, or a two-column `COL\|` for one paragraph |
| a mark inside a SENTENCE | `![](mark.svg){aschar}` — a picture that IS a character, written where it belongs | a style icon (it stamps every block using the style, not one word) |
| **two** marks on one block | one style icon field, two specs separated by `;` | a second style, or two regions |
| a mark per record | presentation `slots=icon` + row styles `/a`…`/n` | one region per record |
| a connector down a list | Bar Style (19) `timeline:` / `rungs:` / `chevron:` + `bars=divider` | a rule region plus per-record dots |
| a bar / dots / stars for a number | a **512** data-meter column + `meter=` shape + `meternumber=off` | a hand-drawn SVG, or a transparent 2 pt number |
| a band on ONE cell of a table | the cell style `[>Spec/b/2]` | a rectangle over the table row |
| a graphic nudged off its flow position | slot-19 `offset=dx,dy` + `z=` | a region |
| a rotated section label | `region=<frame> route=head` on the heading + the frame's `rotate=270` | a region carrying `text=$var` |
| a heading that scopes but doesn't print | effect bit **8192** Structural | `size=1` + `#00000000` |
| a frame pinned to a block | `anchor=block:`/`after:`/`before:<style>` + `align=` | measuring the block's `y` by eye |
| a plate that starts where its content starts | `place=xy` + `anchor=flow` | a hand-measured `y=` |
| the first paragraph of every section to look different | a positional selector `[#2_Bd.first]` (§7) | an attach typed on each paragraph |
| a dark edition of the same document | a second `:STYLE:` that redeclares only `%+VAR:` lines (§6) | a copy of the file |
| page furniture with no content | **a region — correct, use it** | — |

---

## 4. The page

The page layer is a handful of `%+` lines. Everything on it ignores the flow, which is what you want
from it and why nothing content-anchored belongs here.

**Size and margins.** `%+PAGE_WIDTH` / `%+PAGE_HEIGHT` and `%+LMAR` / `%+RMAR` / `%+TMAR` / `%+BMAR`, in
points (72 to the inch; Letter is 612 × 792, A4 595 × 842). `%+UNITS:` only changes what Settings
displays — the file stays in points. `%+ODD_EVEN: 1` mirrors left and right margins for a bound book.
The running head and the folio live *inside* the margins: `%+HEADER_SPACE2` (the head itself) and
`%+HEADER_SPACE` (the gap under it) push the text down from `%+TMAR`, and `%+FOOTER_SPACE` lifts it off
`%+BMAR`. Set them to 0 when the design has no head or folio.

**A title page.** `%+TITLEPAGE: 1` prints a separate first page from `%+TITLE:`, `%+AUTHOR:`, the date
and two free lines (`%+OTHER_TEXT:`, `%+OTHER2_TEXT:`), each with its own `_FONT`, `_FONT_SIZE` and
`_POS` — the line's distance below the top margin, centered across the measure. It takes the first
background set (below). That is a typed cover, not a designed one: for a cover with a photograph, panels
or type on a grid, leave `%+TITLEPAGE` off and build page one from the body with regions (§13).

**Running heads and folios.** `%+HEADER_TEXTn:` and `%+FOOTER_TEXTn:` are three TAB-separated cells —
left, center, right. In them, `@@` is the page number, `@A`…`@Z` the title of the level-1…26 heading in
force on the page, `@a`…`@z` its numeral, formatted by `%+HEADER_NUMERAL_STYLES:` (so the head can number in a
different form from the heading itself), and `$TITLE` or any variable expands. A logo goes at the
start of a cell as `[logo.svg]`. The rule under the head and over the foot is
`%+HEADER_LINE_THICKNESS` / `%+FOOTER_LINE_THICKNESS` — 1.5 pt by default, `0` to remove it.

**Switching the page per section.** Headers, footers, page backgrounds and region sets are all numbered
`n`, and one counter picks the set: the **Next Header** effect (bit **256**, text-style field 11). Pages
before the first block carrying the bit use set 1; the page that holds it switches to set 2, the next
one to set 3, and a counter past the end of a list keeps the last set that list declared. Put the bit
on the heading that opens each part, with New Page `1`, so each part starts on its own page:

```
%+HEADER_TEXT1: FRONT
%+FOOTER_TEXT1: 	@@
%+HEADER_TEXT2: Part @a · @A		@B
%+FOOTER_TEXT2: 		@@
%+HEADER_NUMERAL_STYLES: I	1
%+BACKGROUND_IMAGE1: #F4EFE6
%+BACKGROUND_IMAGE2: #FFFFFF
%+BACKGROUND_IMAGE3: grad(linear,90,#1B2A3A,#2E4A66)|ink=#FFFFFF
[#1_Ti]	Part	SansSb	20	0	0	0	0	14	115	Proportional	Left	1	256		0	0	0		0
```

Here the title page and the preface sit on cream (set 1), part one is white (set 2), and part two is a
dark gradient (set 3) that keeps set 2's heads, since set 3 declares none. `%+BACKGROUND_IMAGEn` takes a
full fill spec — a color, `grad(…)`, `img:photo.jpg,cover`, `svg:…` — and bleeds to the trim. Its
`|ink=` reverses only text whose color is inherited from `[def]`; a style with a color of its own keeps
it. A dark section is therefore easiest when every color is a `$token` (§6).

The contents, lists and index pages pick a set of their own with `%+TOC_HEADER_SET:` (and
`LISTS_` / `INDEX_`): `Default`, `None` or `Set_N`.

---

## 5. Type and space

### 5.1 The text-style row

`[key]`, TAB, the Name (display only; may be empty, its tab may not), TAB, then fields 0–20:

0 font (alias or family), 1 size, 2 first-line indent, 3 left margin, 4 right margin, 5 space before,
6 space after, 7 line height, 8 height type, 9 align, 10 New Page, 11 effects bitfield, 12 color,
13 verse mode, 14 caps, 15 slide siblings, 16 Columns spec, 17 letter spacing, 18 **style icon** (§9),
19 **presentation spec** (§12), 20 **sequence** (§7).

A **blank** field inherits; `0` is a value. Body roles reduce `#N_Bd → Bd → #N → … → #1 → def` and
heading titles `#N_Ti → Ti → #N → … → def`, so `[Ti]` styles every heading, `[#2_Ti]` one level,
`[#2]` the whole level-2 section. Margins (3, 4) move a block's **box**, not just its text (§8).

### 5.2 Fonts

Name fonts through aliases, so a face changes in one line:

```
%+FONT_ALIAS: Ser	EB Garamond
%+FONT_ALIAS: SerIt	EB Garamond<italic>
%+FONT_ALIAS: SansSb	Noto Sans SemiBold
%+FONT_ALIAS: Mono	Monaspace Neon
```

`<bold>` and `<italic>` pick a face *within* a family. A weight written as a family name works only when
a family of that exact name is installed — the program ships `Noto Sans SemiBold`, `Medium`, `Light`,
`Black` and `Condensed` that way — and anything else falls back to the regular face **silently**.
Verify a weight with `pdffonts` on the PDF, not by eye.

The bundled faces render identically everywhere: **EB Garamond**, **Bodoni Moda** and **Bodoni Moda
Display**, **Noto Sans** with the named weights above, and the **Monaspace** family (Argon, Krypton,
Neon, Radon, Xenon). A system font works too, and renders differently on a machine that lacks it.

### 5.3 Line height, case and tracking

- **Line height** is field 7 read through the height type in field 8. Use `Proportional` (140 = 1.4
  lines); `Fixed` is points — `Fixed` 100 is a 100 pt line. Line height **inherits**: change `[def]`'s
  and every style that sets a size but no line height follows (§17.1).
- **Case is a style decision.** Caps (14) — `Upper`, `Lower`, `Small_Caps`, `Title_Case`,
  `First_Letter`… — leaves the text as typed, so a kicker can be capitals in one design and not in the
  next.
- **Letter spacing** (17) is points: loosen capitals and small type (1–2 pt on a 9 pt kicker), tighten
  display type.
- **Align** (9) explicitly on display styles; they otherwise inherit `[def]`'s.
- **`%+FONT_SCALE:`** multiplies every size in one style — a large-print edition or a slide deck (§15)
  without touching a row.

### 5.4 Character styles

`{=term=design variable}` sets a run in the text style `[term]`: its font, size, color, weight, caps and
letter spacing. Reach for it whenever the run has a **role** — a term, a product name, code, a symbol
from another font — so one row restyles every instance. `**` and `*` are for plain emphasis. A run
cannot cross a paragraph break.

```
[term]	Term	SerIt												$accent
[code]	Code	Mono	9.5
```

### 5.5 Vertical space

- **Space before / after** (fields 5, 6) take lengths: `12`, `4mm`, or font-relative `1em`, `line`,
  `cap`. A font-relative gap keeps its proportion when the type size changes; prefer it on headings.
- **`%+SPACING_COLLAPSE: 1`** makes the gap between two blocks the *larger* of the upper one's space
  after and the lower one's space before. The default adds them. Collapse gives an even rhythm and lets
  each style say what it needs without counting on its neighbor.
- **Blank lines add nothing.** `SPACE|N` on a line of its own is a deliberate N-point gap — right for a
  one-off. A gap that recurs belongs on a style. (Under a `reserve=1` frame it is absorbed, §17.4.)
- **Keeping things together:** effect bit **128** Keep With Next on a heading or label style glues it to
  the block below; New Page `9` forbids a break *before* a block; `%+MIN_PARAGRAPHS` (blocks after a
  heading before a break may fall), `%+MIN_LINES_TOP` / `%+MIN_LINES_BOT` (widows and orphans) and
  `%+KEEP_TOGETHER: Bullets|Outlines|Both` are document-wide.
- The air between stacked presentation fields is the cell's own Top/Bottom (§12.1); the air above a
  whole column region is `spacebefore=` (§13.8).

---

## 6. Palettes and variants

### 6.1 Tokens

`%+VAR: accent #1D5C8C` defines a value once; `$accent` uses it anywhere a color, a length, an icon
source or body text is read — style rows, fills, column `bg=`, chart palettes, `ink=`. A style that
uses **literal hex does not respond** to a redeclared variable, so put every color that might change
behind a token. A photograph can follow the palette too: `img:photo.jpg,cover,duo:$accent` duotones it
in the current accent. An SVG's colors are baked into the file (§17.6).

### 6.2 One document, several looks

A second style block inherits everything from the first that it does not override (§6.3), so a variant
is usually a few lines:

```
:STYLE2:
%+VAR: ink #E8E4DC
%+VAR: accent #E0A85A
%+BACKGROUND_IMAGE1: #20242B
:END:
```

That is a complete dark edition of a document whose rows all say `$ink` and `$accent`. Render it with
`ordstyle --pdf doc.ord STYLE2` (output `doc.STYLE2.pdf`), or pick it in the editor's style selector.
Variables resolve in the active style first and then in the first one, so the variant inherits every
token it does not name. A variant can also change the page (size, margins, `%+SLIDE_MODE`) — the same
text as a deck is one more variant (§15).

Two rules to know:

- **A redeclared row replaces the inherited one wholesale.** Copy the full base line and change the
  field; a row with only the changed field leaves the rest blank, which means *inherit from the role
  cascade*, not *keep the base's value*.
- **A redeclared `%+REGION` set replaces the inherited set wholesale** (§13.2).

### 6.3 Second and later `:STYLE:` blocks

A style other than the first **inherits** every row the style it follows declares and it does not
override — by default the first style, or whichever one `%+INHERIT:` names (see `ordSyntax.md`).
That is what lets one document ship several designs from one body of text, and it is also the
thing that surprises people: a row you never wrote is still live in your variant, and a selector
you never wrote can resolve through it.

Three moves, all in `ordSyntax.md`:

- **`%+INHERIT: STYLE2`** as the first line of the block — follow a different style, to any depth.
  Useful for three terminal variants over a shared terminal base rather than three siblings that
  each restate the base.
- **`%+INHERIT: none`** — this style follows *nothing*: a root, exactly like the first style, with
  the program defaults underneath it instead of another design's. Reach for it when a variant has
  nothing in common with the first style and the inherited rows are all noise; reach for
  `%+INHERIT:` instead whenever the two designs should stay in step.
- **`[key]<TAB>none`** — this style does not have that row at all. The one way to answer "where is
  this serif coming from in my sans design?" when the answer is a row you did not write. The
  Settings dialog shows it struck through, so it stays visible and reversible.

---

## 7. Selectors

Three ways to give a block a style, and the question that picks one is **why this block looks
different**:

- **Because of what it is** — a note, a pull quote, a sign-off → an attach: `[Note] text`.
- **Because of where it is** — the first paragraph after a heading, every other row, the last block of
  a column region → a **positional selector**. Nothing is written in the body.
- **Because of what came before it** — the kicker, title and standfirst that open a section → a
  **sequence** (field 20).

### 7.1 Positional selectors

`<role>.<spec>[@<scope>]`, as a row key: `.first`, `.last`, `.3`, `.1-2`, `.3-`, `./2` (every second),
`.odd` / `.even`, `.last-1`, `.only`. Ordinals count blocks of the same role; body selectors reset per
section and heading selectors per parent section, unless `@sec`, `@parent` or `@doc` says otherwise.

```
[#2_Bd.first]     the first body paragraph of each level-2 section
[Bd.7@doc]        the seventh body paragraph in the document
[#6_Ti.2@doc]     the second level-6 heading — can carry its own region= route
[|Tb.odd]         alternating table looks
[&Im.odd]         alternating float sides for images
```

A selector row sets only the fields it fills and inherits the rest from the role, and it **beats an
attach** on the fields it sets — the attach still decides the role, and so which selectors can match.
It carries break behavior too (Keep With Next, Column Break, End Columns), which is how a region's last
block ends the region (§13.8). Figure, table and quote selectors count forward only: `.last`, `.last-K`
and `.only` never match there.

### 7.2 Drop caps, first words, first lines

A pseudo-element after the selector styles *part* of the block: `:letter(N)` a drop cap sunk N lines
(bare `:letter` a raised initial), `:word(N)` the first N words, `:line(N)` the first N typeset lines.
Gate it with a selector, or every paragraph gets one:

```
[#2_Bd.first:letter(3)]		SansSb												$accent
[#2_Bd.first:line]																Small_Caps
```

Those two rows give each section's opening paragraph a three-line accent-colored cap and a small-caps
first line. Parts layer `:line` ⊃ `:word` ⊃ `:letter`, an inner part inheriting from the one around it;
caps and tracking have no "off" value, so an inner part cannot switch them back off — put the device on
the inner part and leave the outer plain.

### 7.3 Sequences

Field 20 on a style says how the blocks *after* it continue: `Kicker,Title,Sub?,Lead` on `[#1]` styles
a section's opening paragraphs in that order (`?` optional, `(X,Y)*` a repeating tail). Plain body
paragraphs consume steps; figures, tables and bullets do not. The ladder is **attach > selector >
sequence > role**. In slide mode a sequence paints but does not group (§15).

---

## 8. Chrome — the box a block paints

Chrome is declared on the **block plane**: `[>Name]` for a style named `Name`. A style's text lives in
the Styles table and its box in the Block Styles table, and the two cascade independently — which is why
a row authored as a block-only fill leaves the per-column text alone.

**What a block style carries** (indices as `getBlockStyleVal(style, N)`): pads 0–3 (left/right/top/bottom),
4 fill spec, 5 border color, 6 border width, 7 corner radius (a single value or `tl,tr,br,bl`), 8 left-bar
width, 9 bar color, 10 line-number color, 11 space-after-bar, 12 Opts bitfield, 13 bar length %, 14 box
width, 15 h-align, 16 v-align, 17 **Shape**, 18 **Bleed**, 19 **Bar Style**.

**Three kinds of box, from the same fields:**

- **Single-block box** — define both `[card]` (text) and `[>card]` (box), then write `[card]Your text`.
  The box hugs that one block. Its padding is reserved *inside* the block's own space, so the box clears
  its neighbors by the ordinary inter-block gap.
- **Heading section box** — `[>#N_Ti]` paints across the heading's **whole outline subtree**, nests with
  deeper levels, and takes a full fill spec. Opts **256** narrows it to the heading line alone (the
  "accent band"); 256 + border bit 64 is the rule under a heading.
- **Column decoration** — `COL|N|…|bg=…|border=…|pad=…|bleed|extent=full` paints per column, one fill
  spec per column in a comma list.

**Fill specs** are one vocabulary everywhere: `#RRGGBB` / `#AARRGGBB`, `$token`, `grad(linear,90,#a,#b)`,
`img:file.jpg,cover`, `svg:file.svg`, plus `|ink=#fff` to reverse the text color on top of it.

**Shape (17)** gives a shaped edge — `skew`, `slant`, `chevron`, `arrow`, `corner-cut`. **Bleed (18)**
overhangs the chrome per edge toward the page trim (`:trim`), the content band (`:frame`) or a fixed
distance (`:<N>`). The overhanging-ribbon tab is Bleed's documented example, and it works inside routed
content — the ribbon device for a sidebar heading.

**Inside a region frame**, all of this still paints: a routed block's section box and its style icons
draw in the frame's own space, under the frame's rotation and clip, one band per page slice. You do not
need a stand-in group or a transparent heading to fake a band on a routed heading.

> **Chrome-only `[>X]` styles need an explicit `#00000000` background.** An empty fill inherits
> `[>def]`'s `#EEEEEE` gray. This bites accent rules, bar-only pull quotes and every "just a border"
> box. A `#AARRGGBB` with `00` alpha is transparent; `#00000000` is the canonical "none".

---

## 9. Decoration — the icon system

Field **18** of a text style is the style's decoration. Every block using the style gets it, positioned
by the spec, with no mark in the body text at all.

```
<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
```

**Source** — `char:★` (or `char:U+25B6`), an `.svg`, a raster file, or `$icon.<name>` resolving through
the design-variable palette, so a brand registers its glyphs once.

### 9.1 Several icons on one style

A top-level **`;`** separates whole specs; `|` separates the options inside one. A block that wants a cap
on its top edge and another on its bottom is one style, not two:

```
char:●|pos=edge.tc|size=8|tint=$navy ; char:●|pos=edge.bc|size=8|tint=$rust
```

They paint in the order written. Only the **first** `stack` spec reserves a line.

### 9.2 Size — an icon is not necessarily square

`size=` takes one value (square) or **`<W>x<H>`**. Each axis is a literal point number or a keyword
resolved against the style's own font metrics: `cap`/`auto` = cap height, `x` = x-height, `line` = line
height, `<n>em`. `width=` / `height=` are the same thing spelled apart.

The source is **aspect-fitted** into the box, so a rule SVG drawn 200 × 4 in a `size=200x4` box comes out
exactly its own size. **`fit=fill`** (alias `stretch`) scales it to the box on both axes instead — which is
what lets one plain rectangle glyph serve as a rule of any width: `char:▬|size=72x6|fit=fill` is a 72 × 6 pt
bar with no bespoke asset. Without `fit=fill` a glyph fits the smaller axis.

> This is the difference between a rule that is a style icon and a rule that is a hand-placed rectangle.
> Give the same 200 × 4 rule a single `size=14` and it is fitted into a 14 × 14 square: 14 pt wide and
> 0.28 pt tall.

### 9.3 Placement — three orthogonal axes over a nine-point grid

The grid is `tl tc tr / ml mc mr / bl bc br`. Three keys then say what "at that point" means.

**(a) How it meets the edge** — the `pos=` prefix:

| `pos=` | the icon is… | `gap` means |
|---|---|---|
| `inside.<vh>` (or the original `box.<vh>`) | wholly inside the box | inset inward |
| `edge.<vh>` | centered **on** the boundary, half in / half out | shift along the outward normal |
| `outside.<vh>` | wholly beyond the boundary | push further out |

A center letter (`c` / `m`) has no boundary on that axis, so the relationship is inert there:
`edge.tc` straddles the top border and stays horizontally centered. `outside.br` is the hanging corner
ornament — the fold triangle off a tab.

**(b) Which rectangle** — `box=`:

| value | rect |
|---|---|
| `chrome` (default) | the box the block **paints** — section/single-block band, padding and `Bleed` included. A block that paints no box falls back to its own **band**: the placement width with the space-before/after taken off |
| `content` | inside the padding, level with the text and inside the style's left/right margins |
| `spaced` | the block's outer box, space-before/after 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 the whole section band: reach for
> `box=content` to anchor on the heading line instead.

**(c) Which line** — `line=`:

`line=box` (the default for grid placements), `line=first`, `line=last`. The last two 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` frame
centers on the first line and defaults to `line=first`.

**(d) The nudge** — `offset=<dx>,<dy>` (also `dx=` / `dy=`) shifts the icon in points after everything
else. It is for **optical correction** — a glyph whose ink is not centered in its em box, a deliberately
asymmetric hang. Anything structural belongs in (a)–(c), which survive a change of type size. A nudge
does not.

### 9.4 The other frames

- `pos=margin.<side>` — a page-gutter wayfinder just outside the block, level with its first line.
  `mirror` flips the side on verso pages so an `outer` marker rides the true outer edge in a book.
- `pos=stack.<above|below>` — its own reserved line, consuming real vertical space. `align=` registers it.
- `pos=inline.<before|after>` — a `char:` glyph flowing **in** the text run, on the baseline, wrapping
  with the line.
- `pos=watermark` — centered, behind, faint (an alias for `box.mc` + `behind` + `ghost`).
- `pos=field` — not stamped on the block at all: placed by a presentation layout's `slots=icon`.

### 9.5 Scope

Heading icons are **heading-scoped**: an icon on `#N` or `#N_Ti` stamps the heading block only and does
not cascade into the section's body/bullet/card roles. Icons on an ordinary *role* (`Bd`) cascade
normally; set field 18 to `0` to suppress an inherited one.

> **`pos=box.tl` on a presentation ROW style does not paint.** For a per-record mark use `slots=icon`
> with `pos=field`; for a node on a rail use Bar Style `timeline:`.

---

## 10. Ready-made pieces: callouts, rules, tables

None of these is seeded into a new document — each is a row or two you paste — but each needs no design
work to look right.

**Callouts.** `>note> text` is a blockquote styled by `[>note]`; `>warning>Heads up> text` adds a title,
which prints under the box as its caption (`[Cp]`). The four conventional names, ready to paste:

```
[>note]	14	14	10	10	#EAF2FB	#000000	0	6	4	#2D7DD2	#000000	8	0
[>warning]	14	14	10	10	#FFF4E5	#000000	0	6	4	#E8870C	#000000	8	0
[>tip]	14	14	10	10	#EAF7EE	#000000	0	6	4	#2E9E5B	#000000	8	0
[>card]	16	16	14	14	#F5F5F7	#E2E2E6	1	8	0	#808080	#000000	6	0
```

The gap between two consecutive callouts is the space before / after of a `[Qt]` text row. A blockquote
box ignores Shape, Bleed, Bar Style and per-corner radius: when a callout needs any of those, make it a
single-block box (`[Callout]` + `[>Callout]`, §8) instead.

**Ornamental rules.** `---`, `***` and `___` on a line of their own are three independent rules, each
styled by its own line: `%+HR_DASH:`, `%+HR_ASTERISK:`, `%+HR_UNDERSCORE:`. A value is either
`thickness,width%,color` (`0.75,40,$accent` — a short centered hairline) or `file.svg,height` (an
ornament centered at that height). Give the three different jobs — a section break, a scene break, a
flourish — and the body chooses by typing the rune.

**Tables.** One `[|Tb]` row styles every pipe table. Its Opts (field 19) is a bitfield: `1` repeat the
header row on every page, `2` keep the table whole, `4` zebra rows, `8` bold header; field 18 fills the
header row. Three border sets — full grid, header rule only, horizontal lines — are ready to paste in
`ordSyntax.md` under "Table-border idioms"; this is the header-rule set with a bold header:

```
[|Tb]	Left	#EEEEEE	#FFFFFF	3	3	4.5	4.5	0	0	0	0	0.75	#BBBBBB	#BBBBBB	#BBBBBB	#BBBBBB	$ink	0		8
```

Vary tables by position with selectors (`[|Tb.1@sec]`, `[|Tb.odd]`). When a "table" is really a grid of
cards, a spec sheet or a timeline, it is a presentation (§12), not a pipe table.

---

## 11. Figures

**One image grammar.** The `{…}` after `![caption](file)` sizes and treats images, SVG and Python
figures; diagrams and circuits take the same keys in their fence's braces, charts through their
positional fields. The keys that matter most:

| want | keys |
|---|---|
| a size | `width=40%` (of the column) or `width=180pt`; `height=` for the other axis |
| a crop to a box | `width=` **and** `height=` — the pair crops to fill (`fit=cover` is the default there); `focus=50/20` chooses what the crop keeps |
| a frame | `border=1:$rule`, `radius=8`, `shadow=3` |
| a tone or a cut-out | `gray`, `duo=$accent`; `mask=shape.svg` (the SVG's alpha becomes the picture's) |
| a float | `align=right width=35% wrap=image` (or `wrap=column` for a sidebar) |
| full bleed | `bleed` |

**Per figure or per kind.** Braces are for one figure. For a class of figures use a **figure style**:
`[&def]` for all of them, `[&Im]` / `[&Ct]` / `[&Di]` for one kind, or a named `[&Hero]` that a figure
opts into with a prefix — `[Hero]![…](photo.jpg)`. That one prefix resolves three planes at once:
`[&Hero]` geometry, `[>Hero]` box chrome and the `Hero_Cp` caption. Cells inherit per field and braces
win per key. The figure style's Radius rounds the *image*; a `[>Hero]` box's radius rounds the *card*
around image and caption — they compose.

**Captions.** A figure's caption is its alt text, styled by `[Cp]` (or `<kind>_Cp`). A pipe table has no
caption slot: write `TBLCAP| text` on the line directly above or below it. Numbered captions ("Table 1:",
"Figure 3") come with `%+LIST_TABLES: 1` / `%+LIST_FIGURES: 1` — which also print the list itself — and
`{#label}` on the caption lets the body say `@tbl:label` / `@fig:label`.

**Charts.** `CHART|Title|ratio|scale` draws the pipe table above it; series types are tags in the
header row (`[Bar]`, `[Line]`, `[Area]`, `[Donut]`…, with `[BarCategories]` or `[X]` on the label
column). A chart style row `[~def]` sets palette, fonts, grid and legend for every chart, and
`{…}` options override per chart. Give the palette as tokens (`$accent,$rule`), or define `$chart1`…
`$chart12`, which the default palette reads, and the charts re-skin with the variant.

Placing a figure *beside* a paragraph is a decision-table question (§3): an inline marker for a picture
written in the sentence, `@float:Name` for a named figure, `wrap=` for a figure on its own line.

---

## 12. Presentation layouts

A presentation style turns the lines under it into **records**, split into `|`-separated **fields**.
Field 19 of the text style carries the spec. The group ends at a **blank line** — always leave one, or
the next paragraph becomes a record.

### 12.1 The cell family

| level | style | what it carries |
|---|---|---|
| group | `[Spec]` | the box around the whole group; the layout spec |
| row (record) | `[Spec/a]`, `/b`, … | per-record box / fill / icon / name — **letters** |
| column (field) | `[Spec/1]`, `/2`, … | per-field text + box — **digits**, 1-indexed |
| cell | `[Spec/b/2]` | **one** cell — row letter, then column number |
| panels | `[Spec/num]`, `/icon`, `/name` | the injected ordinal / icon / name slots |

Both planes exist for every level: `[Spec/b/2]` is text, `[>Spec/b/2]` is chrome.

**The cascade** resolves **cell → record → field → group**, first defined wins, and a defined row
blankets its whole record. **One cell beats both** the row and the column — and it is honored even under
a row that paints its own box, which is the case the row/column pair could never express. "Band columns
2–5 of row d" is four cell styles, not a rectangle over the table.

**Overflow** decides what an *undefined* position does: `clamp` (default — only what you name is styled),
`cycle` (zebra), `repeat` (hold the last). Row overflow reaches the cell keys too: a `cycle` row letter
addresses every *n*th record.

**Uneven air between stacked fields** is the cell's own Top/Bottom, not `fieldgap=` (one number for the
whole record). In an `arrange=stack` record the gap between two fields is `fieldgap` + the upper field's
**Bottom** + the lower field's **Top**. It is *between* fields only — the first field's Top and the last
field's Bottom belong to the box padding — and it does **not** cascade: put the value on the cell, not
the group, whose Top/Bottom is the block's own margin. Reach for this instead of bending a cell's line
height, which changes the space *inside* the text to buy space *around* it.

**A rule that separates two lines of records** is a bottom border on the record chrome, and it only
reads as one unbroken rule while the tiles on the line **touch** — any `gap` opens a hole in the middle
of it. That is what `colgap=`/`rowgap=` are for: `gap=0 rowgap=N` keeps the tiles edge to edge across
the line and still gives the rule its air below. Don't try to lift such a rule by moving points from the
box's bottom padding to its top — the box's bottom edge is where the border draws, so the text moves and
the rule stays put.

> A **text** row style blankets the whole record and will override a per-column style — including a
> hidden-number column, so a meter value then prints as text. If you need per-column text under a styled
> row, put it on the cell (`[Spec/b/2]`), not the column.
>
> A row that sets **only** an Icon (or a spec/chain) and no text field does **not** blanket — the
> column styles stay in charge, and the row's icon stamps on the record's tile. That is the
> stacked-record recipe: `fields=N` + `arrange=stack` for the lines, `[Spec/1…N]` for their looks,
> and `[Spec/a]` carrying `char:●|pos=margin.left` for the bullet (with `rowoverflow=repeat` so
> every record gets one). An **all-empty** row entry still blankets.

> **A label beside a stack is two records.** Arrangements are flat — a field cannot itself be a
> stack — so a dated entry (date on the left, several styled lines on the right) is a narrow
> LABEL record plus a wide ENTRY record paired by `next=right cols=2`. Give them their different
> widths with `splits=/stack/28.7%;/stack/` (blank direction: the list supplies widths only and
> leaves `cols=` to do the wrapping), alternate their looks with `rowoverflow=cycle`, and hang
> the timeline on the entry row's bar (`bars=divider` + a `timeline` Bar Style) so the rail runs
> between the two with the dates on its far side.

### 12.2 Meters

A **column** block style with Opts **512** renders its field's leading number as a micro-graphic:
thickness = Left Bar, primary color = Bar, secondary = Line color, track = primary at 18 % unless
`metertrack[N]=` names one. Shapes come from `meter=<shape>` (group) or `meterN=<shape>` (per 1-based
column): `bar` `ring` `gauge` `dots` `pictogram` `battery` `waffle` `stars` `traffic` `arrow`, the
`-partial` variants, and the value+reference forms `bullet` `slider` `range` `dumbbell` `diverging`.

**`meternumber[N]=off` renders the shape alone.** The cell's text line is not composed at all and the
glyph drops the 3 pt lead-in it leaves for a number above it, so the cell's inner height **is** the
glyph and `valign=center` centers the *ink* on its label.

> **Do not hide the number with a transparent 2 pt style.** That still composes a line box, so the shape
> lands `(lineBox + 3 pt) / 2` below the row center; the only repair is a fudge pad on the *label*
> column, which grows the row and re-centers the meter downward again, so only about half the correction
> lands. Any change to the body type then breaks it. `meternumber=off` is exact and stays exact.
>
> Without the hidden line the rows sit tighter. Set their rhythm with the group's `gap=` — an honest
> knob that says what it means.

### 12.3 Rails

Block-style field **19** (`timeline:` / `rungs:` / `chevron:`) plus `bars=divider` draws a rail that runs
**mark to mark**, with a node at the vertical center of each entry's first text line. It works on
presentation groups, rows, columns and region-routed runs. This is the connector down a list — not a rule
region plus per-record dots, which is a hand-built version of the same thing that cannot stay aligned
because nothing ties the two together. Rails do not bridge across styles: a list whose entries use three
different styles becomes two or three rails.

### 12.4 Layout keys worth knowing

`flow=pack|table` · `arrange=stack|row|leaders` · `next=down|right` · `cols=` `minw=` · `widths=` ·
`valign=top|center|bottom|baseline` · `gap=` (`colgap=` / `rowgap=` override it per axis) `fieldgap=` ·
`height=uniform|hug` · `rowoverflow=` /
`coloverflow=` · `bars=divider` · `bleed=1` · `slots=num,icon,name,0,1` · `splits=` (per-record layouts)
· `roworder=` · `transpose=1` · leaders' `between=dots|dashes|line|gap|sep`.

---

## 13. Columns and regions

### 13.1 When a region is right

A region is right when the thing has **no content to follow**. Full-bleed washes, hero photographs,
corner ornaments, edge rails, gradient plates, a repeating page tab: absolute placement *is* the design
intent, and the region system handles them well. The goal is not "no regions" — it is **no region whose
correct position is a function of where the text ended up.**

### 13.2 Declaring one

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

Sets are numbered and ride the Next-Header counter (§4): several lines share a suffix, a section that
declares no set inherits the previous one, and `none` clears. In a `:STYLE2:` variant a declared set
**replaces** the inherited one wholesale — restate what you want to keep.

Keys: `place=` (`outer`/`inner`/`left`/`right`/`top`/`bottom`/`xy`), `x=`/`y=`/`w=`/`h=`, `fit=`,
`top=`/`bottom=`, `anchor=`, `overflow=`, `gap=`, `z=`, `style=<BlockStyle>` (chrome **by reference** —
there are no inline chrome keys), `reserve=`, `bleed`, `extent=full`, `valign=`, `rotate=`,
`anchor=after:<region>`, `anchor=block:/after:/before:<style>` + `align=`, `wrap=`, `text=`.

> **Region coordinates are relative to the CONTENT origin, not the page.** `y=169` under `%+TMAR: 34`
> paints at page y 203, and a frame's usable bottom is `pageH − tmar − bmar`. Check this before
> concluding a frame has slack.

### 13.3 The pair-collapse — one frame, not two

A common hand-placed shape is **two regions describing one panel**: a visible plate at fixed
coordinates, and a second transparent frame inside it holding the text.

Every one is avoidable. `fit=content` sizes a frame's chrome to its routed content when `extent=full` is
absent, and the frame's `style=` block style supplies the padding the second region was doing by hand.
So **one frame carries the plate and the text**, and the plate follows the content height instead of
being re-measured every time the type changes.

```
                    before                                  after
%+REGION1: panelP place=xy x=209 y=415 w=307 h=393 z=-3 style=RgPlate
%+REGION1: panel  place=xy x=229 y=435 w=267 h=353       │  %+REGION1: panel place=xy x=209 y=415 w=307 h=393 fit=content style=RgPlate
                                                          │  [>RgPlate]  padding 20 20 20 20
```

`extent=full` keeps a fixed height where a design wants the plate to run past its content.

### 13.4 Anchoring a frame to a block

A frame with **no routed content** can be pinned to the block that uses a style:

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

The style is matched on the full key (`#2_Ti.first`), on its role head (`#2_Ti` — one line covers every
selector variant), or on its bare name (`Head`, which composes to `Bd_Head`). `x=`/`y=` remain a nudge.

Two rules follow from what it is:

- It is **furniture**: it 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.
- It never **reserves**: it follows the body, so it cannot displace it.

`anchor=after:<name>` resolves as a **region** first and as a style only when the set declares no region
of that name.

### 13.5 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 while
keeping the declared **width and height**. `y=` becomes the offset below that flow position and defaults
to **0**. `fit=content` grows the *height* to the content instead — different tools; pick by whether the
design fixes the plate's size.

### 13.6 Routing content in

Three ways, and they are not interchangeable:

1. **`region=<name>` on a HEADING style** routes the whole section. `headbreak=` (`any`/`same`/`lower`/
   `none`) picks the heading that ends the route; `headfull=0` routes the trigger heading too.
   **`route=head` routes the trigger heading ALONE** and leaves the section body in the ordinary flow —
   with the frame's `rotate=270`, that is the spine label, written as a real heading.
2. **`region=<name>` on an ordinary style** routes the blocks using that style.
3. **`REGION|<name>` … `REGION|1` body directives** fence a span, whatever its styles.

All three read the block's **effective** style name, so a positional selector reaches 1 and 2:
`[#6_Ti.2@doc]` carrying `region=lRef route=head` sends the *second* level-6 heading to a different
frame than its role's. Reach for 3 only when the run is a stretch of several *different* styles.

> **`text=` is not routing.** Furniture text rides the *chrome*, so it repeats on **every page the set is
> active** — correct for a running spine label or a page tab. Routed content is placed **once** — correct
> for a one-off label. On a single-page flyer the two look identical, so the mistake hides until the
> document grows a page. If the words are content, put them in the document.

> A section route wins over a group's own `region=` spec — a spec-routed group must live outside any
> routed section.

### 13.7 A structural heading

A heading is the only thing that scopes `#N_*` styles and triggers a section route. When you need that
structure but not the words on the page, use effect bit **8192 "Structural"**: the block still exists,
still sets the outline level, still scopes and still routes — and prints nothing, at zero height, in PDF,
HTML and FODT alike. It is implicitly excluded from the TOC.

Bit **8** "Disable" is *not* this. Disable drops the line before it ever becomes a block, so the outline
level, the scoping and the route die with it. Nor is a `size=1` + `#00000000` heading: it reserves a
line box, which drifts with the body type.

### 13.8 Where a column region stops, and the air above it

Two questions a `COL|` directive answers that a style answers too, each with a field.

**"End the columns here."** `headbreak=` names a *heading*, and `Columns = 1` needs the block after
the region to have a style to hang the closing spec on. Where the next thing is a `SPACE|` line, or
nothing, neither works: the region runs on and swallows what belongs after it. Put effect bit
**16384 "End Columns"** on the region's **last** block instead — usually via a positional selector —
and the region ends after it. It does exactly what an authored `COL|1` there does, so moving a
document off the directive changes nothing. You often need neither: a region that runs to the end of
the document closes itself, and back-to-back regions close each other (a later style whose resolved
spec differs replaces the open one).

**"Air above the whole region."** `spacebefore=<pt>` in the Columns spec. Space-before on the trigger
block is not the same thing: with `headfull=0` the trigger *is* the first block of column 0, so its
top margin moves that one column and leaves the other columns — and the region's own background band
— where they were. `spacebefore=` moves the region's top, so everything in it moves together. It does
from the style what a `SPACE|N` line between two regions does from the body.

Per-column air is the other case, and it is the ordinary one: space-before on the block that starts
each column (the one carrying the Column Break effect) works exactly as written.

---

## 14. Composition recipes

Each recipe below is rendered by the program's own regression tests, so one that stops working is a bug
to report, not a stale paragraph.

### 14.1 The tag-free resume

Sidebar = `##` sections, main = `#` sections, **zero tags in the body**. Put `region=side headfull=0` in
the spec of **`[#2_Ti]`** — not `[#2]`: the trigger walk visits `#2_Ti → Ti` and never the bare `#2`.
Routed sections land on the page of their body anchor, so put the `##` sidebar sections **before** the
`#` main sections. An outer `[#1_Ti]` route needs `headbreak=any`, or a following `##` stays inside it
and its own trigger never fires.

### 14.2 The rule under a title

Opts **256** (this block only) + border bit **64** (bottom) on the heading's block style, with **Box
Width** (14) narrowing it and **H-Align** (15) placing it. It moves with the text. For the two-tone rule
(a short thick segment over a long thin one), the thin half is the box's bottom border and the thick half
is a non-square style icon at `pos=edge.bc|size=<W>x<H>` — one style, no region.

### 14.3 The rule that sits BESIDE a title

When the rule does not span its text — it starts where the words end, or hangs under their right
end, or runs past the measure — a bottom border cannot reach it. Use a stretched bar icon on the
same style instead: `char:▬|pos=inside.br|size=<W>x<H>|fit=fill|gap=0`, and move the box the icon
anchors to rather than the icon. **Box Width** (14) narrows that box; **Bleed** (18) `right:<N>`
runs it past the measure. The block's own box needs Opts **256** and a transparent fill — it is
there to be measured, not seen. `offset=0,<dy>` supplies the design's gap below the baseline; that
gap is a constant, so it survives a change of type size while the bar follows the text.

### 14.4 The terminal dot on that rule

A second icon spec on the same style: `char:●|pos=edge.br|size=6`. `edge` puts its center on the
boundary, so it sits *on* the rule rather than above or below it, at any type size.

### 14.5 The ribbon tab with a fold

A heading drawn as a colored tab that runs past the edge of its panel, with a darker triangle under the
overhanging end, as if the ribbon folds behind the page. It is three fields on the heading's own style, so
every heading that uses the style gets one and none of them drift:

1. **The tab is the heading's box.** On the block style (`[>#2_Ti]`): a fill (4), a little top and bottom
   padding (2, 3), and Opts **256** so the box hugs the heading line instead of covering its whole
   section. A **Shape** (17) such as `chevron` points the far end.
2. **The overhang is Bleed (18).** `right:44` paints the box 44 pt past the right edge of its container
   frame — the region frame when the heading is routed into one, else the column — and `right:trim` runs
   it to the page edge. Paint only: text and layout stay put, and the distance counts from the frame, not
   from the box.
3. **The fold is a style icon** (text field 18) on `[#2_Ti]`. Icons anchor to the painted box, bleed
   included, so it follows the tab's end:

```
assets/fold.svg|pos=inside.br|size=16x12|fit=fill|gap=0|offset=0,12
```

`pos=inside.br` puts the icon's right edge on the tab's right end, and `offset=0,<icon height>` drops it by
its own height so it hangs just under the tab. The offset is the icon's height, not a measurement of the
text, so it survives a change of type size. Use `pos=outside.br` instead when the fold should sit past the
tab's end as well as below it — `pos=` names one relationship for both axes (§17.3). The triangle is one
path in a darker shade of the fill:

```svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 12" width="16" height="12"><path d="M0 0H16L0 12Z" fill="#8F5566"/></svg>
```

For a tab that overhangs on the left, mirror the path (`M16 0H0L16 12Z`), anchor it at `pos=inside.bl`
and bleed `left:`. The SVG's color is baked (§17.6), so a palette change needs a new file. Worked example:
the sidebar headings of the *Plum editorial sidebar* résumé (**File ▸ Open Example…**, Résumés,
`sa-resume-walker`). In Settings, fill, Opts, Shape and Bleed are Block Styles columns; the icon is the
text style's Style icon field.

### 14.6 The sidebar rail

Bar Style (19) `timeline:<dia>` on the record row's chrome with a thin Left Bar and `bars=divider`. One
rail, nodes on each entry's first line. Do not build it from a rule region plus per-record dot icons: the
two have no relationship, so nothing keeps them aligned when the entries change.

### 14.7 The skill meter

A 512 column with `meter=bar` (or `dots`, `stars`, `slider`) and **`meternumber2=off`**; the label in
column 1; `valign=center` on the group. No hidden style, no fudge pad. Set the row rhythm with the
group's `gap=`.

### 14.8 The stat band

`next=right cols=3` + a `[>Spec/a]` row box with fill/border/radius + `rowoverflow=repeat`, and the
emphasis ladder (`f0` the style's own text, `f1`/`f2` from `Pres1`/`Pres2`) for the caption lines.
`bleed=1` on the group spec takes the band's chrome to the page trim.

### 14.9 The spacer you may not be able to remove

A region whose only job is to reserve the height of another region is usually a sign the photograph
should have been an **image block with a bleed**: then the heading below follows it and neither region
exists. That works when the picture can be a figure. It does **not** work for a plate that needs a
`cover` crop or a corner radius — those come from a frame's *fill spec*, and the only body block that
can carry one at a fixed height is a transparent line with a `Fixed` line height, which is the
`size=1` + `#00000000` hack under a different name. When the plate has to stay a frame, keep the
spacer frame but stop hand-copying its `y`: give it `anchor=after:<the plate's region>` so it derives
its top, and use `y=` only as the delta. Do not try to replace it with space-before, a box top pad or
a body `SPACE|` — a `reserve=1` xy frame pins the body that follows to its bottom and absorbs all
three (§17.4).

---

## 15. Designing for slides

Slide mode is a property of a style, so a deck is usually a **variant** of the document (§6.2): the
same headings and bullets, a different page and a different way of cutting it.

```
:STYLE2:
%+PAGE_WIDTH: 720
%+PAGE_HEIGHT: 405
%+SLIDE_MODE: 1
%+SLIDE_PAGE_SIZE: 6
%+SLIDE_VALIGN: Center
%+FONT_SCALE: 1.6
:END:
```

**What a slide is.** In the default `outline` break mode a heading arrives on a slide of its own, and
each block under it adds a slide with the earlier siblings still showing — a build, with no slide
written by hand. `%+SLIDE_PAGE_SIZE` is how many earlier siblings stay on screen; `1` replaces each
bullet with the next. A block that overflows splits onto a further slide; `outline-overflow` keeps the
slide count fixed and lets it run past the margin instead.

**What changes from print:**

- **Columns collapse** to one flow; `COL|`, `SPACE|` and `PAGEBRK` claim no slide of their own.
- **Type does not scale by itself.** `%+FONT_SCALE` is the one knob; `%+INVERT_IMAGES: Auto` inverts
  figures on a dark slide.
- **Upper levels can leave the slides.** `%+MIN_PARENTS: N` skips the top N outline levels — and the
  running heads (`@A`, `@B`) still resolve them, so the book or chapter title rides in the header
  instead of on every slide.
- **Editions share a file.** Fence content as `:::slide` / `:::notes` (or tag lines `:notes:`) and drop
  a track per style with `%+EXCLUDE_TAGS:`. A notes edition stays on the deck's page numbers with
  `%+SLIDE_BREAK_MODE: follow` + `%+SLIDE_FOLLOWS: STYLE2`.
- **Selectors and sequences paint but do not group.** Which blocks share a slide is decided from each
  block's plain role; where that matters, use an attach.

Slides are a PDF target: neither the HTML nor the LibreOffice export reads slide mode (§16).

---

## 16. Export limits

**The PDF is the exact rendering.** The HTML export (`--html`) and the LibreOffice export (`--fodt`)
carry the same text and most of the design; this is where they deliberately carry less. Design for the
PDF and check this table before calling a difference a bug.

| feature | HTML | LibreOffice |
|---|---|---|
| pagination, New Page, `PAGEBRK` | one continuous page; no forced breaks (`PAGEBRK` is an inert marker), keep-with-next survives as break-avoid | breaks carried; Writer repaginates the rest |
| running heads and folios | none; the contents and the index carry no page numbers | carried, including per-section sets |
| slide mode | not read — only the slide page size survives | same |
| `@float:` anchoring | the figure exports in flow, where it was written | same |
| region frames | placed from the section top, so a frame the PDF repeats on every page lands once; `wrap=strips`/`both` collapse to one side; `overflow=clip` shows everything | a frame holds text: a table, rail or grid presentation inside it becomes a picture or stacked paragraphs; a `fit=content` frame's accent bar is dropped |
| column decoration | exact on a run whose legs declare fill/border/pad and break themselves with `COLBRK`; other runs are equal-width columns | a per-column band paints only with `extent=full` |
| Shape (17), Bleed (18), rails (19) | shapes approximated with `clip-path`; bleed only inside a region frame; rail nodes drawn, gaps between entries not bridged | a shaped row flattens to its fill and rules; rail nodes drawn, bridges lost, none inside a frame |
| corner radius on cards | kept | lost — card cells and figure cards are square |
| image treatments | `duo=` approximated by a filter; a toned `img:…,gray`/`duo:` fill tones page fills only | baked into a raster; an SVG figure with any treatment becomes a raster |
| front-matter fills (`%+TITLE_PAGE_IMAGE`, `%+TOC_IMAGE`, …) | the title page's only | all four — **the PDF paints none of them** |

---

## 17. Pitfalls

Grouped by mechanism. Every one produced a broken render.

### 17.1 Style lines

- Style lines are **TAB-separated**; empty fields are consecutive tabs. One missing tab silently moves
  align into new-page, and a text row without its Name column shifts every field (§2). When a row does
  not do what it says, count its tabs before anything else — or edit it in Settings, where each field
  is its own column.
- **Always define `[Bd]`** fully — font, size, line height, color, align, caps `0`, tracking `0`. Body
  under `#N` cascades `#N_Bd → Bd → #N → def` and inherits a heading's caps/tracking/size wherever `[Bd]`
  is silent.
- **A bare `[#N]` styles the whole section.** Caps and tracking on `[#1]` will uppercase the bullets.
  Heading-only fields go on `[#N_Ti]`. Likewise a `[#1]` left margin cascades into `##` sections and
  squeezes `COL|` columns.
- **Never put New Page or heavy effects on `[#N]` directly** — use `[#N_Ti]`. Heading np/effects cascade
  by design and can paginate one block per page.
- Set **align explicitly** on display and hero styles; they inherit `justify` from `def` and gap out a
  single line.
- **Line height is inherited.** Changing `[def]`'s cascades into every style that sets a size but no line
  height. Their glyphs stay put while their line *box* shrinks, so anything sized "text box + padding"
  silently gets shorter. Pin `lh` on unchanged-size styles that carry visible chrome.
- `htype=Fixed` with line height 100 means **100 pt** lines. Use Proportional.
- A `%` comment line above `:STYLE:` turns the whole style block into body text (§2).

### 17.2 Chrome

- Chrome-only `[>X]` styles need `#00000000` explicitly (§8).
- A **256** this-block box is inset to the block's content bounds, and an icon that registers against it
  sees that box — check the two together with a render.
- Text-style `lmar` does **not** apply to a presentation group's records; use the group box's left pad.
  Negative `lmar` on a body style does work, and pushes a name into the margin.

### 17.3 Icons

- `pos=box.tl` on a presentation **row** style does not paint. Use `slots=icon` + `pos=field`, or a rail
  node.
- `char:` glyphs outside the style's font do not paint in presentation field slots — use an SVG. (☎ and
  ✉ in Montserrat render blank; wrap them in a `{=sym=…}` character style set to DejaVu or Noto.)
- An icon on the **group** line of a rule-form group (`[Pz.{…}]`) never paints; put it on the row
  (`[Pz.{…}/a]`).
- `pos=` names **one** relationship for both axes. There is no "outside vertically, inside
  horizontally": `outside.br` puts the mark past the right edge *and* below the bottom one. A mark that
  must hang below a box but stay within its right edge is `inside.br` plus `offset=0,<dy>`.
- **Box Width (14) and H-Align (15) do not bite on a region-routed block** — they are read in the
  body-column path only. Inside a frame, move an icon's anchor with **Bleed** (18) or anchor it to the
  opposite edge; do not expect a narrowed box.

### 17.4 Regions

- Region coordinates are relative to the **content** origin (§13.2).
- `place=right` + `reserve=1 anchor=page` reserves the **full page height** even with `top=`. A
  partial-height sidebar is `place=xy … reserve=1 fit=fixed bleed=right,bottom`.
- A `reserve=1` xy frame slightly too short silently continues onto page 2 (`overflow=continue`). Put
  `overflow=clip` on fixed-slot frames so an overrun **warns**.
- A **presentation group cannot wrap beside** a `place=xy reserve=1` rect — the whole group jumps below
  it. Use `COL|2|indep` plus furniture plates when a column holds presentations.
- A `reserve=1` xy band side-snaps **every** body line in its y-band, including a wide-margin title. Put
  the chrome on a separate `z=-1` plate and let the routed target be `reserve=0`.
- `SPACE|` / `COL|` lines after a routed `##` section belong to that section and get routed. Open the
  `COL|` region first, then the routed heading inside it.
- `shape=slant:right:-N` on a region plate moves the whole slanted edge outward, not just the far corner
  — shrink `w` to compensate.
- **SVG `clipPath` is ignored** — the clipped element paints whole. Circle-crop a portrait with the
  image grammar instead: `{width=120pt height=120pt mask=circle.svg}` (a filled circle on transparent),
  or a presentation cell at Opts 2048 + an image field `{fit=cover}`.
- **SVG gradient `stop-opacity` is ignored** — the ramp paints solid. An SVG scrim or fade needs solid
  elements with `fill-opacity` on each, stepped finely enough (≈1.5 pt) that no step shows on a photo.
  A `grad(…)` fill spec with `#AARRGGBB` stops paints solid too; a plain `#AARRGGBB` fill is translucent.
- A `reserve=1` xy frame **pins the body that follows to the frame's bottom**. Space-before on the next
  block, a top pad on its box, and a body `SPACE|` are all absorbed, so clearance under such a frame can
  only come from another reserved frame (§14.9).
- **A positional selector CAN carry the route and the Columns field.** `region=` / `route=head` on
  `[#6_Ti.2@doc]` routes the second level-6 heading and leaves the first on its role's route. A selector
  that carries no `region=` still falls back to its role's — slot 19 has no per-field cascade. Reach for
  the `REGION|<name>` body directive only when the run is a stretch of several *different* styles.
- **`route=head` takes the heading out of the section's own region**, and with it the gap it would have
  contributed there: put that space on the preceding group's space-after, not on the heading.

### 17.5 Presentations

- A group ends at a **blank line**.
- `01. Creative | …` at line start parses as a numbered **list item**, never a record — write `**01.**`.
- A record line starting with `|` parses as a pipe **table** row; a leading space keeps it a record with
  an empty first field.
- `flow=table` row height ignores **row**-style pads; cell padding comes from the **column** chrome.
- Presentation cells add the group text style's space-after per field — set it to 0 when tuning fit.
- Two same-level `fields=1` rules must differ by record count; `blanks=split` alone does not
  disambiguate. A `fields=1` run swallows a preceding paragraph across a blank line → `blanks=split`.
- Rule specificity counts predicates: `[Pz.{fields=2 records=3}]` beats `[#3_Pz.{fields=2}]`. Pin a
  bare-`Pz` rule with a type predicate so it cannot steal a leveled group.

### 17.6 Document-level

- **Dash actions are opt-in.** Every dash defaults to *Do nothing*, so a spaced em dash prints as one.
  To make a dash break, split or substitute, set `%+DASH_ACTIONn:` in the base `:STYLE:` (`n` indexes
  the dash list: 0 `-`, 1 em, 2 en, …; `%+DASH_SWAPn: 1` swaps the text either side). It acts at render
  time, and only on a dash with a space either side.
- **Headings get outline numerals by default** — clear both `%+NUMERAL_STYLES:` and
  `%+NUMERAL_STYLES_SG:` (and the `TOC_` pair), or design with them.
- **A weight named as a family falls back silently.** `%+FONT_ALIAS: SanBd	Montserrat Bold` renders
  regular unless a family called exactly `Montserrat Bold` is installed. Write `Montserrat<bold>`, and
  verify a weight with `pdffonts` rather than by eye (§5.2).
- SVG colors are **baked** and cannot reskin per style section. Keep art palette-neutral, or duotone.
- Table formulas are not evaluated by `--pdf`; write the result into `=formula=result`.

---

## 18. Verifying your work

### 18.1 The loop

```bash
ordstyle --pdf mydoc.ord           # the first style  → mydoc.STYLE.pdf
ordstyle --pdf mydoc.ord STYLE2    # another design    → mydoc.STYLE2.pdf
```

Watch stderr for `region '<name>': content overflows the frame — clipped (overflow=clip)` and
`… block taller than the empty frame`, and watch the page count (`pdfinfo`). **A silent extra page is
the usual sign something overflowed.** `ordstyle --help` lists the other headless modes (`--html`,
`--fodt`).

`MARGIN_DEBUG=1` adds the layout traces: `DECO` (section-box bands), `REGION place` (routed content —
its units are 1200-dpi device units, ×16.67), `FURN` (which region set a page carries) and `BLKANCH`
(which placements a block-anchored frame matched).

### 18.2 Comparing against a reference image

Do not trust automated measurements of a small or upsampled reference. Resample the reference and a
300-dpi render of the same page to a **common page width**, crop one body paragraph from each, stack
them, and look — before the change and again after it.

A low-dpi `pdftoppm` shows a phantom vertical line at an SVG plate's edge that is absent at 300 dpi —
verify seams at high dpi before chasing them.

### 18.3 The type-size probe — the acceptance test

A conversion from a hand-placed graphic to a content-anchored one is only real if the document **stops
caring where the text lands.** So the test is not "it still looks right":

1. **Snapshot first.** Copy the current PDF aside; it is the baseline the change is judged against.
2. **Convert, then render**: zero warnings, page count unchanged, and a pixel diff against the snapshot
   that is empty or explainable.
3. **Then break it on purpose.** Raise the document's body size by 1 pt, re-render, and confirm **every
   converted element still registers** — the plate still hugs its column, the rule still sits under its
   title, the meter still centers on its label, the ornament still hangs off its tab. Revert the 1 pt.

Step 3 is the whole point: a 1 pt change of body size is exactly the change that breaks hand-placed
work everywhere at once. **Any element that needs a hand-nudge after step 3 has not been converted — it
has been moved.**

---

## 19. The reference

Every header, every style field and every spec key named here is defined in **`ordSyntax.md`**, the
field-level reference. This guide says which of them to reach for; that one says exactly what each
does.
