No option to align 'term list'

Hi!

Here ‘terms’ is described as ‘A list of terms and their descriptions.’ Being a ‘list’, I expect it to have some kind of functionality to align items like enums and lists, with a two-leveled type scheme. (One for the list type, and another for its elements.) However, this is not the case.

Why?

2 Likes

What do you mean by a two level type scheme specifically?

For various reasons I published tabbyterms – Typst Universe which simply transforms a term list into a table, which gives you the option to align items and descriptions in a different way than the default. (It’s also in the simplest case a transformation you could write down yourself in two lines of code.)

1 Like

Like we have list and list.item

Hi @AprilGrimoire ,

Styling of Terms list can already be achieved with show rules. Both term and description can be styled the way you want, in a list, a table, a grid, etc.

For example, to quote this code from @PgBiel: Discord

#let cool-terms(it) = {
  show terms: it => grid(
    columns: 3, row-gutter: .5em, column-gutter: (5pt, 0pt), align: (right, left, left),
    ..it.children.enumerate().map(((i, item)) =>
      ([#(i + 1).], item.term, " : " + item.description)
    ).flatten()
  )
  it
}

#cool-terms[
  / Term A: Definition A
  / Term B: Definition B
]
2 Likes

Aha, the terms element already has terms and terms.item.

1 Like

Oh! Interesting. I didn’t see ‘terms’ doing anything so I just assumed they don’t exist.