Home

Awesome

CeTZ

CeTZ (CeTZ, ein Typst Zeichenpaket) is a library for drawing with Typst with an API inspired by TikZ and Processing.

Examples

<!-- img width is set so the table gets evenly spaced by GitHubs css --> <table> <tr> <td> <a href="gallery/karls-picture.typ"> <img src="gallery/karls-picture.png" width="250px"> </a> </td> <td> <a href="gallery/paciolis.typ"> <img src="gallery/paciolis.png" width="250px"> </a> </td> <td> <a href="gallery/waves.typ"> <img src="gallery/waves.png" width="250px"> </a> </td> </tr> <tr> <td>Karl's Picture</td> <td>Pacioli's construction of the icosahedron</td> <td>Waves</td> </tr> <tr> <td> <a href="gallery/tree.typ"> <img src="gallery/tree.png" width="250px"> </a> </td> </tr> <tr> <td>Tree Layout</td> </tr> </table>

Click on the example image to jump to the code.

Usage

For information, see the online manual.

To use this package, simply add the following code to your document:

#import "@preview/cetz:0.3.1"

#cetz.canvas({
  import cetz.draw: *
  // Your drawing code goes here
})

CeTZ Libraries

Installing

To install the CeTZ package under your local typst package dir you can use the install script from the repository.

just install

The installed version can be imported by prefixing the package name with @local.

#import "@local/cetz:0.3.1"

#cetz.canvas({
  import cetz.draw: *
  // Your drawing code goes here
})

Just

This project uses just, a handy command runner.

You can run all commands without having just installed, just have a look into the justfile. To install just on your system, use your systems package manager. On Windows, Cargo (cargo install just), Chocolatey (choco install just) and some other sources can be used. You need to run it from a sh compatible shell on Windows (e.g git-bash).

Testing

This package comes with some unit tests under the tests directory. To run all tests you can run the just test target. You need to have typst-test in your PATH: cargo install typst-test --git https://github.com/tingerrr/typst-test.

Projects using CeTZ