Universe

Version 0.1.0

%-style (printf) str format for typst

Getting Started

Simplest example:

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

#sprintf("%s", "Tom")

Another example: demo showing usage of %06d, %.2f, etc

Usage

A more in-depth description of usage:

Just use as if using Python’s % of str

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

#let s-example = sprintf("%s-%.1f", "asd", 1.23)

Additional Documentation and Acknowledgments

Development

This section is for developers or advanced users only

To build this package locally, there is the guide to show how to get the development environment up and running.

Firstly, install Nim.

Then, compile plugin via:

$ cd lib
$ nimble run
$ cd ..

Afterward, entrypoint src/lib.typ along with its dependency src/lib.wasm shall be generated.