Specification · Chapter 6 / 7

Semantics

On this page

What a document means once it is read: where each element is placed, how large it is, and what is reported.

Placement and size

Placement

Placement is where on the page an element is drawn: in a slot, at a free position, or in the flow.

How to write

A slot element (such as [title: …]) goes to its place in the layout. An element with x or y goes to that position in its parent. Any other element, and text written directly on a page, joins the flow where it stands.

Example

Output of koma export

A paragraph of bare text flowing from the top left, and a soft box placed at a position at the lower right.

Source

Text written directly on the page joins the flow as a box.

[box .tint x=55% y=60% w=35%:
  A box with a position goes there.
]

Details

  • Slots: the position the layout decides (Page layouts). Writing x y w h overrides it with those values.
  • An element with x or y: a free position in its parent.
  • Neither: the element joins the flow where it stands. With only w or h, that is its size in the flow.
  • The flow directly on a page: an element placed directly on a page without x or y ([col:], [row:], [figure:], [box:] and so on) has the page (page) as its parent and flows in the page's area. page is a stand-in parent never written in the source. On every layout, the page's area is its body band: inside the page's padding (padding), below its header band and above its footer band (Layout grids, The bottom band), unaffected by frames such as the body frame. The padding is set by the CSS page { padding: … }, and per layout by @layout content { page { padding-top: … } } (Looks for one layout). Sides not written use the page kind's --koma-padding-block (top) and --koma-padding-inline (left and right); a bottom not written is the page number's margin, and the footer band keeps the rest of the kind's --koma-padding-block, so the area ends where it did while the footer is short. % is of the page's height for top and bottom, and of its width for left and right. When the page has a footer or footnotes, the area ends above them, at the footer band's top (Footnotes). [col:] and [row:] split this area (Columns and rows). It is not an implicit body, and the theme's main rules do not apply. x and y are positions on the whole page (a full-bleed image can be placed too).
  • Overlap with frames: only when the page's area overlaps the rectangle of a frame tag written on that page (title, main and so on) is it drawn as it is, with flow-over-slots (warning) reported for each flowing element, advising to write it inside [main:] to put it in the body frame. The overlap is decided from the page's padding and the frames' rectangles, the same way in koma check and the app. Only sharing area overlaps; touching edges do not. When the padding starts below the headings, a page of headings alone is not reported. [main:] and bare text on the same page are reported, since the body frame overlaps the area. Elements with x or y are not reported.
  • Unquoted text: text directly on a page that is in no element is read as a [box:] with no placement written (an element in the flow directly on the page). It is a box written without brackets or [box:]: its drawing and export (HTML, PDF, PowerPoint) are the same as for [box: …] holding the same text. It is not an implicit body, and the theme's main rules do not apply.
    • A box with no style has no border or background; it is just a rectangular area. Reading bare text as a box does not draw a frame around it.
    • Runs: text continuing between elements is one box. Paragraphs separated by blank lines, and comments (;) between them, go in the same box. An element between them (including a freely placed box) splits the box there, and the parts join the flow in the order written. A line of only spaces draws nothing.
    • Decided by syntax alone: document and page settings (including the document's CSS, css:), reserved ::: blocks, comments, notes, code and math fences, and text inside elements keep their own meaning. A footnote definition [^id]: … becomes a footnote of the page, and a run of only footnote definitions makes no box.
    • Lines starting with [ in column 0: lines When brackets are an element reads as text ([1] Smith 2020., [NOTE] check this, [docs](url), [[wiki]], [0, 1) and the like) go into the box as ordinary text. Half-made element lines — those reported as missing-colon ([title Koma], [box x=10%], a block whose opening line has no :) and as unclosed-element (a half-typed [ti, or [main before its ] is written) — are not put in a box and not drawn, and the diagnostic is given. Lines directly on the page after an element without a close are its content (its ] is still missing), and no box is made up to the end of the page. This is a syntax rule by a line's first character, so that half-typed source does not make the drawing flicker.
    • Reports: like other flowing elements, flow-over-slots is reported only when the page's area overlaps a frame written on that page.
  • Document and page settings, comments and notes are not text for display. The content and placement rules of explicit elements such as body are kept.

Who decides size

An element's outer rectangle comes from the position and size written in the document, or else from the layout's default, and its content flows inside it.

How to write

To decide position and size, write x, y, w, h on the element.

Details

  • A theme document may define a layout's default rectangles, but never overrides positions and sizes written in the document. When the content does not fit, the text is shrunk (RND's fit) or the overflow is reported.
  • Shrinking (the rules for fitting text to its frame seen from the language): on a slide, an element that does not fit first narrows its stretchable gaps together and continuously: the space between items and paragraphs (lists, tables of contents, definition lists) from the theme's wide value (--koma-item-gap) to its narrow value (--koma-item-gap-min), and the block gap around display blocks towards 0.35em (HTML elements and reading order). A document's or a poster's gaps are its kind's and never narrow (Values per kind of page). If it still does not fit, or on a document or a poster, all its text sizes (body, headings, lead, code, captions, footnotes) are reduced together by the same ratio, the largest ratio that fits, down to half. The rectangle's position and size do not change. A page's subtitle (subtitle) and label (label) are never shrunk: they keep their size, and overflow is reported when they do not fit (Page layouts). Shrinking is decided for each slot and each element placed on the page; a size written in the document is used as it is when nothing overflows. A shrunk element is reported by koma check --layout as text-shrunk, with how many px of width or height would fit it at its own size (output specification).
  • Overflow: an element's content sticking out below or beside its rectangle, or a placement outside the page. Glyphs drawn slightly beyond their line's height (as Japanese faces do) are not overflow. A figure with only a width written is as high as its picture and caption, so the element holding it, not the figure, takes the overflow. When it does not fit even at half size, koma check --layout and koma export report the overflow.

Splitting an area

Columns and rows

Columns and rows are elements that split their parent's area across or down.

How to write

Write [col:] as many times as the columns you want across, and [row:] as many times as the rows down. To change the ratio, write weight ([col weight=2: left] and [col: right] give 2:1).

Example

Output of koma export

The body split into a wide left column and a narrow right column, with a vertical line between them.

Source

[title: Two columns, 2:1]
[main:
  [col .ruled weight=2:
    The left column is twice as wide as the right.
  ]
  [col:
    The right column
  ]
]

Details

  • The area split is in the parent: inside [main:] the body frame, inside a positioned [box:] that box, directly on a page the page's area (inside its padding, Placement).
  • In one parent, a run of [col:] with no text or other element between them is one split across, and a run of [row:] one split down. Unquoted text directly on a page is a [box:] (Placement), so between splits it separates the runs like an explicit [box:], and flows outside the splits at its natural height. Half-made element lines (missing-colon, unclosed-element) and the unclosed content after them are not drawn and make no box. Source order is never changed. A single [col:] is a split too (one area filling the parent). [row:] may go inside [col:], and [col:] inside [row:].
  • Size: weight is a positive finite number (unitless, 1 by default). What is left of the split's axis after the gaps is shared in the ratio of the siblings' weight (2 and 1, like 0.2 and 0.1, are 2:1, and both use all that is left). The ratio does not change when content overflows (overflow is reported). Zero, negative and non-numeric values are reported as bad-weight. Only the editing view draws them as 1; koma check and koma export do not pass, and no file is written.
  • Height of a split in the flow: a split across (a run of [col:]) is as high as its tallest column's content, and does not stretch to the frame's bottom. But inside an element whose file writes a height (h), inside an area of a split down that shares height, and in the flow directly on a page (when the split across is that flow's only item), the split across fills what is left of that height (Cards without positions; a split with a column holding only one picture does not fill in a row's area or directly on a page, since the picture keeps its aspect ratio) (overflow is reported if it does not fit). The columns side by side all take that height. Following elements come right below. Freely placed children do not count towards the content's height. When the content does not fit its parent, text shrinks or overflow is reported (Who decides size), and columns do not shrink — except that a run with a column holding only one figure or picture shrinks to the height that fits its parent, the figure shrinking with its column.
  • Column content: a column lays out its content from the top. When a column holds exactly one box with a visible ground, line or shadow (a style class, or a fill, line or shadow in style, or a callout) and nothing else, that box stretches to the column's height (content from the top; a callout centred vertically, Callouts). With several boxes, or text or figures beside the box, nothing stretches. When the column itself has a ground or line, that surface fills the column's height. When a column holds only one figure ([figure:]) with no width written and no height or a % height, or one picture-only paragraph (the column's height comes from its content, so a % height has no effect), the figure is drawn at the column's full width, fitted to the height if that is short (keeping its aspect ratio). A figure beside other things is drawn at its own size.
  • Gaps: the gap between a split's areas is gap in the style of the element holding the split (style="gap: 24px"). It is a look, so it is not written as an attribute (Elements). Two values are the row gap, then the column gap. Without it, the theme's default (--koma-gap). The gaps of that element's flow do not change. In an element without a split, gap is the gap of its direct flow (Cards without positions).
  • Dividing lines: when any [col:] of a run has the class ruled, a vertical line is drawn between each pair of adjacent columns; in a run of [row:], horizontal lines. The line has the theme's line colour (--koma-line, or else the text colour mixed lightly into the ground), is 2px wide, sits in the middle of the gap (half the gap on each side), and is as long as the split (for a split across, the height decided by the height rules above). PowerPoint draws a line at the same place, in the same colour and width.
  • Vertical alignment: [col:] and [main:] put what they hold at the top, middle or bottom of their frame with align-content in style (start, center, end; the same with safe). Without it, from the top. Column height follows the height rules above (columns side by side take the tallest one's height), so in two columns of a figure and text, center on the text column puts the text at the middle of the figure's height. The theme's and document's CSS can set a default per layout, as @layout content { main { align-content: center; } } (no new notation is added). When a frame holds a split, or only one stretched box or figure (a vertical flex), the same value works the same way (marked with data-align after drawing). In an aligned frame, the space below the last paragraph or element is 0, so the visible content sits at the middle or bottom. The single HTML file is written with the same positions.
  • The first heading in a column has no space above it. The space between a heading and its text stays the theme's heading gap.
  • Height of a split down: inside a parent of set height (the body, an element with h, an area of a split down that shares height), when a split down (a run of [row:]) is the only thing in that parent's flow, the rows share the parent's height in the ratio of weight. A split down beside other things has its content's height, like a split across. A split down in a parent whose height is not set is reported as split-unresolved: the editing view draws its content flowing down as it is, and koma check and koma export do not pass.
  • Flow gap (the theme's --koma-flow-gap, 1em by default): in the body frame, inside elements, in columns and in the flow directly on a page, when either of two things following each other down is an element (a box, callout, figure, table, a run of [col:] or [row:], a [group:]) or a Markdown table, the gap between them is this one value. It is never less than an element's inner padding (--koma-style-pad-block). With gap written in the style of an element without a split, the gap of its direct flow is that value, and the inner padding is not a minimum (Cards without positions). Gaps between paragraphs, headings and lists stay the theme's text spacing.
  • Freely placed elements (x or y) do not join a split. A [col:] or [row:] with x or y is a free element, not an area. Even inside a split, it is placed in the parent's content rectangle (Elements).
  • Examples: [col weight=2: left] / [col: right] is two columns, 2:1. [col: / [row: top] / [row: bottom] / ] / [col: right] is two columns, the left one split into top and bottom (a [col: whose content runs over several lines closes with a ] at the end).
  • Figures side by side: when each [col:] of a run across holds exactly one [figure:], their picture areas line up. The area's height is that of the tallest picture with each figure fitted to its column's width, but no more than what the column leaves above its longest caption. Pictures sit at the bottom of the area keeping their aspect ratio, and captions start below it, so their first lines line up across. A caption (the content of [figure …:) may have several lines and inline notation; its alignment follows the box's text-align. If any figure has align-content written, that run is not aligned (it is placed as Elements says). PDF, HTML and PowerPoint are as drawn. There is no way to line up figures in a [row:] without wrapping each in a [col:].

A column is one flex

A column is one vertical flex that lays out what it holds from the top, the same whatever it holds.

How to write

What a column holds goes from the top in the order written. To make something as tall as its column, write it in its style: [box .tint style="flex: 1": …].

Details

  • A column's height is Columns and rows's: in a parent with a height of its own, columns fill what is left; elsewhere they are as tall as the tallest column's content. What a column holds never changes this.
  • A column is a CSS vertical flex. It stretches and shrinks nothing itself; flex: 1 fills the rest of the column, and height: 100% works as in CSS, where the column's height is set.
  • A figure or a paragraph of pictures with no size fits the rest of a column with a set height (Elements), and otherwise keeps its own size, up to the column's width. Figures side by side are not lined up by a rule of their own.

Cards without positions

Cards placed without positions line up their gaps and heights through gap in the parent's style and the rule that splits fill what is left of a parent of set height.

How to write

Write gap in the style of the element that holds the cards ([main style="gap: 24px": …]). To place them across, use [col:].

Example

Output of koma export

Three cards, Reading room, Swap table and Lounge, side by side with equal gaps.

Source

[title: Three rooms]
[main style="gap: 24px":
  [col:
    [box .card style="flex: 1":
      Reading room
    ]
  ]
  [col:
    [box .card style="flex: 1":
      Swap table
    ]
  ]
  [col:
    [box .card style="flex: 1":
      Lounge
    ]
  ]
]

Details

  • Per-element flow gap: gap in the style of an element without a split is the gap between the elements of its direct flow (in place of the theme's flow gap, --koma-flow-gap). When written, the element's inner padding is not a minimum (more padding on a card does not change the gap between cards). In an element with a split, it is the gap between areas (Columns and rows). PowerPoint and HTML keep the gap as drawn.
  • A split across in a parent of set height fills what is left: besides an element with h, in an area of a split down that shares height and in the flow directly on a page (when the split across is that flow's only item), the split across fills what is left of the parent's height. Columns side by side take that height, and a column's only box with a surface stretches to the column's height (Columns and rows).
  • Koma has no run that wraps to fit the number of children.
  • A split across with a column holding only one picture does not fill what is left in a row's area sharing height or in the flow directly on a page; the picture is drawn at the column's width (Columns and rows). A picture keeps its aspect ratio, so it is not stretched. Inside an element with h, it does fill what is left.

The core tree and the syntax tree

The core tree

The core tree is the internal tree made by reading a .koma file; it is not a published text language.

How to write

Nothing is written by hand. There is no text form for reading or writing the core tree; the .koma file is the only original.

Details

  • What it must do (requirements): keep the source (writing back from the GUI touches only the written range, Writing back from the app); keep meaning (role, content, reading order, footnotes, links) through placement; know where in the source each element came from and whether it can be edited. Drawing and output are made from this tree (the layer boundaries are the design of the layers).
  • Unknown names and attributes are kept, not removed, and reported.
  • Its current form (not a requirement; names, the number of kinds and the mapping to Pandoc may change): the parser scans a .koma file into the Koma AST (a unist-compliant syntax tree), and from it a read-only display model (Document) is computed. A box is the general node koma; pages and notes are told apart by role. Attribute names (such as layout) are internal names, separate from the text written (the terms are in docs/glossary.md). The text nodes (p, h, ul, table, fn and so on) are the vocabulary of the current drawing. A function that writes the tree as [head attributes… children…] is kept only for tests and debugging, and its output is never read back.

The implementation is src/core/lang/ast/tree.ts (types) and src/core/lang/parser.ts (parseKoma(source) builds it; parseWithDiagnostics(source) also returns diagnostics). Node kinds, their fields and positions are covered by conformance (see Conformance) and, with the kinds of sourceLine, change only under the language's compatibility policy. data and its content (such as the scanner's records of lines, the Internal column of Syntax tree nodes's table) and the internals of the implementation that builds the tree are not. Each change to the promised shape also takes the next AST version (The AST version).

Syntax tree nodes

Each node of the Koma AST holds set fields for its kind (type).

How to write

Nothing is written by hand: parseKoma(source) builds the tree. A tool that reads the tree reads the fields in the table below and the kinds of line.

Details

  • Every node has a type and its source range position. A node that holds source lines keeps, in data, the scanner's record of each line (so the semantic reading can rebuild lines from the tree alone). data is internal and not promised: its values and shape may change between versions, so tools that read the tree read the Fields and the line kinds, never data.
typeParentFieldsInternal (not promised)Meaning
rootyeschildrendata.openFence (the mark of a fence left open at the end, else null)The whole document. Its direct children are the document settings and blank lines and comments before the first page
pageyeschildren, body (from after the delimiter and complete settings to the next page), boundary (the +++ line; absent on the implicit first page)noneOne page. Pages divide the source without gaps (the line break just before the next page belongs to this page)
settingsyesscope (document or page), body (inside the delimiters), children (sourceLine)noneA closed YAML settings block. Values are interpreted separately
notesyesbody, closed, children (sourceLine)noneNotes ("""). Elements and delimiters inside are isolated as content. Unspoken [[ blocks are part of the body (Elements)
memoyesattributes (tagToken, each an attribute assignment of the opening ::: line), body, closed, children (sourceLine)noneA memo (::: key=value … :::) on a page. Its text is isolated as content and never output (Memos)
elementyestagName (the name, else null), children, opening and closing (a multi-line element's opening and closing lines; closing has the bracket's position bracket and whether it is on the body's last line, inline)data.line and data.close (the scanner's records of the opening and closing lines)A bracketed element
elementTagyeschildren (tagToken)noneAn element's tag
tagTokenno (value)kind (selector, attributeAssignment, bareWord; selector is a tag name with any joined shorthands or a standalone ID or class shorthand; bareWord is a bare word outside the tag's grammar, kept as written, Elements), value (the word as written), and for attribute assignments separator (the position of =) and valueKind (the kind of the value as written), and for a list items (Value kinds in the tree)noneA word of the tag. Duplicates and invalid values are kept. What a value means (units, a colour or a reference) is not in it
sourceLineno (value)kind (the kind of line, in the table below), value, and when needed finding, fence (code, math), settingValueAtdata.line (the scanner's record of the line)One source line
rawno (value)valuenoneThe source of an element's body

A sourceLine's kind is one of these. Element lines (a one-line element, an opening line, a closing line) never become a sourceLine; they are the element and its opening and closing.

kindMeaning
settingA key: value line inside settings delimiters. settingValueAt is where its value starts (Page settings, Settings YAML)
setting-otherA line inside settings delimiters that the subset does not read (nesting, a list and so on)
frontA delimiter around settings: === for the document's, --- for a page's (Document settings, Page settings)
blankA blank line before a page's content (at the start of the file, after a page delimiter, inside settings)
pageA page delimiter +++ (Page boundaries)
attribute-lineA line of an element tag that continues after its opening line (Tag and content)
commentA comment line (Page boundaries)
blockedA line isolated with its block and reported: settings out of place or unclosed, an unused ::: block and so on (Document settings, Page settings)
notesA notes delimiter """ and the lines inside
memoA memo's ::: lines and the lines inside (Memos)
fencedA line inside a code fence or $$, and the fence lines. fence is code or math (Code and math are isolated)
literalA line of the body of a math, code or diagram element, kept as written
textA line of text. A bracket line that stays text says why in finding (When brackets are an element)
  • Ranges: position.start and position.end are half-open. Lines and columns count from 1, offset from 0, in UTF-16 code units. CRLF is two units and one line; a lone CR is one line too. A leading byte order mark in the input is included in positions.
  • Never dropped: the written order and duplicates of tag names and attributes; quoting; unknown settings; bare text; comments; unclosed YAML, fences and elements. Unreadable parts keep their source and diagnostics.
  • Unquoted text directly on a page stays as the page's sourceLine children. The semantic reading reads each run as a [box:] without position (Placement); the tree has no implicit box node, because the syntax tree shows only what is written, and where one box ends is a semantic decision made from the kinds of lines. In the semantic tree (Node) that box is a container with generated: 'unplaced-text' and no brackets in the source.
  • The tree and diagnostics round-trip through JSON.

unist

The Koma AST follows unist.

How to write

Nothing is written by hand; unist tools (such as unist-util-visit) walk the tree as it is.

Details

  • Each node type is built on @types/unist's Node, Parent and Literal, and the type checker ensures it. Point and Position are unist's, and offset is always present. As unist intends, data holds only line information for rebuilding the tree, never canonical values of the language (internal and not promised, Syntax tree nodes).
  • unist tools (unist-util-visit, unist-builder, unist-util-remove-position) can walk it, build it and strip positions. Positions are computed by an index of its own (positionIndex), which answers as vfile-location does.

Value kinds in the tree

An attribute assignment in the syntax tree (a tagToken of kind attributeAssignment) carries the kind of its value as written, and the items of a list.

Details

  • valueKind: word, number, percentage, dimension, hash, quotedString, valueList or invalid (an unquoted value of no kind, or a string or list that cannot be read). value is the word as written.
  • A list has items (each with valueKind, value and position, and a list item has its own items; an expression item's valueKind is expression).
  • What an attribute means (whether it takes a unit, a colour or a reference) is not in it: the semantic stage (the diagnostics in language-semantics.md) decides that.

The AST version

The promised shape of the Koma AST has a version, the AST version, and any change to that shape takes the next one.

How to write

Nothing is written by hand. koma parse --json names the version as astVersion and the library exports it as AST_VERSION; a tool checks the number before it reads the tree.

Details

  • The promised shape is what Syntax tree nodes to Value kinds in the tree list: the node kinds, their fields, the kinds of sourceLine, of values and of list items, and the positions. A change to any of them, even an added field or kind, takes the next whole number. data, the readable output and the parser's internals change without it.
  • Version n has its JSON Schema at https://komalang.org/schemas/koma-parse-v<n>.schema.json, with every node closed, so that a tool can tell a version it does not know from a broken tree. A published version's schema never changes; it stays in the package and on the site beside later ones.
  • The AST version is separate from the language version: a release that changes what notation means may keep the tree's shape, and the other way round.
  • The current version is 1.

HTML and reading order

HTML elements and reading order

Informative

The rules for HTML elements and reading order aim, step by step rather than by rebuilding, at output that can be explained as how slides ought to be built in HTML.

How to write

You never write HTML. The document's title becomes h1, a page's title h2 and # in the body h3, and the DOM follows the order of the source (or an explicit order of meaning).

Details

  • The language's core holds syntax, attributes, content, parent and child, and the mapping to the source; it holds no HTML elements. A shared resolution of meaning decides roles and ownership — the document's title, a page's title, subtitle, label, footer and so on — from explicit roles, slot names and templates, never from coordinates or id strings. HTML drawing maps the decided roles to elements.
  • The outer shell of every source element is always div.koma. id, class, data-role, the source range, placement, background, border and padding are on the shell. The same identifiers and .koma are never repeated inside.
  • The document's title is the document's h1; a page's simple title text is an h2 inside the shell. One phrasing block (with emphasis, links, code, line breaks and inline math) becomes the heading. A title holding several paragraphs, a list, a table or child elements keeps all its content as flow in source order, and gives the warning complex-title-content. No first paragraph is extracted, no heading hidden, saving is not refused, and nothing is fixed automatically.
  • Simple text of label, subtitle and the like is an inner p; body and box are natural flow elements. Separate elements are not wrapped in hgroup.
  • Reading order and meaning are kept apart from placement. The DOM follows the source order (or an explicit order of meaning). Nesting depth does not become heading level. Placement and the theme decide position and look, and never switch the elements of meaning.
  • HTML export uses the same HTML rules as drawing. Containers such as hgroup never break each element's id, its mapping to the source (data-from, data-to), or the basis of coordinates. Tests check the DOM structure, reading order, visual regressions and the mapping to the source.
  • Heading levels: the document's title is h1, a page's title h2. Headings in the body, in plain text or inside elements, are h3 for #, h4 for ##, and one level deeper for each further mark, down to h6 (Text inside elements). Body headings never make h1 or h2. Levels do not change with whether there is a [title:] or with nesting depth. A # in a figure caption is an h3 inside figcaption. The levels read aloud in HTML and PDF are these; PPTX copies the drawn look (bold at the size of the body text).
  • h3 to h6 are bold at the effective size of the text around them, with a small space below, adjustable with --koma-local-heading-gap and not added to paragraph spacing. Figure titles follow the effective size of the caption text.
  • Vertical spacing in slide bodies and boxes follows three rules, all closed up together when fitting. (1) A local heading keeps its small space below (--koma-local-heading-gap) and has 1.35em above it after a paragraph, list or display block. (2) Paragraphs have no space above, so a paragraph after a heading keeps the heading's space; consecutive paragraphs are set apart by the space between list items (--koma-item-gap). (3) Every other block has the same space above and below, the larger where two meet: a list or definition list the space between items, a display block (display math, code, table, quotation, diagram, figure, grid) the block gap, from the theme's --koma-block-gap towards --koma-block-gap-min (0.35em). Only one side of each pair carries the space, so nothing adds up in a column. The first block has no space above it. Element flows keep their flow gap (Columns and rows). Captions, table notes, footnotes, list items and the parts of a grid or figure keep fixed spacing. Documents and posters keep their kind's fixed spacing, never closed up (Values per kind of page): a paragraph or a list under a heading at the heading's gap, items at the item gap, paragraphs and a paragraph and a list at the paragraph gap, a display block at the block gap, and a heading 1.35em after a block, which gives up its own margin. The editor draws the same spacing.

CSS motion and stepped elements

An authored CSS animation or transition on a stepped element plays in presentation and HTML. PowerPoint retains the entrance effect and reports omission of the CSS motion with step-css-motion-not-exported.

How to write

Use the existing CSS syntax. For example, apply box.reveal { animation: slide-in 300ms; } to [box.reveal step=1: …].

Details

  • The note applies to an element with a valid step when authored theme or document CSS sets nonzero transition-duration or an animation-name other than none. The built-in entrance effect itself (Entrance effects) is outside that check.
  • Presentation, HTML, and embeds play the authored CSS motion, including when it coincides with an entrance effect. See the document CSS rules.
  • Give one informational step-css-motion-not-exported finding per affected element in Problems and koma check. Advise using step-effect to obtain a PowerPoint entrance. There is no automatic fix for mapping arbitrary CSS motion to the three effects. A note alone does not fail koma check.
  • Suppress animation-static on the same element. PDF and PNG still use their normal static output.

Diagnostics

Diagnostics never rewrite the source. For most errors the source is isolated and the rest is drawn; whether export works is given by the Export column (✓ exports, ✗ is refused by koma export and the app's export). Severity follows what happens to what was written. An error refuses export or leaves written content out of the output. A warning means the output is made but may differ from the author's intent. A note only informs. koma lint and koma check exit with 0 when there are only notes, and 1 when there is a warning or an error.

Every diagnostic says how to fix it as well as what happened: what to write or change on which part of which element, with the attribute's name and the value's form when known (x=40%, step=2). The app says it in English and Japanese; the command line gives a short English fix at the end of each text line and as advice in each --json diagnostic. Diagnostics marked "one fix" have that fix written by koma check --write, and their advice says so. A fix also marked "may change the meaning" can change what is drawn, the structure or what is read, even where the page looks the same: koma check --write leaves it, and it is made when chosen one by one in the GUI or with koma check --write --unsafe, which the advice names.

CodeSeverityExportMeaningFix
missing-colonError✓An element-shaped line (When brackets are an element (a)–(c)) has no :. It is not an element, goes in no bare-text box, and is not drawn. A multi-line form is held back with its content and children (Tag and content, Placement)Write : at the end of the tag (after the name, when a known tag name is followed by a word); one fix, may change the meaning. To keep it as text, start the line with \
bare-wordWarning✓A word without = in a tag. Its source is kept, but it does nothing (Elements)Write it as key=value or remove it (rtl too; no fix offered)
group-attributeWarning✓An attribute other than #id and classes in a group's tag. Kept, but has no effect (Groups)Remove it, or write it on an element inside
empty-groupWarning✓A group with nothing inside. Kept, and draws nothing (Groups)Remove it, or put elements in it
reserved-settingWarning✓The setting key koma is reserved for the future and sets nothing (Document settings)Remove the line
unsupported-declarationError✓A ::: name at the root is an unsupported declaration; its source is kept up to the matching ::: and not applied (Document settings)Write CSS in the document settings' css:
citation-unsupportedWarning✓Citations [@key] are not supported and are shown as written (Text inside elements)Use a footnote [^label]
empty-spanWarning✓[]{.class} or [ ]{.class}: brackets with no text, or only spaces, are not a span and are shown as written (Text inside elements)Write text inside, as [answer]{.blank} or [\_\_\_\_]{.blank} for an answer blank
empty-definitionWarning✓A line with only a colon is drawn as text with no description (Definition lists)Remove the line (one fix, may change the meaning)
unknown-classWarning✓The class in [text]{.class} is written in neither the theme's CSS nor the document's css:. The text is drawn as is (Text inside elements)Use .chip, or write the class in the document's css:
theme-slot-no-geometryWarning✓A sample in a theme document that names a frame has no valid position and size, so it defines no frame (Frames from sample elements)Write x, y, w, h in % or px
theme-slot-duplicateWarning✓A second sample in a theme document defines the same frame; the first is used (Frames from sample elements)Remove the second, or rename the frame
theme-layouts-unusedNote✓The document’s theme folder (for a theme document, its own folder) holds a layouts/ folder; Koma does not read it (The source of a theme)Nothing has to change; define layouts in theme.koma
type-not-setNote✓The size is paper and there is no type; the document is drawn as slides (Kinds of page)Write type: article for a document, type: poster for a poster, or type: slide to keep slides on paper
type-unused-featureNote✓A document or a poster holds something only slides use (speaker notes, step, skip, duration, total-duration); the source keeps it and it is not used (Kinds of page)Nothing has to change
delimiter-text-reservedWarning✓Text after ===, --- or +++. It is a reserved area and means nothing (Page boundaries)Remove the text after the delimiter
unclosed-settingsError✗=== or --- settings do not close; isolated up to the next +++. For a page's ---, adds "a page break is +++" (Page settings)Add the closing line
bad-yamlError✗The settings YAML cannot be read; none of the block is applied (Settings YAML). Suggests quoting a value with :, and for a page's --- adds "a page break is +++" (Page settings)One key: value per line, indented with spaces
duplicate-settingError✗The same setting key twiceRemove one
unknown-settingWarning✓An unknown setting key; its source is keptFix the spelling or remove it
bad-setting-lineWarning✓A line that cannot stand in a settings blockWrite it as key: value
setting-out-of-scopeWarning✓A document-only setting (title, size) on a page. On the first page, adds that document settings go in === (Page settings)Move it to the document settings
setting-not-appliedWarning✓A written setting takes no effect (such as logo-alt with no image in effect)Write the setting it pairs with, or remove it
misplaced-settingsError✓A --- in column 0 after a page's content. That one line is not shown and later lines are not isolated; adds "a page break is +++". A second settings block in the preamble is isolated (Page settings)*** for a horizontal rule, +++ for a page break (two fixes)
tab-indentWarning✓A line inside an element indented with a tab. Read with the tab as two spaces it would be an element at that depth, but as written it is drawn as text (The standard form)Turn the tab into two spaces (one fix, may change the meaning)
root-outside-mathWarning✓√ before a digit, letter or bracket outside math. Only the sign is drawn, without the bar over the radicand (Text inside elements)Write $\sqrt{…}$ (one fix, may change the meaning)
dashes-not-ruleWarning✓A line of only --- inside an element or bare text. It is not a rule and is shown as written (Text inside elements)For a horizontal rule write *** (one fix, may change the meaning)
misplaced-scoped-blockError✗::: is a reserved mark with no use. In the document's preamble or on a page, it is isolated up to the matching ::: (Document settings)Write CSS in the document settings' css:, and select pages with the page class and page.class
css-file-unavailableError✗The CSS file css: points to is not in the document's folder, cannot be read, is not UTF-8, or is too large. Only that file is left out (Document settings)Fix the path, or put the file in the document's folder
unclosed-notesError✗Notes """ do not close; isolated up to the next page breakAdd the closing """
unknown-note-attributeWarning✓An unrecognised attribute on the notes' opening line, including the retired speak (Elements)Remove the attribute
unclosed-memoError✗A memo's ::: does not close; isolated up to the next page break (Memos)Add the closing :::
unknown-memo-attributeWarning✓An unrecognised attribute on a memo's opening line (Memos)Remove the attribute
notes-timeNote✓The page has no duration: and the first line of its notes (blank and ; lines aside) has the form 0:59 + 0:04 = 1:03. Notes are not read as time (Planned speaking time)Move it to the page's duration: (one fix, may change the meaning: the value right of =, else the sum; notes with nothing else are removed with it)
flow-over-slotsWarning✓The page's area where elements written directly on the page without x and y flow (inside the page's padding) overlaps the rectangle of a frame written on the page (title, main and so on). Drawn as is (Placement)To put it in the body frame, write it inside [main:]
unknown-tagError✓A tag neither built in nor in the theme. That element is not drawn (When brackets are an element)Fix the tag name or define it in the theme. To keep it as text, start the line with \ (\[Note: …])
unclosed-elementError✓An element has no closing ]. Its tag line stays in the source but is not drawn, and directly on a page the bare text up to the end of the page makes no box (Placement)Add a ] at the same depth
stray-close-lineNote✓A line of only ] with no matching openingRemove it, or write \]
deep-headingNote✓A heading written with ## to ######. It is read as a heading one level deeper per mark, and looks the same as # (Text inside elements, HTML elements and reading order)Write it with one # (one fix, may change the meaning)
name-without-colonNote✓A bracketed line with only a name, and a known one (a built-in tag name, a theme's tag or frame name: [title], [box]). Without :, it is drawn as text. Unknown names ([AM1], [NOTE]) are not reported (When brackets are an element)For an element, write : ([title:]); to keep it as text, \[ also works
unclosed-fenceWarning✓A code or math fence does not closeAdd the closing mark
duplicate-slotWarning✓The same slot twice on a page. Both are drawn, overlapping when they have no position (Kinds of name)Write positions, or keep one
slot-not-in-layoutWarning✓A slot the layout does not haveChoose a layout with that frame, or use another element
unknown-layoutWarning✓An unknown layout name; drawn with content's placement (Page layouts)Use cover, section, content, blank, or a layout the theme defines
custom-layout-unresolvedWarning✓A theme layout cannot be resolvedWrite the layout's frame elements directly on the page, not inside other elements or between bare text
complex-title-contentWarning✓title holds paragraphs, a list, a table or child elements (HTML elements and reading order)Make the title one paragraph, and move lists, tables and elements to [main:]
duplicate-attributeWarning✓The same attribute twice; the first takes effect (Elements)Keep one
presentation-attributeWarning✓A look written as an attribute (gap=, opacity=, color=, fill=, stroke= and the like). Looks go in classes or style, so it has no effect; the source is kept (Elements)Move it to style (one fix when style can read the value; may change the meaning)
unknown-attributeWarning✓An attribute with no prefix that the language does not have ([box foo=1: …]). It has no effect; the source is kept as written. A look's name is presentation-attribute, and attributes starting with data- are not reported (Elements)Check the spelling. For your own attribute, add data- (data-foo=1)
line-label-contentWarning✓A line's body holds a block other than one paragraph (a list, a table, a heading, a second paragraph, or a child element)Keep the line label as one paragraph of text, math, or line breaks, and move other blocks into a box
label-at-unusedNote✓label-at or label-side on a line that has no label text; it has no effect and the source is keptWrite label text in the line's body, or remove label-at / label-side (one fix)
line-no-heightWarning✓h on a line. A line runs from end to end and has no height, so it has no effect (Elements)Remove h (one fix); move the ends with x1, y1, x2, y2
invalid-unquoted-scalarWarning✓An unquoted value that is none of a word, a number, a percentage, a dimension or a value starting with # (src=assets/a.svg, alt=日本語, f=drive(t)). The source is kept and it reads as a string (The kinds of a value)Put the value in double quotes (one fix; koma format --write writes it too)
image-bodyError✓Text written in the body of an image ([image:]). An image has no body, so the source is kept and not drawn (Figures and images)For a caption, wrap it in a figure and write the text after the image ([figure: … ]; one fix, which may change the meaning)
figure-attribute-ignoredWarning✓src, alt or crop on the tag of a figure that holds an [image:], or an #id, class, place, size, style, step and the like on the [image:] inside a figure. A figure takes its picture from the [image:] and its place and look from the figure, so these have no effect; the source is kept (Figures and images)Remove it, or move it where it counts (the picture to the [image:], placing to the figure)
figure-child-unsupportedWarning✓An element in a figure that is not one a figure shows (an image, chart, diagram, math or code). The source is kept and it is drawn in the same row as what is shown (Figures and images)Move it out of the figure. A table has its own caption, so it is not wrapped in a figure
legacy-page-gridWarning✓The theme's or the document's CSS writes a grid on page (display, grid-template-rows and the like). The layout's grid is the page body's now, so those declarations are left out and the rest of the rule applies (Layout grids)Write the grid on page-body; koma format --write rewrites it so the frames stay where they were
part-selector-unmatchedWarning✓The theme's or the document's CSS names an HTML name Markdown draws (ul, li, strong and the like) in a form that selects nothing (ul { … }, box > li { … }). That rule alone is not applied (Markdown parts in elements)Write a part inside an element (box li { … }), a part alone (li { … }), or parts joined by + (p + ul { … }). Style text with text classes (Text inside elements)
role-contrastNote✓The automatic text colour chosen on a role colour does not reach a 4.5:1 contrast ratio.Adjust the role colour or specify a text colour that reaches at least 4.5:1.
radius-on-ellipseWarning✓radius on an ellipse shape. An ellipse has no corners, so it has no effect; the source is kept (Shapes)Remove radius (one fix)
shape-border-radiusWarning✓border-radius in a shape's style. A shape's corners are its radius alone, so it has no effect (Shapes)On a rectangle, move it to radius (one fix; it may change the meaning); on an ellipse, remove it (one fix)
unknown-targetWarning✓The #id in a line's from or to is not on the same page (missing, or on another page). The line is not drawn; the source is keptWrite the #id of an element on the same page, or give the end as coordinates
line-end-overriddenWarning✓from and x1, y1 (or to and x2, y2) on the same end of a line. The connected end wins and the coordinates have no effectRemove the coordinates
line-points-overriddenWarning✓A line with points also has x1, y1, x2, y2, from, to (with sides and positions) or route. points wins and the rest have no effectRemove all but points
missing-unitWarning✓A length without a unitWrite % or px (x=40% and the like)
bad-unitWarning✓A unit that is not acceptedUse % or px (w=40% and the like)
bad-valueWarning✓A value of the wrong type or range (step, style, marker empty or with a line break, escapes in quotes and the like). A list that cannot be read (a trailing comma, an empty item, a parenthesis left open), a list with another number of items than its attribute takes (crop 4, domain and range 2, points two or more lists of two numbers), an expression in a list whose attribute takes none, or an unquoted value starting with { (Lists of values). A curve's f cannot be read or uses an unknown name (named), range is not two different values, or a functions: definition cannot be read or is recursive (Curves from a formula)Fix the value. The command line gives each attribute's form (step=2, rotate=15, dir=rtl, crop=(0, 0, 10%, 0), paginate: true and so on)
text-markerWarning✓Text in a callout's marker= (not one emoji or symbol, as marker=Note). Kept, and 💡 is drawn (Callouts)Write one emoji or symbol, or none. Write a text heading as a definition list (a term on one line, its description on the next starting with : ; Definition lists)
zero-sizeWarning✓w=0 or h=0Write a size or remove the attribute
bad-sizeWarning✓The document's size cannot be readWrite 16:9, 4:3, a paper size such as A4 landscape, or two lengths such as 1280 x 720
bad-weightError✗weight is not a positive number (Columns and rows)Use a positive number (weight=2 and the like)
split-unresolvedError✗[row:] inside a parent without a decided heightGive the parent a height (h, or a frame with a height)
step-effect-unusedNote✓The element shares its parent's step or neither it nor any descendant has a step.Set the effect on the parent or use a separate step.
step-css-motion-not-exportedNote✓Authored CSS motion on a stepped element is omitted from PowerPoint.Use step-effect for the entrance effect in PowerPoint.
unsupported-rotationWarning✓rotate on an element that cannot rotateRemove rotate, or rotate an element directly on the page without nested elements
missing-logo-altWarning✓The logo image has no alternative text (The document's logo)Write logo-alt (logo-alt: "" for decoration)
duplicate-footnoteWarning✓The same footnote defined twice on a page (Footnotes)Remove one
duplicate-idWarning✓The same #id twiceRename one #id
font-unavailableWarning✓A face the document names is not on the computer; another face is drawn (Text faces)Install the face, or use a face koma ships (sans, mono)
chart-not-numberWarning✓A cell of a chart's value columns is not a number (1,234, 12%, 3 s); it is drawn as a missing point, the first such cell's row and column saidWrite the number without separators or units
chart-data-conflictWarning✓A chart's data is written in more than one of its body's CSV, src and f; the source is kept and only the frame is drawnKeep one
chart-no-dataWarning✓A chart has no data, or a header row aloneWrite a header row and rows of values
csv-unevenWarning✓Rows of a CSV/TSV have different numbers of columns; missing cells are left emptyGive every row as many items as the first
animation-staticWarning✓Animation was left out of still output (PDF, PNG, PowerPoint)Nothing to do (a notice). Export HTML or present to keep the motion