Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
CeTZ (CeTZ, ein Typst Zeichenpaket) is a library for drawing with [Typst](https://typst.app) with an API inspired by TikZ and [Processing](https://processing.org/).

## Examples

<!-- img width is set so the table gets evenly spaced by GitHubs css -->
<table>
<tr>
Expand Down Expand Up @@ -67,7 +68,7 @@ CeTZ (CeTZ, ein Typst Zeichenpaket) is a library for drawing with [Typst](https:
</tr>
</table>

*Click on the example image to jump to the code.*
_Click on the example image to jump to the code._

You can explore an example gallery of scientific diagrams at [janosh.github.io/diagrams](https://janosh.github.io/diagrams).

Expand Down Expand Up @@ -95,6 +96,30 @@ To use this package, simply add the following code to your document:

To install the CeTZ package under [your local typst package dir](https://github.com/typst/packages?tab=readme-ov-file#local-packages) you can use the `install` script from the repository.

Make sure to first perform a recursive git clone

```bash
# to fetch a clean clone:
git clone --recursive https://github.com/cetz-package/cetz.git
# or if you forgot the `--recursive` flag before:
git submodule update --init
```

and also ensure you have `just` and `cargo` installed.

<details>
<summary>For nix users</summary>

After enabling flakes, use:

```bash
nix --extra-experimental-features 'nix-command flakes' develop
```

</details>

Now use the installation script:

```bash
just install
```
Expand Down Expand Up @@ -124,6 +149,7 @@ To run all tests you can run the `just test` target. You need to have
[`tytanic`](https://github.com/tingerrr/tytanic/) in your `PATH`: `cargo install tytanic`.

## Projects using CeTZ

- [finite](https://github.com/jneug/typst-finite) Finite is a Typst package for rendering finite automata.
- [fletcher](https://github.com/Jollywatt/typst-fletcher) Package for drawing commutative diagrams and figures with arrows.
- [chronos](https://git.kb28.ch/HEL/chronos) Package for drawing sequence diagrams.
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
description = "CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:numtide/flake-utils";
};
};

outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
with pkgs;
rec {
packages.cetz = pkgs.rustPlatform.buildRustPackage {
pname = "cetz";
version = "0.1.0";

src = ./cetz-core; # flake root

cargoLock = {
lockFile = ./cetz-core/Cargo.lock;
};

nativeBuildInputs = with pkgs; [
pkg-config
llvmPackages.bintools
];
buildInputs = [ just ];
};

packages.default = packages.cetz;
}
);
}
Loading