Is there a way to include multiple bibliography files?

Hi, newbie for typst here. Is there a possibility of including multiple .bib files?

In my research area, we mutually maintain a huge bibliography with several .bib files for most of the citations. Is there a way to include them together, maybe something like:

bibliography(“a.bib”, “b.bib”)

Thanks a lot!

Hi! The doc says that you can pass an array as sources, so the following will work.

#bibliography(("a.bib", "b.bib"))
3 Likes

Thanks so much! I totally forgot the parentheses :smile:
I have another question—I’ve noticed that separate .bib files don’t seem to support cross-referencing. For example, I have an abbrev.bib file with all my abbreviations using entries like @string{xxx = yyy}, but these don’t seem to be recognized in my other .bib files. Is there a way around this?

To be honest, I have never used the @string feature before.

The following might work.

#bibliography(bytes(("abbrev.bib", "ref.bib").map(read).join("\n")))
  • ("abbrev.bib", "ref.bib").map(read).join("\n")

    Read files as strings, and join them together.

  • bytes(…)

    Convert the string to raw bytes, making #bibliography think it is a single file.

Besides, most people don’t read topics marked as solved. If you want to discuss it further, please start a new topic and put a link to this post.

2 Likes

Amazing! Thanks a lot! That works, Typst is really a programming language :smiley:

1 Like