forked from HEL/circuiteria
2c6e5f44df157f575a0b70182909f3a54cf8c62a
Add the `zigzag-at` parameter to place the middle bend of a zigzag wire on the axis of a referenced anchor. It overrides `zigzag-ratio`, which now defaults to `auto` (resolving to 50%) so the two are mutually exclusive. Accepted forms are an anchor name, any CeTZ coordinate, or the scalar offset `(rel: <length>, to: <coord>)`. Add the generic helpers this relies on and that other wire styles reuse: - `normalize-scalar-offset(at, axis)` turns a scalar offset into an x or y offset; `normalize-zigzag-at` is a wrapper around it. - `detect-port-side(anchor, ctx)` deduces the cardinal side a port faces by comparing it with its element's `.center` anchor. Add the `zigzag-at` example.
circuiteria
Circuiteria is a Typst package for drawing block circuit diagrams using the CeTZ package.
Examples
|
|
| A bit of everything | |
|
|
| Wires everywhere | |
|
|
| Groups | Rotated |
Note
These circuit layouts were copied from a digital design course given by prof. S. Zahno and recreated using this package
Click on the example image to jump to the code.
Usage
For more information, see the manual
To use this package, simply import circuiteria and call the circuit function:
#import "@preview/circuiteria:0.2.1"
#circuiteria.circuit({
import circuiteria: *
...
})
Description
Drawing block circuits with Typst made easy, using CeTZ
11 MiB
0 Stars
1 Watchers
0 Forks
Languages
Typst
99.8%
Just
0.2%
