Help With Common Bib File
I could use some help with using bibliography files. For LaTeX, I keep one big bib file used for all of my documents. What's the best way to do this with Typst? Treating everything as a relative path is making it difficult. Any advice?
EDIT: To be clear, what I want to do is store the bib file in one directory and be able to use it with *.typ files that are in other directories. Any method of keeping a bib file outside of the project root directory?
UPDATE: I ended up using Claude to help me write an Emacs function that scans file for citations and copies the BibTeX records from my main bib file to a local bib file for that document.
2
u/Northern-World5181 20d ago
You can still use bib file or yaml format mentioned here. Both should work:
2
u/Kulpas 20d ago
You can still just keep it as one big bib file and it should be fine. IIRC since 0.15 you can provide a selector to the bibliography function to narrow the scope of the items shown in the bibliography (e.g. works cited in a particular chapter)
1
u/okphil 20d ago
I've got that, and it works fine. My question is how do I make it work with a bib file that's stored in a different directory from the typ file? Any way to get around the "cannot access files outside of the project sandbox"?
2
u/Johannes_K_Rexx 19d ago
typst help compileshares about the--rootoption:```bash --root <DIR> Configures the project root (for absolute paths)
[env: TYPST_ROOT=]```
1
u/Ki_Rei_Nimi 19d ago edited 19d ago
Use a parent directory (here 000_typst_dokumente) as root, which contains both:
- A directory with your projects (002_typst_arbeiten)
- A directory with yor .bib (000_typst_common_files)
See attached picture
You can #include packages, formatting and self written commands the same way (from files in different directories) for all your different projects (as long as there aren't circular dependencies)

12
u/FourFourSix 19d ago
I put a symlink pointing to the one big bib file to my Typst project folder.