How to store and use imported templates locally?

I am very new to typst

I made a file and want to use the may theme

#import "@preview/may:0.1.2": *
#show: may-sans

I find no way to download and use this theme locally? I suppose it is downloaded and cached somehow, but where is it saved? How could I save it locally, as easy as importing it (not by going to some repo and downloading some file?)

I couldnt find the theme in my home directory (Linux)

1 Like

Welcome! Generally, typst packages will have their repository listed under “About > repository” of their typst universe page. In this case, the listed repository is here: GitHub - Carlos-Mero/may: A simple and elegant document template for multiple daily tasks. · GitHub

You’re right that it’s saved locally. The documentation for packages states:

Also, if you are using e.g. vscode + tinymist you can use ctrl + click to go to the package’s files directly.

So if you want, you can edit the files in there directly. This isn’t really recommended, as (for example) you might change package behavior and so updating them might cause unwanted issues. Instead, the documentation linked above describes how to make a local pckage. Essentially, you would move the file from packages/preview to packages/local

3 Likes

Thanks! Well, my search must have skipped dotfiles. I found all the cached packages there.

If I move them all to another directory, I guess I can change their reference and point to them instead, which works for me.

I will check the docs you linked.

This question is solved I suppose, on to the next one!

If you are moving the package from the preview namespace to the local namespace, you should import them in your typst files using #import @local/<name>:<version>, rather than using symlinks or similar.

If you are happy with the answer, please use the checkmark to mark it as a solution so that other users can find it more easily :smile: