Semantic layouts
The overview below links to each definition. Function definitions show signatures with parameter and return types; variables show their declared types. Descriptions and defaults follow.
author
Creates a validated author record for setup(authors:) and layouts.title(authors:).
A name on its own needs no record at all. authors: takes content or a string wherever it takes a record, so authors: [Ada Lovelace] and authors: ([Ada Lovelace], [Charles Babbage]) are both complete author lists. Reach for author() when a name carries more than itself:
#let ada = mosaic.layouts.author(
[Ada Lovelace],
affiliations: ([Analytical Society], [University of London]),
email: "ada@example.org",
orcid: "0000-0002-1825-0097",
corresponding: true,
)Affiliations
An affiliation is the institution itself: content or a non-empty string. Two authors share one legend number exactly when they give the same affiliation, so bind a shared institution once and reuse the binding:
#let lon = [University of London]
#let ada = mosaic.layouts.author([Ada Lovelace], affiliations: (lon,))
#let bab = mosaic.layouts.author([Charles Babbage], affiliations: (lon,))The academic title variant renders these as superscript numbers over a numbered legend. Compact variants list them without numbering.
Validation
Values are checked at construction rather than at render time:
emailmust look like an address.orcidmust be a well-formed iD.correspondingrequires at least one ofemailororcid.
author(
name: content | str,
affiliations: array = (),
email: str | none = none,
orcid: str | none = none,
corresponding: bool = false
) -> dictionaryname- Type:
contentorstr - The author’s name, as the sole positional argument.
- Type:
affiliations- Type:
array - Default:
() - Array of institutions, as content or non-empty strings, in the order they should be listed for this author.
- Type:
email- Type:
strornone - Default:
none - Contact address, shown on the
academictitle variant and linked as amailto:. Independent oforcid.
- Type:
orcid- Type:
strornone - Default:
none - ORCID iD in
0000-0000-0000-0000form, rendered as a linked ORCID label beside the name on every title variant. Independent ofemail.
- Type:
corresponding- Type:
bool - Default:
false - Whether to mark this author as the corresponding one, with an asterisk beside the name and on the contact line. Requires
emailororcid.
- Type:
content
Creates a conventional header, body, and footer grid recipe.
This is the ordinary slide layout, and the one automatic level-two headings resolve to. It builds a vertical Mosaic split whose body child is a horizontal split of plain cells.
#mosaic.slide(
layout: mosaic.layouts.content(variant: "header-body", columns: 2),
[== Two columns],
[Left body],
[Right body],
)Cells
The surrounding mosaic.slide fills cells in traversal order:
header, when the variant includes one.body, orbody-1,body-2, and so on whencolumnsis above one.footer, when the variant includes one.
A setup-level content: (footer: ...) default can satisfy the footer, so a positional slide may omit that final block.
Variants
body: one region, edge to edge.header-body: a content-sized header above the body.body-footer: the body above a content-sized footer.header-body-footer: both. The default.
Labels
Every resolved cell carries a label, so appearance comes from native Typst rules:
mosaic-cell-header: the header, in the variants that include one.mosaic-cell-body: the body, whencolumnsis one.mosaic-cell-body-1,mosaic-cell-body-2, and so on: the body columns, whencolumnsis above one.mosaic-cell-footer: the footer, in the variants that include one.
Styling
The layout is purely structural, so its looks come from rules on those labels.
#show label("mosaic-cell-header"): mosaic.surface(fill: luma(240))The header cell carries no special typography of its own. Put a native level-two heading in its content to style it as a heading and register it with outlines.
content(
variant: str = "header-body-footer",
columns: int = 1,
tracks: auto | array = auto
) -> dictionaryvariant- Type:
str - Default:
"header-body-footer" - Structural arrangement:
body,header-body,body-footer, orheader-body-footer.
- Type:
columns- Type:
int - Default:
1 - Number of body columns, and therefore the number of body blocks the slide must supply. Must be a positive integer.
- Type:
tracks- Type:
autoorarray - Default:
auto Native Typst track sizes for the body columns, one per column.
autosplits the body evenly.mosaic.layouts.content(columns: 2, tracks: (2fr, 1fr))
- Type:
image
Creates an image-first grid recipe.
This is the image-first counterpart to layouts.content: the picture is the argument rather than slide content, and the text regions arrange around it. The surrounding mosaic.slide fills only the text cells.
#mosaic.slide(
layout: mosaic.layouts.image(
path("chart.webp"),
caption: [Revenue by quarter],
),
[== Results],
)Variants
figure: a contained picture centered under aheadercell, with an optionalcaptionbelow it. The conventional academic figure slide, and the default.left,right,top,bottom: a full-bleed picture paired with a text region ofheaderandbodycells, sized bytracks.full: the picture behind a singlebodycell, so text reads over the photograph. Put a heading inside the body to title it, or pass an empty block for a bare full-bleed slide.
Captions
A caption composes a native Typst figure around the picture, so it takes the deck’s own show figure.caption styling and figure numbering. Switch the numbering off with an ordinary set figure(numbering: none). Captions are accepted by the figure variant only.
Labels
Every resolved cell carries a label, so appearance comes from native Typst rules:
mosaic-cell-header: the header, in thefigureand directional variants.mosaic-cell-body: the text region, in the directional andfullvariants.mosaic-cell-image: the picture, in thefigureand directional variants. Thefullvariant paints the picture as the body cell’s background instead, so it has no image cell of its own.
Styling
The layout is purely structural, so its looks come from rules on those labels. The full variant inherits the surrounding native text color, so quiet the photograph with the image dictionary’s scrim key and override the cell’s text fill.
#show label("mosaic-cell-body"): set text(fill: white)
#mosaic.slide(
layout: mosaic.layouts.image(
(path: "photo.webp", scrim: black.transparentize(55%)),
variant: "full",
),
[== Full bleed],
)image(
image: content | str | path | dictionary,
variant: str = "figure",
caption: content | none = none,
fit: auto | str = auto,
tracks: auto | length | ratio | relative | fraction | array = auto
) -> dictionaryimage- Type:
contentorstrorpathordictionary - The picture the slide is built around, as the sole positional argument. Give a path, ready-made content, or a dictionary whose
scrimkey paints a layer over the picture and under any text composed on top of it.
- Type:
variant- Type:
str - Default:
"figure" - Structural arrangement of picture and text:
figure,full,left,right,top, orbottom.
- Type:
caption- Type:
contentornone - Default:
none - Caption composed below a
figurepicture. Rejected by the other variants.
- Type:
fit- Type:
autoorstr - Default:
auto How the picture fills its region.
"contain": fit the whole picture inside the region. Thefiguredefault, since a chart must never be cropped."cover": fill the region, cropping the overhang. The default for every other variant.
autopicks the per-variant default above.
- Type:
tracks- Type:
autoorlengthorratioorrelativeorfractionorarray - Default:
auto - Sizes the split of a directional variant, and is rejected by
figureandfull. One native Typst track size answers “how much room does the picture get” and is side-independent, soleftandrightstay mirror images without reordering anything; the text region takes the remaining1fr. An array of two is in visual order instead, and must be mirrored by hand when the variant flips.
- Type:
title
Creates a presentation title grid.
The layout supplies every cell’s content itself, so the surrounding mosaic.slide consumes no slide bodies.
#show: mosaic.setup.with(
title: [Tree-based slide grids],
subtitle: [A layout model for Typst],
authors: [Ada Lovelace],
date: [2026-08-03],
)
#mosaic.slide(layout: "title", variant: "centered")Inheritance
Each of title, subtitle, authors, and date defaults to auto, which takes the value configured on setup. To override an inherited value:
- Pass explicit content or a string to replace it.
- Pass
noneto suppress an inheritedtitle,subtitle, ordate. - Pass
()to suppress inheritedauthors.
Variants
Text variants:
centered: the heading stack at the slide’s center, details anchored to the bottom edge.bordered: a thin rule border inset from the slide edge with the centered stack inside it.ruled: the heading stack over a full-width accent rule with the details beneath, flush left at the slide’s vertical center. The beamer-metropolis title page, and the default.kicker: the magazine masthead. A strong opening rule, the subtitle set as a small tracked-caps eyebrow in the accent color, the title below it, and the details anchored to the bottom edge.panel: a vertical side panel in the deck’s text color carries the details, knocked out in the canvas color under a short accent rule; the heading stack takes the main field.academic: the conference-poster arrangement. Author names carry superscript affiliation numbers over a numbered affiliation legend and a contact line. Requires at least one author.
One image variant, which requires image and reads position:
imagewithposition: "left","right","top", or"bottom"(the default is"left"): a full-bleed picture beside or above the title stack, sized bytracks.
A full-slide photographic title is not a variant: give the slide a background: plane and compose the type yourself, reading the deck’s own metadata back through info().
To invert any of these, with the slide ground in the deck’s text color and the type knocked out, pass invert: true on the slide rather than picking a variant; inversion is a polarity, not a structure.
Authors
Every variant accepts the same authors, written in whichever of three spellings fits the deck: one name as content or a string, an array of names, or an array of records built with layouts.author for the authors that carry affiliations, an ORCID iD, or an address. Names and records mix freely in one array. Every variant renders every author field through the same tiers: a byline of names with linked ORCID labels, superscript affiliation numbers, and the corresponding asterisk, then one fine-print line per kind of information: the numbered affiliation legend, the contact addresses, the date. Kinds never share a line, and the superscript markers appear exactly when the deck names more than one institution.
Labels
Every resolved cell carries a label, so appearance comes from native Typst rules:
mosaic-cell-title: the title stack, in every variant. Most variants compose the subtitle and the details inside it too.mosaic-cell-details: the affiliation and date band, in thepanelandacademicvariants, which set those tiers outside the title cell.mosaic-cell-authors: the byline, in theacademicvariant.mosaic-cell-image: the picture, in theimagevariant.
One further label is not a cell: the display line of the title stack carries mosaic-title-display, which is where a theme states the title’s display size.
Styling
The layout is structural. A rule on <mosaic-cell-title> reaches the whole composed stack: title, subtitle, and details alike. Recoloring it is what light-on-dark compositions over a photograph need.
#show label("mosaic-cell-title"): set text(fill: white)
#mosaic.slide(
layout: "title",
background: mosaic.components.image("cover.webp", scrim: black.transparentize(55%)),
)Sizing it works the same way, because the display line carries its own <mosaic-title-display> label and the theme’s display size lands there rather than on the cell. The tiers below are ordinary ems of the cell, so one rule scales the stack as a unit and the proportions hold. That is how to ask for quiet type in the corner of a photograph.
#show label("mosaic-cell-title"): set text(size: 0.45em)A theme states the display size on the inner label instead, which leaves the outer one free for the deck to scale:
#show label("mosaic-title-display"): set text(size: 2em, weight: "semibold")title(
title: auto | content | str = auto,
subtitle: auto | content | str | none = auto,
date: auto | content | str | none = auto,
image: none | content | str | path | dictionary = none,
variant: str = "ruled",
position: auto | str = auto,
authors: auto | content | str | array = auto,
tracks: auto | length | ratio | relative | fraction | array = auto,
rule: auto | bool = auto,
accent: color | auto = auto
) -> dictionarytitle- Type:
autoorcontentorstr - Default:
auto - Title text.
autoinheritssetup(title:).
- Type:
subtitle- Type:
autoorcontentorstrornone - Default:
auto - Subtitle set tight below the title.
autoinheritssetup(subtitle:);nonesuppresses it.
- Type:
date- Type:
autoorcontentorstrornone - Default:
auto - Display date joined into the fine-print details line.
autoinheritssetup(date:);nonesuppresses it.
- Type:
image- Type:
noneorcontentorstrorpathordictionary - Default:
none - The picture used by the
imagevariant, and rejected by the others. Give a path, ready-made content, or a dictionary whosescrimkey quiets the photograph enough to read text over it, as in(path: "cover.webp", scrim: black.transparentize(55%)).
- Type:
variant- Type:
str - Default:
"ruled" - Structural arrangement:
ruled,centered,bordered,kicker,panel,academic, orimage.
- Type:
position- Type:
autoorstr - Default:
auto - Where the
imagevariant’s picture sits, and rejected by the others:left,right,top, orbottom, for a full-bleed picture beside or above the title stack.automeansleft.
- Type:
authors- Type:
autoorcontentorstrorarray - Default:
auto - One name, or an array of names and records created with
layouts.author.autoinheritssetup(authors:);()suppresses an inherited list.
- Type:
tracks- Type:
autoorlengthorratioorrelativeorfractionorarray - Default:
auto - Sizes the image variant’s split, and is rejected elsewhere. One native Typst track size sizes the picture and is side-independent, so the
leftandrightpositions stay mirror images; the title region takes the remaining1fr. An array of two is in visual order instead, and must be mirrored by hand when the position flips.autogives the picture the smaller share.
- Type:
rule- Type:
autoorbool - Default:
auto - Whether to draw the variant’s structural mark: the
ruledfull-width rule, theborderedborder, or thekickeropening rule. On theimagevariant it draws the short accent rule of the compact stack instead.autodraws the structural marks and omits the accent rule on theimagevariant, where the photograph already does that work.
- Type:
accent- Type:
colororauto - Default:
auto - Color of the variant’s structural mark.
autouses the deck’s text color for the marked text variants (bordered,kicker) and the semantic accent for theimagevariant’s short rule.
- Type:
section
Creates a section divider grid.
The section cell’s text is the slide’s own content, so the surrounding mosaic.slide supplies one block. Automatic level-one headings resolve to this layout.
#mosaic.slide(
layout: "section",
number: [02],
subtitle: [How the grid resolves],
)[Structure]Variants
plain: one centeredsectioncell. The default.rule: a heavy full-width rule with the title hanging beneath it, flush left, the number above the rule.numeral: the section number set enormous in the line color, bleeding off the top-right edge behind a lower-left title stack.baseline: title flush left and number flush right sharing one baseline, tied together by a full-width hairline.toc: every section in the deck listed, the current one alive with its number, the others ghosted.image-left,image-right,image-top,image-bottom: that cell beside or above a full-bleedimagecell, sized bytracks.image-background: the section text directly over a full-slide picture.
Every image variant requires image. The designed text variants (every variant but plain and the image ones) treat an omitted number as the automatic section counter, so they need no argument in the ordinary case.
Labels
Every resolved cell carries a label, so appearance comes from native Typst rules:
mosaic-cell-section: the section text, in every variant. The number and subtitle are composed inside it, so one rule reaches the whole stack.mosaic-cell-image: the picture, in the directional image variants. Theimage-backgroundvariant paints the picture as the section cell’s background instead, so it has no image cell of its own.
Styling
The layout is structural. The centered arrangement and title typography come from the <mosaic-cell-section> label rules setup emits. Over a photograph the text inherits the surrounding native text color, so quiet the picture with the image dictionary’s scrim key and override the cell’s text fill.
#show label("mosaic-cell-section"): set text(fill: white)
#mosaic.slide(
layout: "section",
variant: "image-background",
image: (path: "cover.webp", scrim: black.transparentize(55%)),
)[Structure]section(
subtitle: content | str | none = none,
number: content | str | none = none,
image: none | content | str | path | dictionary = none,
variant: str = "plain",
accent: color | auto = auto,
tracks: auto | length | ratio | relative | fraction | array = auto
) -> dictionarysubtitle- Type:
contentorstrornone - Default:
none - Optional subtitle set below the section title.
- Type:
number- Type:
contentorstrornone - Default:
none - Optional section number or label.
plainand the image variants set it above the title and omit it whennone; the designed text variants build their composition around it and read the automatic section counter when it isnone.
- Type:
image- Type:
noneorcontentorstrorpathordictionary - Default:
none - The picture used by the image variants, and rejected by the others. Give a path, ready-made content, or a dictionary whose
scrimkey quiets the photograph enough to read text over it.
- Type:
variant- Type:
str - Default:
"plain" - Structural arrangement:
plain,image-left,image-right,image-top,image-bottom, orimage-background.
- Type:
accent- Type:
colororauto - Default:
auto - Color used by the optional section number.
autoinherits the semantic muted color resolved bysetup, so numbers stay subordinate to the title; pass a color to override.
- Type:
tracks- Type:
autoorlengthorratioorrelativeorfractionorarray - Default:
auto - Sizes the split of a directional image variant, and is rejected by the others. One native Typst track size sizes the picture and is side-independent, so
image-leftandimage-rightstay mirror images; the section region takes the remaining1fr. An array of two is in visual order instead.
- Type: