How do I underline URLs with display texts containing more than one character?

If the question is, for any particular link, how do I “cancel” that general show rule? It’s not always so easy, but for this underline rule it should be fine. Like this:

#show link: underline
Link target<K-1>

#link(<K-1>)[1]

#let nounderline(body) = {
  show underline: it => it.body
  body
}
#nounderline(link(<K-1>)[1])

So you can wrap anywhere you want to disable underline in your nounderline function.

2 Likes