n

nth

@preview

Add english ordinals to numbers, eg. 1st, 2nd, 3rd, 4th.

v1.0.1
MIT-0

Package Information

Last Updated
Minimum Typst Version
0.8.0

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/nth:1.0.1

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/nth:1.0.1": *

Version History

1.0.10.8.0
18080af81631...
1.0.00.8.0
2975bd09f058...
0.2.00.8.0
db0d605b7561...
0.1.0
89a8d285f276...

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 by Donald Arseneau.

Usage

Include this line in your document to import the package.

#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.