i

i-am-acro

@preview

Acronym package for typst, aiming for multilanguage support and feature richness.

v0.1.3
MIT

Package Information

Last Updated
Minimum Typst Version
0.13.0
Categories
utilitymodellanguages

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/i-am-acro:0.1.3

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/i-am-acro:0.1.3": *

Version History

0.1.30.13.0
02cd378f5108...
0.1.20.13.0
8e83d43d8eb7...
0.1.10.13.0
2389c8067a99...
0.1.00.13.0
73a124bcdf66...

i-am-acro

Acronym package for typst, aiming for multilanguage support and feature richness.

This package manages acronyms with multiple defined languages and supports advanced features like displaying an acronym with suffix or a custom form.

For a full guide how to use this package see the documentation: docs.pdf

A quick overview of the features:

  • Declare acronyms in multiple langauages
  • Manage acronyms with their short, short-plural, long and long-plural form
  • Automatically show a second language (if defined)
  • Print acronyms in a table
  • Link acronyms to acronym table

Quick start

#import "@preview/i-am-acro:0.1.3": * // import everything
#let acronyms = (
  LED: ( // key
    en: ( // language key
      short: [LED], //requiered
      short-pl: [LEDs], //optional
      long: [Light Emitting Diode], // requiered
    ),
    de: (
      short: "LED",
      long: "Leuchtdiode",
      long-pl: "Leuchtdioden", // optional
    ),
  ),
)

#init-acronyms(acronyms, "en", always-link: false)
`#ac("LED")` -> Light Emitting Diode (LED)
`#ac("LED")` -> LED
`#acl("LED")` -> Light Emitting Diode
`#acl("LED", lang: "de")` -> Leuchtdiode
`#ac-suffix("LED", "Case")` -> LED-Case or (if shown first time) Light Emitting Diode(LED)-Case

Overview of all functions

For detailed explanation see: docs.pdf

Function Description
#init-acronyms(...) Initialize acronyms and set default settings (like language)
#ac(...) Display Acronym. This will show the long form when the acronym is displayed for the first time.
#acp(...) Display plural version of the acronym. If no plural was defined "s" will be appended.
#acl(...) Display the long form of the acronym.
#aclp(...) Display the long plural form of the acronym.
#acs(...) Display the short form of the acronym.
#acsp(...) Display the short plural form of the acronym.
#ac-suffix(...) Display Acronym with an hyphenated suffix.
#ac-custom(...) Display Acronym as custom defined Text but treat it as in #ac()
#update-acro-lang(...) Change used default language.
#update-acro-second-lang(...) Change used default second language.
#update-acronym-used(...) Change the state, if an acronym was used before.
#update-acronym-long-shown(...) Change the state, if the long form of an acronym was shown before.