Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

char-count

Count Unicode grapheme clusters in strings, Typst content, or a complete document. Spaces and paragraph breaks are included; equations, citations, images, and other non-prose elements are ignored by default.

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

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

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

When installed as a local Typst package, use:

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

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