From 5131d4382635a76df757566308b43e562c5f14d2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 23:14:49 -0300 Subject: The book and the HTML set #pairs tables roomy, the A4 sheet tight A pairs-density state, set to tight by cheatsheet-a4.typ and roomy otherwise, gives book and HTML tables more row padding and room between the key and the meaning. The book sets its body at 10pt with more space around sections and between paragraphs and list items. Co-Authored-By: Claude Opus 5.5 --- docs/typ/style.typ | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'docs/typ/style.typ') diff --git a/docs/typ/style.typ b/docs/typ/style.typ index 9e98838d..e1bab27d 100644 --- a/docs/typ/style.typ +++ b/docs/typ/style.typ @@ -187,18 +187,26 @@ } } +/// How roomy #pairs tables are: "roomy" (the book, the HTML) or "tight" +/// (the A4 sheet sets it). +#let pairs-density = state("pairs-density", "roomy") + /// Pairs: a thing and what it means, as a two-column table, key column /// first, rows on alternating tints. `split: 2` sets the rows as that many /// tables side by side (on paper; HTML gets one table). #let pairs(split: 1, ..cells) = { let rows = cells.pos().chunks(2) - let one(rows) = table( - columns: (auto, 1fr), stroke: none, inset: (x: 2pt, y: 1.6pt), - fill: (_, y) => if calc.even(y) { palette.tag-bg.transparentize(35%) }, - ..rows.flatten(), - ) - context if html-out() or split == 1 { one(rows) } else { - let n = calc.ceil(rows.len() / split) - grid(columns: (1fr,) * split, column-gutter: 2pt, ..rows.chunks(n).map(one)) + context { + let tight = pairs-density.get() == "tight" + let one(rows) = table( + columns: (auto, 1fr), stroke: none, + inset: if tight { (x: 2pt, y: 1.6pt) } else { (x: 7pt, y: 4pt) }, + fill: (_, y) => if calc.even(y) { palette.tag-bg.transparentize(35%) }, + ..rows.flatten(), + ) + if html-out() or split == 1 { one(rows) } else { + let n = calc.ceil(rows.len() / split) + grid(columns: (1fr,) * split, column-gutter: if tight { 2pt } else { 10pt }, ..rows.chunks(n).map(one)) + } } } -- cgit v1.3