Universe
Version 0.1.0

The koma-labeling package for Typst is inspired by the labeling environment from the KOMA-Script bundle in LaTeX. It provides a convenient way to create labeled lists with customizable label widths and optional delimiters, making it perfect for creating structured descriptions and lists in your Typst documents.

Getting Started

To get started with koma-labeling, simply import the package in your Typst document and use the labeling environment to create your labeled lists.

#import "@preview/koma-labeling:0.1.0": labeling

#labeling(
  (
    (lorem(1), lorem(10)),
    (lorem(2), lorem(20)),
    (lorem(3), lorem(30)),
  )
)

// or

#labeling(
  (
    ([#lorem(1)], [#lorem(10)]),
    ([#lorem(2)], [#lorem(20)]),
    ([#lorem(3)], [#lorem(30)]),
  )
)

Output:

图片

Note: Remember to terminate the list with a comma, even if only one pair of items is passed.

#import "@preview/koma-labeling:0.1.0": labeling

#labeling(
  (
    (lorem(1), lorem(10)),  // Terminating the list with a comma is REQUIRED
  )
)

Parameters

Although labeling is implemented using tables, its usage is similar to terms, except that it lacks the tight and hanging-indent parameters. If you have any questions about the parameters for labeling, you can refer to terms.

labeling(
  separator: content,
  indent: length,
  spacing: auto length
  pairs: ((content, content))
)

separator

The separator between the item and the description.

Default: [:#h(0.6em)]

indent

The indentation of each item.

Default: 0pt

spacing

The spacing between the items of the term list.

Default: auto

pairs

An array of (item, description) pairs.

Example:

#labeling(
  (
    ([key 1],[description 1]),
    ([keyword 2],[description 2]),
  )
)

Additional Documentation and Acknowledgments

For more information on the koma-labeling package and its features, you can refer to the following resources: