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
|
Render |
|
Compile a Circuitikz |
- sycan.schematic.draw(netlist, filename)[source]¶
Render
netlistto a Circuitikz.texfile.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
.texto PNG alongside it.Uses
pdflatexto produce a PDF, thenpdftoppmto rasterize. If the source is a stub (lcapy layout failure) or either tool is missing, returnsNoneand leaves no PNG behind.- Parameters:
tex_path (str | Path)
dpi (int)
- Return type:
Path | None