David Stadelmann fff5b2ecd5 feat: Support cross-element port alignment via align-with
Extend the port `align-with` field to accept references to ports of
other elements, in addition to the existing local-port form:

  - "<local-id>"                    → same-element port (unchanged)
  - (element: "<id>", port: "<id>") → cross-element reference
  - "<raw-anchor>"                  → arbitrary CeTZ anchor name

Cross-element alignment is implemented via CeTZ perpendicular
projection (`|-`) so the port sits on this element's side line while
sharing the remote port's y (east/west) or x (north/south) coordinate.
Local resolution still validates matching axis and detects cycles;
external refs skip axis validation (remote side unknown at eval time)
and require the target element to be drawn first.

Also enrich port-related panic messages with the element id and port
context to make offending figures easier to locate, and add a manual
example (`examples.align-with-ports`) demonstrating both local and
cross-element alignment.
2026-09-14 17:12:57 +02:00
2024-05-16 21:34:50 +00:00
2026-07-28 14:45:49 +02:00
2026-07-04 01:35:35 +02:00

circuiteria

Circuiteria is a Typst package for drawing block circuit diagrams using the CeTZ package.

A platypus / Perry the Platypus meme made with colored rounded rectangles

Examples

Block diagram of a multi-cycle RISC-V FPGA processor
A bit of everything
Block diagram of a single-cycle RISC-V processor
Wires everywhere
Top-level block diagram of a single-cycle RISC-V processor Block diagram of a simple single-cycle RISC-V ALU
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: *
  ...
})
S
Description
Drawing block circuits with Typst made easy, using CeTZ
Readme Apache-2.0
8.4 MiB
0 Stars 1 Watchers 0 Forks
Languages
Typst 99.8%
Just 0.2%