https://github.com/extua/nth
Typst package for adding english ordinals to numbers, eg. 1st, 2nd, 3rd, 4th.
https://github.com/extua/nth
typst-package
Last synced: 5 months ago
JSON representation
Typst package for adding english ordinals to numbers, eg. 1st, 2nd, 3rd, 4th.
- Host: GitHub
- URL: https://github.com/extua/nth
- Owner: extua
- License: mit-0
- Created: 2023-10-01T11:03:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-20T11:31:28.000Z (about 2 years ago)
- Last Synced: 2025-10-10T17:57:56.292Z (9 months ago)
- Topics: typst-package
- Language: Typst
- Homepage: https://typst.app/universe/package/nth
- Size: 27.3 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Nth
Provides functions `#nth()` and `#nths()` which take a number and return it suffixed by an english ordinal.
This package is named after the nth [LaTeX macro](https://ctan.org/pkg/nth) by Donald Arseneau.
## Usage
Include this line in your document to import the package.
```typst
#import "@preview/nth:1.0.1": *
```
Then, you can use `#nth()` to markup ordinal numbers in your document.
For example, `#nth(1)` shows 1st,
`#nth(2)` shows 2nd,
`#nth(3)` shows 3rd,
`#nth(4)` shows 4th,
and `#nth(11)` shows 11th.
If you want the ordinal to be in superscript, use `#nths` with an 's' at the end.
For example, `#nths(1)` shows 1st.