Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 2f9a875

Browse files
committed
feat(logic): doc + example for invert-style
1 parent a0e03a4 commit 2f9a875

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

docs/main.typ

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,8 @@ The `diode` symbol accepts only one parameter, called `type`, and its appearance
12181218

12191219
== Logic <logic>
12201220

1221+
Use `set-style(logic: (invert-style: "circle"))` to render IEC inversion bubbles (European-style) on inverted logic gates.
1222+
12211223
#circ(
12221224
```typst
12231225
#import "./zap.typ"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#import "/src/lib.typ"
2+
#set page(width: auto, height: auto, margin: 5pt, fill: white)
3+
4+
#lib.circuit({
5+
import lib: *
6+
7+
set-style(logic: (invert-style: "circle"))
8+
9+
lnot("g1", (0, 1.3))
10+
lnand("g2", (6, 1.3))
11+
lnor("g3", (0, -1.3))
12+
lxnor("g4", (6, -1.3))
13+
14+
wstub("g1.in1", label: "A")
15+
estub("g1.out", label: "NOT")
16+
17+
wstub("g2.in1", label: "B")
18+
wstub("g2.in2", label: "C")
19+
estub("g2.out", label: "NAND")
20+
21+
wstub("g3.in1", label: "D")
22+
wstub("g3.in2", label: "E")
23+
estub("g3.out", label: "NOR")
24+
25+
wstub("g4.in1", label: "F")
26+
wstub("g4.in2", label: "G")
27+
estub("g4.out", label: "XNOR")
28+
})

0 commit comments

Comments
 (0)