Olaf
July 7, 2025, 3:57pm
1
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 ?
I figured it out. The default layout of terms is “approximately” equals to
show terms: body => {
body.children.map(it => pad(left: body.indent + body.hanging-indent, {
box(inset: (left: -body.hanging-indent), it.term)
body.separator
it.description
})).join()
}
So you can adjust the style of it.term in this show-set rule
bluss
July 7, 2025, 4:43pm
3
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.
#show strong: it => {
set text(red)
it.body // take the text out of `strong` to unbold it
}
/ A: 1
/ B: 2
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