Styling terms-item while keeping accessibility

I’m looking for a way to style terms-items but keep the accessibility tags.

I got the following working, but it doesn’t feel right / good:

#let definition(term, description) = {
    set terms(
      hanging-indent: 0pt,
    )
    let term = term + linebreak()

    terms((term, description))
  }

This gives me full styling possibilities but it looses the tags in the pdf (everything as a p-element instead of L > LI > Lbl (term) / LBody (description)):

  #show terms.item: it => [
    *#it.term*
    #linebreak()
    #it.description
  ]

Is there a better way to do this?

If you want a line break between the term and the definition, the easiest way is to set the separator:

#set terms(
  separator: linebreak(),
  hanging-indent: 0pt,
)
1 Like

This is actually a brilliant idea for my styling.But its not as generic as I think it should be.

Something like this would be great:

#show terms: it => [
  *#terms.term(it.term)*
  linebreak()
  #terms.description(it.description
]

This way it would be possible to create more complex styling, for example creating a box by using a grid for the layout or similar.

As in, you want a way to manually add the PDF tags back if you remove them? I suppose something like this could be supported through the PDF module. I recommend you to open a feature request through github [click new issue > compiler feature request].