sycan.schematic

Render a SPICE netlist as a Circuitikz schematic via lcapy.

This writes a standalone .tex file (no pdflatex invocation), which can later be compiled with pdflatex + the circuitikz package to obtain a PDF/PNG/SVG. The output extension is forced to .tex so lcapy does not try to run LaTeX.

Layout hints and ideal wires (SPICE W elements) may be carried directly in the testbench netlist: our SPICE parser strips the ; layout annotations as inline comments while lcapy consumes them.

Functions

draw(netlist, filename)

Render netlist to a Circuitikz .tex file.

render_png(tex_path[, dpi])

Compile a Circuitikz .tex to PNG alongside it.

sycan.schematic.draw(netlist, filename)[source]

Render netlist to a Circuitikz .tex file.

Returns the path written. The caller may compile the output with:

pdflatex <filename>

to obtain a PDF (or use dvisvgm / pdf2svg for SVG).

Parameters:
  • netlist (str)

  • filename (str | Path)

Return type:

Path

sycan.schematic.render_png(tex_path, dpi=200)[source]

Compile a Circuitikz .tex to PNG alongside it.

Uses pdflatex to produce a PDF, then pdftoppm to rasterize. If the source is a stub (lcapy layout failure) or either tool is missing, returns None and leaves no PNG behind.

Parameters:
  • tex_path (str | Path)

  • dpi (int)

Return type:

Path | None