Skip to content

About

Made by chatGPT to count characters in typst.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

char-count

Count Unicode grapheme clusters and Danish normal pages in strings, Typst content, or a complete document. One normal page is 2,400 characters including spaces. Equations, citations, images, and other non-prose elements are ignored by default.

Counts describe source content, not final rendered output. Context-generated text and show-rule replacements require special care; see counting limits.

#import "char-count.typ": char-count-of

#let count = char-count-of([Hello *Typst*!])
#count.at("characters-with-spaces") // 12
#count.at("normal-pages") // 0.005

Install

Copy char-count.typ into your project and import the functions you need:

#import "char-count.typ": char-count, char-count-of, total-characters-with-spaces, total-normal-pages

When installed as a local Typst package, use:

#import "@local/char-count:0.1.0": char-count, char-count-of, total-characters-with-spaces, total-normal-pages

The package is implemented entirely in Typst and has no runtime dependencies.

Documentation

A compilable example covering the complete public API is available in examples/all-functions.typ. See the changelog for release history.

License

MIT

About

Made by chatGPT to count characters in typst.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages