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
TypingManiac:
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?)
You’re right that it’s saved locally. The documentation for packages states:
Downloads
The Typst compiler downloads packages from the preview namespace on-demand. Once used, they are cached in {cache-dir}/typst/packages/preview where {cache-dir} is
$XDG_CACHE_HOME or ~/.cache on Linux
~/Library/Caches on macOS
%LOCALAPPDATA% on Windows
You may also run typst info and check Package cache path for the actual path
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
Local packages
Want to install a package locally on your system without publishing it or experiment with it before publishing? You can store packages in {data-dir}/typst/packages/{namespace}/{name}/{version} to make them available locally on your system. Here, {data-dir} is
$XDG_DATA_HOME or ~/.local/share on Linux
~/Library/Application Support on macOS
%APPDATA% on Windows
You may also run typst info and check Package path for the actual path. This would be helpful if you have installed the Typst compiler from Snap or are using special environment variables.
You can create an arbitrary {namespace}. A good namespace for system-local packages is local. Using this namespace:
Store a package in {data-dir}/typst/packages/local/mypkg/1.0.0
Import from it with #import "@local/mypkg:1.0.0": *.
Packages in the data directory have precedence over ones in the cache directory.
Note that future iterations of Typst’s package management may change/break this local setup.
3 Likes