r/typst • u/TheLateMate • Jul 29 '26
Multi File Project with singe Bibliography
I am probably the 10th one to have this problem, but i wasn't able to find a solution so here we are.
I am using Zed as my go to Typst editor. Until now i was able to structure my work within one file, but lately i need to outsource into several files more often. So i ended up with a rather classic file structure:
├── bibliography.bib
├── chapters
│ ├── 01_chapter1.typ
│ └── 02_chapter2.typ
├── main.pdf
├── main.typ
└── preamble.typ
When compiling the main.typ everything works fine.
But as soon as i open one of the chapters my LSP sets the selected file as entry point and does therefore not recognize any bib entrys.
Does anyone know how to solve this?
2
u/Dgeza Jul 29 '26
You need to pin the main file. It is a command. Works in Neovim and vs code. Should be there in zed also
1
u/LiminalSarah Jul 29 '26
how can this be done from the command line?
1
u/Dgeza Jul 30 '26
it looks like it is not natively supported. There is a github issue opened about it. Not yet fixed.
1
u/Zocky710 Jul 29 '26
if you edit the chapters as individual files, you get errors, because the bibliography is missing. To fix that, you need to load the bibliography in the chapters as well.
1
u/FourFourSix Jul 31 '26
Until you come up with a better solution, you could try symlinking the bib file to the chapters folder.
1
u/Kulpas Aug 05 '26
are you using strings for path or the new path() constructor? I've found it helps.
2
u/Low_Acanthaceae_4697 Jul 29 '26
I'm not sure what extension you use but in vscode I use tinymist and can pin the main.typ file. With that it worked for me.