How do I specify the bib file's location via a package property/argument?

Hello, i am building a template. One of its properties (passed to with) is a path to the bib file, so that the template can display bibliography in the correct location. However, due to how relative paths work, it obviously cannot find the file that is in the consumer’s project.

So I tried to pass the file content directly, like you do for Typst files with #include. But… you can’t? So how do i let consumers specify the bib file location?

Edit: found a trick by making the consumer pass read("biblio.bib", encoding: none). Ugly but might the best typst allows right now?

That seems to be the proper way.

See How to provide assets (image files) with a template so that they could eventually be overwritten? - #3 by Andrew

1 Like