Styling the grid
Every visual knob the grid and check()‘s preview highlighting use goes through one shared mechanism, resolved in three layers, each overriding only what the previous layer left unset:
- checkitoff’s own package default — generic and checklist-agnostic (portrait A4, no color, “use whatever the ambient template already set”);
- the active checklist’s own
style:field, if it has one — CONSORT’s real landscape A4 layout and column widths, taken from its official source document, is exactly this layer; - whatever you explicitly ask for via
set-style(...).
set-style(...) takes every knob as a keyword, auto by default (“don’t touch this one”); repeated calls merge rather than reset:
#set-style(
preview-color: auto, // check()'s preview-mode highlight color
show-id: auto, // superscript the id in preview mode?
paper: auto, // grid page size, e.g. "a4", "us-letter"
landscape: auto, // grid page orientation
columns: auto, // 4 column widths, e.g. (18%, 7%, 1fr, 10%)
font: auto, // grid text font
text-size: auto, // grid text size
header-fill: auto, // header row background
header-text-color: auto,
section-fill: auto, // section band background
section-text-color: auto,
group-fill: auto, // mid-level group band background
group-text-color: auto,
)An override on a checklist with no style: of its own:
#import "../../lib.typ": *
#import "../../../typst-contexture/lib.typ" as contexture
// "tiny" has no style: field of its own, so it renders with checkitoff's
// package-default-style until set-style() below overrides it.
#let tiny = (
name: "TINY",
full-name: [Tiny reporting checklist],
items: (
(section: "Methods", topic: "Outcome assessment", group: none, id: "1",
description: [How the primary outcome was assessed.]),
(section: "Methods", topic: "Randomisation", group: none, id: "2",
description: [How the allocation sequence was generated.]),
),
)
#set-style(
columns: (22%, 6%, 1fr, 12%),
header-fill: rgb("#2e3436"),
header-text-color: white,
section-fill: rgb("#eeeeec"),
)
#show: contexture.bundle.with(
template: body => {
set page(width: 16.6cm, height: auto, margin: 12pt)
body
},
documents: (checklist(checklist: tiny),),
)
#check("1")[The primary outcome was assessed by a rater blinded to group
assignment.]
#check("2")[Participants were randomly assigned via a computer-generated
sequence.]
preview-color/show-id also apply to check()‘s own preview-mode highlight, independently of any checklist — check() doesn’t know which checklist is active, by design:
#import "../../lib.typ": *
#set page(width: 16.6cm, height: auto, margin: 12pt)
#set text(size: 10.5pt)
#set-style(preview-color: rgb("#c01c28"), show-id: false)
The primary outcome was #check("6a")[change in disease activity score from
baseline to week 12], assessed by a rater blinded to group assignment.
These values always win, over both checkitoff’s package default and the active checklist’s own style: — your explicit ask, for the manuscript you’re compiling right now, is the most specific signal available. A checklist that ships its own faithful style: (CONSORT, PRISMA, …) keeps looking like its real source document by default; set-style(...) is for the cases where that’s not what you want — matching a specific journal’s house style, or simply personal preference.
| ← The page-break idiom | Wiring a real project → |