Analog and digital circuit schematics from SPICE-style netlist or positional DSL. Auto-routed power/ground rails, orthogonal signal wiring, IEEE standard component symbols.
Schematex uses positional DSL (more intuitive, more controllable to implement), where components chain in a direction and branch via at: anchor points.
Named nets are declared with net:, allowing non-adjacent components to be "implicitly connected" (avoids long wire detours):
net VOUTR1: resistor rightnet VOUT: dot # place a dot at R1.end and name this netC1: capacitor down at: VOUT # start from the net point with the same name
circuit "RC Low-Pass Filter"V1: vsource down label="Vin" value="5V"wire rightR1: resistor right label="R1" value="1kΩ"wire right 20pxdotC1: capacitor down label="C1" value="100nF"wire down 10pxgroundat: C1.startwire right 20pxlabel "Vout" right
DSL Example: Inverting Op-Amp
circuit "Inverting Amplifier"V1: vsource down value="Vin"wire right 20pxRin: resistor right label="Rin" value="10kΩ"at: Rin.enddotnet: INV_INRf: resistor right label="Rf" value="100kΩ" at: INV_INU1: opamp rightat: U1.minuswire left 10pxat: INV_INat: U1.pluswire down 10pxgroundat: U1.outwire right 20pxlabel "Vout" rightat: Rf.endwire down # connect feedback from Vout back to Rf end (feedback loop)at: U1.out
circuit "Voltage Divider"V1: vsource down value="12V"wire right 20pxR1: resistor down label="R1" value="10kΩ"dotR2: resistor down label="R2" value="10kΩ"wire down 10pxgroundat: V1.startwire right 20pxat: R1.startwire right 20pxlabel "Vout" right
Verify: V1 on the left, R1/R2 connected in series downward, Vout tapped from midpoint, ground at the bottom.
circuit "LED Driver"V1: vsource down value="5V"wire rightR1: resistor right label="R1" value="220Ω"D1: led right label="D1"wire down 20pxgroundat: V1.startwire rightat: V1.start
Verify: LED symbol correct (triangle + emission rays), polarity correct.
circuit "Common Emitter"# Base resistorRb: resistor down label="Rb" value="100kΩ" at: (0, 0)Q1: npn at: Rb.end# Collector resistor to VCCRc: resistor up label="Rc" value="1kΩ" at: Q1.collectorwire up 10pxlabel "VCC" up# Emitter to groundat: Q1.emitterwire down 10pxground
Verify: NPN BJT symbol correct (circle + base line + outward emitter arrow).
circuit "LC Filter"V1: acsource down value="Vs"wire rightL1: inductor right label="L1" value="10mH"wire right 10pxdotC1: capacitor down label="C1" value="1µF"wire down 10pxgroundat: L1.startwire downat: V1.start
Verify: Inductor has correct arc coil symbol, capacitor has parallel plates.
The following symbols extend the v1 standard to cover components used frequently in engineering practice. All paths are in the rightward direction (direction="right"); other directions are handled via SVG rotate transforms during rendering. The coordinate origin is at the left-center of the component.
Pins: 3-pin — start (left), wiper (center/top), end (right)
Size: 60px long × 24px tall (including wiper arrow)
SVG Path:
/* Base zigzag (same as resistor) */M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* Wiper arrow pointing downward from top to center */M 25,-22 L 25,-10 /* vertical line */M 20,-22 L 25,-16 L 30,-22 /* arrowhead */
SVG Path: Same as potentiometer, but wiper points to end terminal (diagonal arrow through zigzag)
M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* diagonal arrow */M 5,-12 L 45,12 /* diagonal line */M 40,8 L 45,12 L 41,7 /* arrowhead */
SVG Path: Resistor zigzag + "-t°" text annotation in top-right corner
M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* Symbol mark — rendered as <text> element *//* text: "-t°" at (44, -6), font-size: 8px */
SVG Path: Resistor zigzag + two inward-pointing light arrows
M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* Left light arrow (upper-left to lower-right) */M 2,-18 L 14,-6 M 11,-6 L 14,-6 L 14,-9 /* arrow1 *//* Right light arrow */M 10,-20 L 22,-8 M 19,-8 L 22,-8 L 22,-11 /* arrow2 */
SVG Path: Resistor zigzag in a rounded box with "V" text
M 0,0 H 8 M 8,-10 H 42 V 10 H 8 V -10 /* box *//* zigzag inside box — scaled down */M 10,0 L 13,-6 L 17,6 L 21,-6 L 25,6 L 29,-6 L 33,6 L 37,0M 42,0 H 50/* "V" text in renderer at (44, -14) */
M 0,0 H 18 /* lead to negative plate */M 18,-12 V 12 /* negative plate (straight line) */M 22,-12 Q 26,-12 26,0 Q 26,12 22,12 /* positive plate (curved) */M 26,0 H 40 /* positive lead *//* Polarity marks *//* "+" text at (30, -15), font-size: 9px *//* "−" text at (14, -15), font-size: 9px */
/* Gate lead */M -20,0 H -8 /* gate input wire *//* Gate insulation line */M -8,-20 V 20 stroke-width:2/* Channel lines */M -4,-18 V -4 /* upper channel segment */M -4,4 V 18 /* lower channel segment *//* Collector/Emitter base line */M -4,-18 H 8 M -4,18 H 8/* Collector wire (top) */M 8,-18 V -30 /* upward *//* Emitter wire (bottom, with arrow) */M 8,18 V 30 /* downward *//* Emitter arrow (outward = N-type) */M 2,14 L 8,18 L 2,22/* Body diode (anti-parallel) */M 8,-18 L 8,18 /* diode series with emitter path *//* diode symbol: small triangle + bar at midpoint */M 12,-4 L 12,4 L 20,0 Z /* triangle */M 20,-5 V 5 /* bar */
Symbol: diode + gate lead extending from the cathode side
M 0,0 H 16 /* anode lead */M 16,-14 L 32,0 L 16,14 Z /* triangle */M 32,-12 V 12 /* cathode bar */M 32,0 H 50 /* cathode lead */M 32,8 L 32,20 H 50 /* gate lead from cathode junction downward */
Symbol: two SCRs connected in anti-parallel (head-to-head triangles)
M 0,0 H 14/* Upper triangle (T1→T2 direction) */M 14,-12 L 30,0 L 14,12 /* triangle outline */M 14,-12 V 12 /* left bar *//* Lower triangle (T2→T1 direction, inverted) */M 30,-12 L 14,0 L 30,12 /* inverted triangle */M 30,-12 V 12 /* right bar */M 30,0 H 44/* Gate */M 30,8 L 44,20 /* gate lead from right junction */
Pins: base (left), collector (top), emitter (bottom)
Symbol: two nested NPNs with an outer rectangle border
M 0,-20 H 60 V 60 H 0 Z stroke-dashed /* outer box *//* inner NPN1 *//* inner NPN2 — emitter of NPN1 feeds base of NPN2 *//* simplified: show "Darlington" label inside */
Implementation note: use generic_ic variant + "Q" label, specify darlington=true in attrs
/* Rotated 45° diamond outline */M 0,0 L 20,-20 L 40,0 L 20,20 Z stroke dashed (envelope)/* 4 diodes — simplified: arrows pointing from AC to DC rail *//* D1: bottom-left→top (ac1→dc_pos) *//* D2: bottom-right→top (ac2→dc_pos) *//* D3: bottom→bottom-left (dc_neg→ac1) *//* D4: bottom→bottom-right (dc_neg→ac2) *//* In renderer: draw as 40×40px diamond with internal arrows */
Symbol: standard diode + two inward-pointing arrows (indicating light reception)
M 0,0 H 14M 14,-12 L 28,0 L 14,12 Z /* triangle */M 28,-12 V 12 /* bar */M 28,0 H 42/* incoming light arrows (from upper-left) */M 0,-22 L 10,-10 M 8,-10 L 10,-10 L 10,-13M 6,-26 L 16,-14 M 14,-14 L 16,-14 L 16,-17
Pins: 3-pin — collector (top), base (optional, left), emitter (bottom)
Symbol: NPN BJT shape + two inward arrows (light replaces base bias)
/* NPN BJT paths (same as npn) *//* incoming light arrows — same as photodiode */M -6,-22 L 4,-10 M 2,-10 L 4,-10 L 4,-13M -2,-26 L 8,-14 M 6,-14 L 8,-14 L 8,-17
Pins: 4-pin — a (LED anode), k (LED cathode), c (transistor collector), e (transistor emitter)
Symbol: LED + light arrows + phototransistor, enclosed in a dashed rectangle
/* dashed isolation box */M 0,-20 H 80 V 60 H 0 V -20 stroke-dasharray:4,3/* LED symbol at x=15 *//* light arrows between LED and transistor */M 30,-5 L 50,15 /* arrow1 */M 30,5 L 50,25 /* arrow2 *//* arrowheads *//* phototransistor at x=55 */
Size: 80×80px body, larger than standard components
M 0,0 H 14 /* left wire */M 14,0 L 34,-12 /* contact arm (open position, 35° tilt) *//* contact point */M 36,0 H 50 /* right wire *//* contact dot: circle r=2 at (14,0) *//* contact dot: circle r=2 at (36,0) */
Pins: 3-pin — common (left), nc (top-right), no (bottom-right)
Symbol: common contact + two output terminals
M 0,0 H 14 /* common wire */M 14,0 L 36,-14 /* arm pointing to NC position */M 38,-16 H 50 /* NC output */M 38,8 H 50 /* NO output (open gap) *//* dots at connection points */
IEEE symbol: circle representing button mechanism + horizontal broken contact
M 0,0 H 14M 14,0 H 22 /* left contact *//* gap (NO state) */M 28,0 H 36 /* right contact */M 36,0 H 50/* actuator (vertical line above gap) */M 25,-4 V -14 /* push rod */M 18,-14 H 32 /* button top */
M 0,0 H 8M 8,-10 H 42 V 10 H 8 V -10 /* coil body rect *//* coil symbol inside */M 10,0 Q 12,-7 14,0 Q 16,7 18,0 Q 20,-7 22,0 Q 24,7 26,0 Q 28,-7 30,0M 42,0 H 50
Pins: 3-pin — in (left), gnd (bottom), out (right)
Symbol: rectangular block + "REG" label + three pins
M -30,0 H -10 /* input wire */M -10,-20 H 10 V 20 H -10 V -20 /* body rect 20×40px */M 10,0 H 30 /* output wire */M 0,20 V 40 /* ground pin *//* "REG" text inside body *//* IN/OUT/GND labels in renderer */
M -40,-15 H -15 M -40,15 H -15M -15,-25 H 15 V 25 H -15 V -25 /* body 30×50px */M 15,-15 H 40 M 15,15 H 40/* "DC/DC" label in renderer *//* internal arrow: M -8,0 L 8,0 with arrowhead */