a

aoran

@preview

Helper to determine proper articles, like 'a or an'

v0.1.0
MIT

Package Information

Last Updated
Categories
utility
Disciplines
linguistics

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/aoran:0.1.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/aoran:0.1.0": *

Version History

0.1.0
d4bc310532c5...

aoran Typst Package

helper utilities for choosing between a and an

Installation

#import "@preview/aoran:0.1.0": article

API

  • article(word, capitalized: false) – returns "a", "an", or none. Set capitalized to true to receive "A" / "An" for sentence starts.
#let word = "umbrella"
#assert(article(word) == "an")
#assert(article(word, capitalized: true) == "An")

Examples

  • examples/basic.typ shows how to join the returned article with words and headings.
  • examples/thumbnail.typ is the snippet rendered for the package gallery preview.

Run just examples (or typst compile --root . examples/basic.typ) to render them.

Origin

The logic is extracted from the Glossy
package so standalone documents can reuse the same heuristics without pulling in glossary
machinery.

License

Licensed under the MIT License.

The heuristic mirrors the original implementation used in the
Glossy package. It covers
vowel starts, silent leading h, u words that sound like "yoo", eu
prefixes, and acronym detection (e.g. "an RFC" but "a CPU"). When the input
is none or empty, the helper returns none so callers can decide how to
recover.