forked from HEL/circuiteria
fff5b2ecd5fcec49f2e79355ee3713876dc05e77
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.
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
8.4 MiB
0 Stars
1 Watchers
0 Forks
Languages
Typst
99.8%
Just
0.2%
