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/book.typ | 7 +++++-- docs/typ/cheatsheet-a4.pdf | 6 +++--- docs/typ/cheatsheet-a4.typ | 3 ++- docs/typ/style.typ | 24 ++++++++++++++++-------- 4 files changed, 26 insertions(+), 14 deletions(-) (limited to 'docs') diff --git a/docs/typ/book.typ b/docs/typ/book.typ index 7af907c3..803a65e2 100644 --- a/docs/typ/book.typ +++ b/docs/typ/book.typ @@ -7,8 +7,11 @@ #set document(title: "pardes") #doc-links.update(true) #set page(paper: "a4", fill: palette.paper, margin: (x: 22mm, y: 24mm)) -#set text(font: "Libertinus Serif", size: 10.5pt, fill: palette.ink, lang: "en") -#set par(justify: true, leading: 0.6em) +#set text(font: "Libertinus Serif", size: 10pt, fill: palette.ink, lang: "en") +#set par(justify: true, leading: 0.62em, spacing: 1em) +#set list(spacing: 0.8em) +#show heading.where(level: 2): set block(above: 2em, below: 0.9em) +#show heading.where(level: 3): set block(above: 1.5em, below: 0.7em) #show raw: set text(font: mono, size: 0.9em) #show heading: set text(fill: palette.tag-name) #show heading.where(level: 1): it => { diff --git a/docs/typ/cheatsheet-a4.pdf b/docs/typ/cheatsheet-a4.pdf index 7ea41915..d0f7541d 100644 --- a/docs/typ/cheatsheet-a4.pdf +++ b/docs/typ/cheatsheet-a4.pdf @@ -1732,12 +1732,12 @@ x endstream endobj 479 0 obj -<> +<> endobj 480 0 obj <> stream -Typst 0.15.1en2026-09-30T23:11:10-03:002026-09-30T23:11:10-03:001application/pdfPTk8GgeQgXHy1oXtTDGdSQ==PTk8GgeQgXHy1oXtTDGdSQ==proof1.7 +Typst 0.15.1en2026-09-30T23:14:31-03:002026-09-30T23:14:31-03:001application/pdfyyqGQkCOm2XduNn8/NMQzw==yyqGQkCOm2XduNn8/NMQzw==proof1.7 endstream endobj 481 0 obj @@ -2228,7 +2228,7 @@ xref 0000114586 00000 n 0000115659 00000 n trailer -<> +<> startxref 115846 %%EOF \ No newline at end of file diff --git a/docs/typ/cheatsheet-a4.typ b/docs/typ/cheatsheet-a4.typ index 26f19f9d..5ae8b4be 100644 --- a/docs/typ/cheatsheet-a4.typ +++ b/docs/typ/cheatsheet-a4.typ @@ -2,7 +2,7 @@ // cheatsheet.typ and the elements' look in style.typ; this is page, // type and headings only. // typst compile --ignore-system-fonts docs/typ/cheatsheet-a4.typ -#import "style.typ": palette, mono +#import "style.typ": palette, mono, pairs-density #set page(paper: "a4", fill: palette.paper, margin: (x: 9mm, y: 8mm), columns: 3) #set columns(gutter: 4.5mm) @@ -36,4 +36,5 @@ #show heading.where(level: 3): it => block(above: 0.6em, below: 0.35em, sticky: true, text(size: 8.4pt, weight: "bold", fill: palette.grip, it.body)) +#pairs-density.update("tight") #include "cheatsheet.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