How to add hyperlink (via link?) to an image in header?

I have this:

#set page(
  "a4",
  margin: (top: 25mm, x: 20mm, bottom: 10mm),
  header: [
    #place(right, dy: 4mm, [#image("logo.png", width: 25mm)])
    #line(length: 100%)
  ],
)

But I want to make this image in the header “clickable” to an URL, e.g., www.example.com.
Is it possible? How?

Never mind, I tried this and it worked:

#set page(
  "a4",
  margin: (top: 25mm, x: 20mm, bottom: 10mm),
  header: link("https://www.example.com")[
    #place(right, dy: 4mm, [#image("logo.png", width: 25mm)])
    #line(length: 100%)
  ],
)
1 Like

It should be as simple as surrounding the call to image with a call to link.

#set page(
  "a4",
  margin: (top: 25mm, x: 20mm, bottom: 10mm),
  header: [
    #place(right, dy: 4mm, link("www.example.com", image("logo.png", width: 25mm)))
    #line(length: 100%)
  ],
)
1 Like