A simple Typst package for creating and managing abbreviations. While more complex packages exist, this one prioritizes ease of use and adapts to any language (English, French, German, etc.) by letting you customize the abbreviation-list title.
Installation
Local use
To use the library locally, download lib.typ from Abbrev’s GitHub repository and place it in your document’s directory or any desired location. Then, add the following import statement to your document, adjusting the path as necessary:
#import "./lib.typ": *
Import from Typst Universe
To import the library from Typst Universe, add this to your document:
#import "@preview/abbrev:0.1.0": *
Usage
Step 1: Define abbreviations
Start by defining all your abbreviations in a dictionary:
#define-abbreviations((
"GPU": "Graphics Processing Unit",
"XML": "Extensible Markup Language",
"CPU": "Central Processing Unit",
))
Step 2: Use abbreviations in your document
-
Short form (shows the abbreviation):
#abbr("GPU")Output:
GPU
-
Full form (shows the complete text):
#abbr("GPU", form: "full")Output:
Graphics Processing Unit
-
With a suffix (e.g., plural):
#abbr("GPU", suffix: "s")Output:
GPUs
Step 3: Display the abbreviation list
Generate an abbreviation list anywhere in your document:
#abbreviation-outline(
title: [Abbreviations],
)
Output:
The default title is “List of abbreviations” — customize it as needed. For example, in French: title: [Liste des abréviations].
Example
See example.typ for a complete working example. To view the compiled output:
- Compile
example.typ:typst compile example.typ. Make sure you putlib.typin the same directory asexample.typ. - (Or) In GitHub Actions, select a passed workflow run and download the
pdf-outputartifact (ZIP file containing the PDF).