How can I link from a word to a description list?

Hi all, newbie here! I would like to be able to use Typst, but in trying to convert an example Word document, I already came up with issues in the first paragraph.

What I would like to see is the possibility to reference a word/words to a description list (and if that could be in table format, that would be even better).

So an example sentence would be: ... we would like to introduce @typst which is a way to create @markup of a document.

@typst would then show as italic ‘typst’ and be clickable to go to the glossary page. The same for @markup.

And the glossary would be:

  • “typst”, “A markup-based typesetting system.”
  • “markup”, “A way to annotate text for formatting.”

I have tried quite a lot of approaches, but it seems it is not possible?

Hi, on Typst Universe are a few packages which can be used to create a glossary. I personally like glossy the most.

Hi @martino, welcome to the forum! I’ve formatted your question a bit so that the Typst syntax does not collide with forum syntax. Could you further try to revise your post’s title to be a complete question as per the question guidelines:

Good titles are questions you would ask your friend about Typst.

A good title makes the topic easier to grasp, increasing your chances of getting a good answer quickly. We also hope by adhering to this, we make the information in this forum easy to find in the future. Thanks!

Hi @SillyFreak, thanks for the formatting! I indeed changed the title of the question more into an actual question.

Sure it’s possible. This is a pretty bare bones example with an imagined glossary and adapted references so that the syntax @typst can be used to link to the glossary.

#import "@preview/t4t:0.4.3" 
#let glossitem(word) = {
  // TODO: fix label in case the word is not a valid label
  let labelname = lower(t4t.get.text(word))
  [#word#metadata((word: word))#label(labelname)]
}

// Use `ref` to customize `@xyz` syntax.
#show ref: r => {
  let elt = r.element
  if type(elt) == content and elt.func() == metadata and type(elt.value) == dictionary and "word" in elt.value {
    show link: underline
    let display-text = if r.supplement != auto { r.supplement } else { elt.value.word }
    link(r.element.location(), display-text)
  } else {
    it
  }
}

we would like to introduce @typst which is a way to create @markup[the markup] of a document.

= The Glossary

/ #glossitem[_Typst_]: Describe Typst
/ #glossitem[markup]: Describe Markup

Before you go so deep into implementing this - I would expect that one of the existing glossary packages out there already implement this.