diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 23:14:49 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 5131d4382635a76df757566308b43e562c5f14d2 (patch) | |
| tree | 0beac202bbaa931ba2c29f413ee92a5451aac604 /docs/typ/style.typ | |
| parent | 9155fb6632c1337ed077b76e06e9d176b5b4889f (diff) | |
| download | pardes-5131d4382635a76df757566308b43e562c5f14d2.tar.gz pardes-5131d4382635a76df757566308b43e562c5f14d2.zip | |
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 <[email protected]>
Diffstat (limited to 'docs/typ/style.typ')
| -rw-r--r-- | docs/typ/style.typ | 24 |
1 files changed, 16 insertions, 8 deletions
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)) + } } } |
