Create project in app
labtyp
is a package that allows using typst for labelling text documents like dialogue threads or legal documents for precise citing.
A json file with the labels in a document can be produced using typst query
:
typst query main.typ <lab> > doclabels.json
Which can then be translated into hayagriva
or biblatex
formats.
labtyp
defines 3 commands:
lab
: creates an in-place label, defined by key, text, notemset
: adds metadata that gets assigned to subsequent labels (i.e. labels defined below the current mset command in the document), like the title of the document, date, pagenumber in the original document, this can be expanded with any key- Each label ends up being a concatenation of the label information, and the mset information.
lablist
: prints a table of the labels created
Test document
#import "@preview/labtyp:0.1.0": mset, lab, lablist
#mset(values: (
title: "My Document",
author: "John Doe",
date: "2025-07-31"
))
= Heading
== Subheading
This is some text.
#lab("key", "Highlighted text", "This is a note") // Creates underlined text and footnote
#mset(values: (date: "2025-08-01")) // Redefine date for subsequent labels
= Another Heading
#lab("key2", "More text", "Another note")
= List of Labels
#lablist() // Displays a table of all labels with hyperlinks