Image from Hyperlink in Typst?

285 Views Asked by At

I'd like to embed an internet image in my presentation.

So far, I could not find a feature which allows me to enter a URL for that purpose.

This one does not work:

#figure(image("https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e"), caption: [Stack Overflow image])

It is looking for a local path in the current directory.

Or is it the reason that it does not work with the rendered PDF? Downloading and replacing the image link with a local path is likely not a functionality, isn't it?

1

There are 1 best solutions below

0
On BEST ANSWER

Typst does not do internet access for security reasons. It is, for all intents and purposes, sandboxed. You would have to download the image yourself and put it in a relative path to your project.

Absolute paths also don't work as-is for the same reasons, though there is the --root CLI option.