How to change the appearance of the terms in a term list?

The terms in a term list are normally displayed in bold. I would like the terms to be displayed regularly.

I have tried it with a show rule on terms.item, but I had no success. My show rule has changed the complete entry. I have not found a way to change only the term part.

#show terms.item: set text(fill: red)

/ Term A: #lorem(20)
/ Term B: #lorem(20)

Hi @Olaf, potential duplicate ?

There’s these two viewpoints and I think it’s funny to put them next to each other

  • it’s a pity Typst doesn’t have separate elements for term list term and description for styling (I think it will in the future)
  • Typst styles each term with strong by default so that is in fact pragmatically, how they are marked, and we can use that. :wink:
#show strong: it => {
  set text(red)
  it.body  // take the text out of `strong` to unbold it
}
/ A: 1
/ B: 2

terms with red terms

2 Likes

Using show terms.item, we can recreate the styling that you want. First, here’s a show rule to recreate the defaults:

#show terms.item: it => {
  strong(it.term)
  terms.separator
  it.description
  linebreak()
}

/ A: 1
/ B: 2

(mostly; I think there’s a small difference in that this doesn’t put the whole terms list in a paragraph/block?)

… based on this, it’s easy to create to formatting you want:

#show terms.item: it => {
  text(red, it.term)
  terms.separator
  it.description
  linebreak()
}

/ A: 1
/ B: 2
2 Likes