[Guide](https://komalang.org/guide/) · 2 of 8

# Elements and text

An element’s name tells you its role. Inside it, write in Koma Markdown, a dialect based on CommonMark.

## Write an element

In `[title: Night at the library]`, `title` names the element, and the colon introduces its content.

```koma
[title: Night at the library]
[subtitle: Friday · 7–10 pm]
[main: Read, browse or bring a book to swap. The reading room stays open until ten.]
```

> Night at the library, Friday 7–10 pm. Read, browse or bring a book to swap; the reading room stays open until ten.

## Add emphasis

Start with the familiar: `*italic*` for italics and `**bold**` for bold. Koma also supports `==highlight==` and LaTeX math such as `$x^2$`. Some syntax differs from CommonMark: raw HTML is displayed as text. See the [text markup rules](https://komalang.org/spec/text/#inline-markup).

For a longer body, end the opening line with a colon, indent the content by two spaces, and close it with `]` on a line of its own. The sample uses both bold and Koma’s highlight syntax.

```koma
[title: Night at the library]
[subtitle: Friday · 7–10 pm]
[main:
  Bring a book to **swap**.

  ==No booking needed.==
]
```

> The library notice emphasizes “swap” in bold and highlights “No booking needed”.

## List terms and what they mean

Write a term on one line, then start the next line with `: ` and its explanation, as Pandoc does. Give a term with two meanings a second `: ` line; to carry one explanation onto the next line, indent that line instead. Terms sit on the left with their explanations beside them; the class `stack-terms` on the box puts each explanation under its term.

```koma
[title: Words we use]
[subtitle: For the talk on echoes]
[main:
  Echo time
  : How long a sound takes to fall by 60 dB,
    counted from the moment the source stops.

  Reflection
  : Sound bouncing back from a surface.
  : How much a surface sends back, which shapes how a room sounds.
]
```

> A slide titled “Words we use”: the terms Echo time and Reflection in bold on the left, each with its description beside it; Echo time has one explanation over two lines, and Reflection has two meanings.

## Space paragraphs, lists and blocks

Separate paragraphs with a blank line; Koma sets the space between them. A heading keeps a small space below it and a larger one above. Paragraphs that follow one another are as far apart as list items. A list, and a display block such as maths, code, a table or a figure, takes the same space above and below, and where two meet the larger one counts. When the text does not fit, these gaps close up together before the text gets smaller. A Japanese document breaks lines between phrases, not inside words.

```koma
[title: Reading room rules]
[main:
  # Before you sit down

  Leave bags on the shelf by the door.

  Phones stay silent after eight in the evening.

  - Return books to the cart
  - Ask at the desk for the late key

  $$
  t_{\text{quiet}} = 20{:}00 \text{ to } 22{:}00
  $$
]
```

> Reading room rules: the heading Before you sit down, two short paragraphs, a list of two items and a displayed time range, each set apart by its own space.

## Related rules

- [Elements and text](https://komalang.org/spec/structure/#deck-model)
- [Elements](https://komalang.org/spec/elements/#element)

- [Text inside elements](https://komalang.org/spec/text/#inline-markup)
- [Definition lists](https://komalang.org/spec/text/#definition-list)

- [HTML elements and reading order](https://komalang.org/spec/semantics/#html-elements)
- [What a theme decides](https://komalang.org/spec/styles/#theme)
