Skip to content

Instantly share code, notes, and snippets.

@willismonroe
Last active January 9, 2024 16:02
Show Gist options
  • Save willismonroe/9923b49bf96da47b62f0cec51fe1f4a4 to your computer and use it in GitHub Desktop.
Save willismonroe/9923b49bf96da47b62f0cec51fe1f4a4 to your computer and use it in GitHub Desktop.
Local bibliography for Typst
/* This typst local package will allow you to reference the same bibliography file from any typst file
Steps:
1) Create the directory ~/.local/share/typst/packages/local/mybib/1.0.0
2) Write a typst.toml file containing:
[package]
name = "mybib"
version = "1.0.0"
entrypoint = "lib.typ"
authors = ["Your Name Here"]
license = "Unlicense"
description = "A cludgy workaround to make my bibliography globally importable."
3) Symlink your bibliography file to the directory as "bibliography.bib"
4) Write the contents of this file to lib.typ
5) Use it in file by importing the package:
#import "@local/mybib:1.0.0": *
6) And intializing the bibliography:
#mybib(style: "harvard-cite-them-right")
*/
#let mybib(style: "ieee") = {
bibliography("bibliography.bib", style: style)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment