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.12. Import in your Typst file
Add this to your .typ file:
#import "@preview/nth:1.0.1": *Version History
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.