From f819f35d951f23ba4ab4eff799deb8327c1d1e5b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 24 Apr 2016 22:15:16 +0000 Subject: circuitikz (24apr16) git-svn-id: svn://tug.org/texlive/trunk@40729 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/context/third/circuitikz/t-circuitikz.tex | 14 +- .../tex/generic/circuitikz/circuitikz.code.tex | 710 --------- .../tex/generic/circuitikz/circuitikz1.code.tex | 548 ------- .../tex/generic/circuitikz/pgfcirc.defines.tex | 828 ++++++++++ .../tex/generic/circuitikz/pgfcircbasic.tex | 570 +++++++ .../tex/generic/circuitikz/pgfcircbipoles.tex | 356 ++++- .../tex/generic/circuitikz/pgfcirccurrent.tex | 19 +- .../tex/generic/circuitikz/pgfcircinputarrows.tex | 23 - .../tex/generic/circuitikz/pgfcircmonopoles.tex | 60 - .../tex/generic/circuitikz/pgfcircnpoles.tex | 599 -------- .../tex/generic/circuitikz/pgfcircquadpoles.tex | 32 +- .../tex/generic/circuitikz/pgfcircshapes.tex | 20 + .../tex/generic/circuitikz/pgfcirctripoles.tex | 1579 +++++++++++++------- .../tex/generic/circuitikz/pgfcircvoltage.tex | 32 +- .../texmf-dist/tex/latex/circuitikz/circuitikz.sty | 173 ++- 15 files changed, 2924 insertions(+), 2639 deletions(-) delete mode 100644 Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex delete mode 100644 Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircbasic.tex delete mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex delete mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex index 4184114b75b..91a730409e1 100644 --- a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex +++ b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex @@ -1,9 +1,12 @@ -\def\pgfcircversion{0.4} -\writestatus{loading}{2015/05/15 The CircuiTikz circuit drawing package version \pgfcircversion} +\def\pgfcircversion{0.5} +\def\pgfcircversiondate{2016/04/24} +\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion} \usemodule[tikz] \startmodule[circuitikz] +\usetikzlibrary[calc] +\usetikzlibrary[arrows] \unprotect @@ -14,10 +17,7 @@ \catcode`\|=12 \catcode`\!=12 -\usepgflibrary [decorations.pathmorphing] -\usetikzlibrary[calc] - -\input circuitikz.code.tex +\input pgfcirc.defines.tex % defaults @@ -107,7 +107,7 @@ \ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]} -\input circuitikz1.code.tex +\input pgfcircbasic.tex \catcode`\@=\tikzatcode \catcode`\|=\tikzbarcode diff --git a/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex b/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex deleted file mode 100644 index 4dfe979f86b..00000000000 --- a/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex +++ /dev/null @@ -1,710 +0,0 @@ - -%% Options - - - - -%% Keys - -\long\def\pgf@circ@comment#1{} - -\def\circuitikzbasekey{/tikz/circuitikz} - -\pgfkeys{\circuitikzbasekey/.is family} - -\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}} -\let\ctikzset\circuitikzset -\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} -\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} - - -\newif\ifpgf@circ@siunitx -\newif\ifpgf@circuit@compat - -\newif\ifpgf@circuit@inputarrow -\ctikzset{inputarrow/.is choice} -\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}} -\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}} - -\ctikzset{bipoles/.is family} -\ctikzset{bipoles/border margin/.initial=1.1} -\ctikzset{bipoles/thickness/.initial=2} -\ctikzset{bipoles/length/.initial=1.4cm} -\ctikzset{nodes width/.initial=.04} -\newdimen\pgf@circ@Rlen -\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}} - -\ctikzset{monopoles/.is family} -\ctikzset{monopoles/ground/width/.initial=.25} -\ctikzset{monopoles/tground/thickness/.initial=3} -\ctikzset{monopoles/vcc/width/.initial=.2} -\ctikzset{monopoles/match/width/.initial=.4} -\ctikzset{monopoles/oscillator/width/.initial=.7} -\ctikzset{monopoles/chassis/width/.initial=.25} -\ctikzset{monopoles/alternative chassis/width/.initial=.25} -\ctikzset{monopoles/equipotentiality/width/.initial=.25} -\ctikzset{monopoles/tlinestub/width/.initial=.25} -\ctikzset{monopoles/antenna/width/.initial=.25} -\ctikzset{monopoles/antenna/label/xanchor/.initial=.4} -\ctikzset{monopoles/antenna/label/yanchor/.initial=.75} -\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4} -\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75} -\ctikzset{monopoles/txantenna/width/.initial=.25} -\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4} -\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75} -\ctikzset{monopoles/rxantenna/width/.initial=.25} - -\ctikzset{bipoles/resistor/height/.initial=.3} -\ctikzset{bipoles/resistor/width/.initial=.8} -\ctikzset{bipoles/potentiometer/height/.initial=.8} -\ctikzset{bipoles/potentiometer/height 2/.initial=.3} -\ctikzset{bipoles/potentiometer/width/.initial=.8} -\ctikzset{bipoles/photoresistor/height/.initial=.6} -\ctikzset{bipoles/photoresistor/height 2/.initial=.3} -\ctikzset{bipoles/photoresistor/width/.initial=.8} -\ctikzset{bipoles/thermistor/main/.initial=.7} -\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/thermistorntc/width/.initial=.8} -\ctikzset{bipoles/thermistorntc/main/.initial=.7} -\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7 -\ctikzset{bipoles/thermistorptc/width/.initial=.8} -\ctikzset{bipoles/thermistorptc/main/.initial=.7} -\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7 -\ctikzset{bipoles/thermistor/width/.initial=.8} -\ctikzset{bipoles/varistor/main/.initial=.7} -\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/varistor/width/.initial=.8} -\ctikzset{bipoles/vresistor/height/.initial=.6} -\ctikzset{bipoles/vresistor/width/.initial=.8} -\ctikzset{bipoles/cuteinductor/height/.initial=.3} -\ctikzset{bipoles/cuteinductor/width/.initial=.6} -\ctikzset{bipoles/cuteinductor/coils/.initial=6} -\ctikzset{bipoles/cuteinductor/coil height/.initial=.15} -\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.25} -\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.05} -\ctikzset{bipoles/americaninductor/height/.initial=.3} -\ctikzset{bipoles/americaninductor/height 2/.initial=.1} -\ctikzset{bipoles/americaninductor/width/.initial=.8} -\ctikzset{bipoles/americaninductor/coils/.initial=4} -\ctikzset{bipoles/americaninductor/coil height/.initial=.15} -\ctikzset{bipoles/vcuteinductor/height/.initial=.3} -\ctikzset{bipoles/vcuteinductor/width/.initial=.6} -\ctikzset{bipoles/vcuteinductor/coils/.initial=6} -\ctikzset{bipoles/vcuteinductor/coil height/.initial=.15} -\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.25} -\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.05} -\ctikzset{bipoles/vamericaninductor/height/.initial=.6} -\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2} -\ctikzset{bipoles/vamericaninductor/width/.initial=.8} -\ctikzset{bipoles/vamericaninductor/coils/.initial=4} -\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15} -\ctikzset{bipoles/esource/height/.initial=.60} -\ctikzset{bipoles/esource/width/.initial=.60} -\ctikzset{bipoles/isource/height/.initial=.60} -\ctikzset{bipoles/isource/width/.initial=.60} -\ctikzset{bipoles/dcisource/height/.initial=.60} -\ctikzset{bipoles/dcisource/width/.initial=.60} -\ctikzset{bipoles/dcvsource/height/.initial=.60} -\ctikzset{bipoles/dcvsource/width/.initial=.60} -\ctikzset{bipoles/vsourcetri/height/.initial=.60} -\ctikzset{bipoles/vsourcetri/width/.initial=.60} -\ctikzset{bipoles/isourceam/height/.initial=.60} -\ctikzset{bipoles/isourceam/width/.initial=.60} -\ctikzset{bipoles/vsource/height/.initial=.60} -\ctikzset{bipoles/vsource/width/.initial=.60} -\ctikzset{bipoles/vsourceam/height/.initial=.60} -\ctikzset{bipoles/vsourceam/width/.initial=.60} -\ctikzset{bipoles/vsourceam/margin/.initial=.7} -\ctikzset{bipoles/isourcesin/height/.initial=.60} -\ctikzset{bipoles/isourcesin/width/.initial=.60} -\ctikzset{bipoles/vsourcesin/height/.initial=.60} -\ctikzset{bipoles/vsourcesin/width/.initial=.60} -\ctikzset{bipoles/vsourcesquare/height/.initial=.60} -\ctikzset{bipoles/vsourcesquare/width/.initial=.60} -\ctikzset{bipoles/cisource/height/.initial=.7} -\ctikzset{bipoles/cisource/width/.initial=.7} -\ctikzset{bipoles/cisourceam/height/.initial=.7} -\ctikzset{bipoles/cisourceam/width/.initial=.7} -\ctikzset{bipoles/cvsource/height/.initial=.7} -\ctikzset{bipoles/cvsource/width/.initial=.7} -\ctikzset{bipoles/cvsourceam/height/.initial=.7} -\ctikzset{bipoles/cvsourceam/width/.initial=.7} -\ctikzset{bipoles/cvsourceam/margin/.initial=.7} -\ctikzset{bipoles/cvsourceam/text scale/.initial=1} -\ctikzset{bipoles/cisourcesin/width/.initial=.7} -\ctikzset{bipoles/cvsourcesin/height/.initial=.7} -\ctikzset{bipoles/cvsourcesin/width/.initial=.7} -\ctikzset{bipoles/capacitor/height/.initial=.6} -\ctikzset{bipoles/capacitor/width/.initial=.2} -\ctikzset{bipoles/pcapacitor/height/.initial=.6} -\ctikzset{bipoles/pcapacitor/width/.initial=.2} -\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} -\ctikzset{bipoles/vcapacitor/height/.initial=.6} -\ctikzset{bipoles/vcapacitor/width/.initial=.5} -\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4} -\ctikzset{bipoles/battery/height/.initial=.6} -\ctikzset{bipoles/battery/width/.initial=.3} -\ctikzset{bipoles/battery1/height/.initial=.6} -\ctikzset{bipoles/battery1/width/.initial=.3} -\ctikzset{bipoles/diode/height/.initial=.50} -\ctikzset{bipoles/diode/width/.initial=.40} -\ctikzset{bipoles/varcap/height/.initial=.50} -\ctikzset{bipoles/varcap/width/.initial=.45} -\ctikzset{bipoles/interr/height/.initial=.35} -\ctikzset{bipoles/interr/width/.initial=.35} -\ctikzset{bipoles/interr/height 2/.initial=.1} -\ctikzset{bipoles/generic/height/.initial=.30} -\ctikzset{bipoles/generic/width/.initial=.80} -\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30} -\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80} -\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30} -\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60} -\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60} -\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15} -\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25} -\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45} -\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1} -\ctikzset{bipoles/fuse/height/.initial=.20} -\ctikzset{bipoles/fuse/width/.initial=.50} -\ctikzset{bipoles/afuse/height/.initial=.20} -\ctikzset{bipoles/afuse/width/.initial=.50} -\ctikzset{bipoles/generic potentiometer/height/.initial=.80} -\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} -\ctikzset{bipoles/generic potentiometer/width/.initial=.80} -\ctikzset{bipoles/ageneric/height/.initial=.30} -\ctikzset{bipoles/ageneric/width/.initial=.80} -\ctikzset{bipoles/memristor/height/.initial=.30} -\ctikzset{bipoles/memristor/wave height/.initial=.5} -\ctikzset{bipoles/memristor/width/.initial=.80} -\ctikzset{bipoles/tgeneric/height/.initial=.70} -\ctikzset{bipoles/tgeneric/width/.initial=.80} -\ctikzset{bipoles/tfullgeneric/height/.initial=.70} -\ctikzset{bipoles/tfullgeneric/width/.initial=.80} -\ctikzset{bipoles/fullgeneric/height/.initial=.30} -\ctikzset{bipoles/fullgeneric/width/.initial=.80} -\ctikzset{bipoles/open/height/.initial=.25} -\ctikzset{bipoles/open/width/.initial=.8} -\ctikzset{bipoles/ammeter/height/.initial=.60} -\ctikzset{bipoles/ammeter/width/.initial=.60} -\ctikzset{bipoles/ohmmeter/height/.initial=.60} -\ctikzset{bipoles/ohmmeter/width/.initial=.60} -\ctikzset{bipoles/voltmeter/height/.initial=.60} -\ctikzset{bipoles/voltmeter/width/.initial=.60} -\ctikzset{bipoles/buffer/height/.initial=1} -\ctikzset{bipoles/buffer/width/.initial=1} -\ctikzset{bipoles/not port/width/.initial=1} -\ctikzset{bipoles/not port/height/.initial=.8} -\ctikzset{bipoles/not port/circle width/.initial=.15} -\ctikzset{bipoles/lamp/height/.initial=.60} -\ctikzset{bipoles/lamp/width/.initial=.60} -\ctikzset{bipoles/tline/height/.initial=.3} -\ctikzset{bipoles/tline/width/.initial=.8} -\ctikzset{bipoles/squid/height/.initial=.60} -\ctikzset{bipoles/squid/width/.initial=.60} -\ctikzset{bipoles/barrier/height/.initial=.60} -\ctikzset{bipoles/barrier/width/.initial=.60} -\ctikzset{bipoles/thermocouple/height/.initial=.250} -\ctikzset{bipoles/thermocouple/height 2/.initial=.60} -\ctikzset{bipoles/thermocouple/width/.initial=.140} -\ctikzset{bipoles/pushbutton/height/.initial=.5} -\ctikzset{bipoles/pushbutton/height 2/.initial=.0} -\ctikzset{bipoles/pushbutton/width/.initial=.50} - -\ctikzset{bipoles/twoport/width/.initial=.7} -\ctikzset{bipoles/twoport/height/.initial=.7} -\ctikzset{bipoles/twoport/text/.initial=} -\ctikzset{bipoles/vco/width/.initial=.7} -\ctikzset{bipoles/bandpass/width/.initial=.7} -\ctikzset{bipoles/highpass/width/.initial=.7} -\ctikzset{bipoles/lowpass/width/.initial=.7} -\ctikzset{bipoles/adc/width/.initial=.7} -\ctikzset{bipoles/dac/width/.initial=.7} -\ctikzset{bipoles/dsp/width/.initial=.7} -\ctikzset{bipoles/fft/width/.initial=.7} -\ctikzset{bipoles/amp/width/.initial=.7} -\ctikzset{bipoles/vamp/width/.initial=.7} -\ctikzset{bipoles/piattenuator/width/.initial=.7} -\ctikzset{bipoles/vpiattenuator/width/.initial=.7} -\ctikzset{bipoles/tattenuator/width/.initial=.7} -\ctikzset{bipoles/vtattenuator/width/.initial=.7} -\ctikzset{bipoles/phaseshifter/width/.initial=.7} -\ctikzset{bipoles/vphaseshifter/width/.initial=.7} -\ctikzset{bipoles/detector/width/.initial=.7} - -\newif\ifpgf@circuit@mos@arrows -\ctikzset{tripoles/mos style/.is choice} -\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}} -\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}} -\ctikzset{tripoles/nmos/width/.initial=.7} -\ctikzset{tripoles/nmos/gate height/.initial=.35} -\ctikzset{tripoles/nmos/base height/.initial=.5} -\ctikzset{tripoles/nmos/height/.initial=1.1} -\ctikzset{tripoles/nmos/base width/.initial=.5} -\ctikzset{tripoles/nmos/gate width/.initial=.62} -\ctikzset{tripoles/pmos/width/.initial=.7} -\ctikzset{tripoles/pmos/gate height/.initial=.35} -\ctikzset{tripoles/pmos/base height/.initial=.5} -\ctikzset{tripoles/pmos/height/.initial=1.1} -\ctikzset{tripoles/pmos/base width/.initial=.5} -\ctikzset{tripoles/pmos/gate width/.initial=.62} - -\ctikzset{tripoles/nfet/width/.initial=.7} -\ctikzset{tripoles/nfet/gate height/.initial=.35} -\ctikzset{tripoles/nfet/base height/.initial=.5} -\ctikzset{tripoles/nfet/height/.initial=1.1} -\ctikzset{tripoles/nfet/base width/.initial=.5} -\ctikzset{tripoles/nfet/gate width/.initial=.62} - -\ctikzset{tripoles/pfet/width/.initial=.7} -\ctikzset{tripoles/pfet/gate height/.initial=.35} -\ctikzset{tripoles/pfet/base height/.initial=.5} -\ctikzset{tripoles/pfet/height/.initial=1.1} -\ctikzset{tripoles/pfet/base width/.initial=.5} -\ctikzset{tripoles/pfet/gate width/.initial=.62} - -\ctikzset{tripoles/nigfete/width/.initial=.7} -\ctikzset{tripoles/nigfete/gate height/.initial=.35} -\ctikzset{tripoles/nigfete/base height/.initial=.5} -\ctikzset{tripoles/nigfete/height/.initial=1.1} -\ctikzset{tripoles/nigfete/base width/.initial=.5} -\ctikzset{tripoles/nigfete/gate width/.initial=.62} - -\ctikzset{tripoles/nigfetd/width/.initial=.7} -\ctikzset{tripoles/nigfetd/gate height/.initial=.35} -\ctikzset{tripoles/nigfetd/base height/.initial=.5} -\ctikzset{tripoles/nigfetd/height/.initial=1.1} -\ctikzset{tripoles/nigfetd/base width/.initial=.5} -\ctikzset{tripoles/nigfetd/gate width/.initial=.62} - -\ctikzset{tripoles/nigfetebulk/width/.initial=.7} -\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35} -\ctikzset{tripoles/nigfetebulk/base height/.initial=.5} -\ctikzset{tripoles/nigfetebulk/height/.initial=1.1} -\ctikzset{tripoles/nigfetebulk/base width/.initial=.5} -\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62} - -\ctikzset{tripoles/pigfete/width/.initial=.7} -\ctikzset{tripoles/pigfete/gate height/.initial=.35} -\ctikzset{tripoles/pigfete/base height/.initial=.5} -\ctikzset{tripoles/pigfete/height/.initial=1.1} -\ctikzset{tripoles/pigfete/base width/.initial=.5} -\ctikzset{tripoles/pigfete/gate width/.initial=.62} - -\ctikzset{tripoles/pigfetd/width/.initial=.7} -\ctikzset{tripoles/pigfetd/gate height/.initial=.35} -\ctikzset{tripoles/pigfetd/base height/.initial=.5} -\ctikzset{tripoles/pigfetd/height/.initial=1.1} -\ctikzset{tripoles/pigfetd/base width/.initial=.5} -\ctikzset{tripoles/pigfetd/gate width/.initial=.62} - -\ctikzset{tripoles/pigfetebulk/width/.initial=.7} -\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35} -\ctikzset{tripoles/pigfetebulk/base height/.initial=.5} -\ctikzset{tripoles/pigfetebulk/height/.initial=1.1} -\ctikzset{tripoles/pigfetebulk/base width/.initial=.5} -\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62} - -\ctikzset{tripoles/npn/width/.initial=.6} -\ctikzset{tripoles/npn/gate height/.initial=.45} -\ctikzset{tripoles/npn/gate height 2/.initial=.15} -\ctikzset{tripoles/npn/base height/.initial=.4} -\ctikzset{tripoles/npn/height/.initial=1.1} -\ctikzset{tripoles/npn/gate width/.initial=.5} - - - -\ctikzset{tripoles/pnp/width/.initial=.6} -\ctikzset{tripoles/pnp/gate height/.initial=.45} -\ctikzset{tripoles/pnp/gate height 2/.initial=.15} -\ctikzset{tripoles/pnp/base height/.initial=.4} -\ctikzset{tripoles/pnp/height/.initial=1.1} -\ctikzset{tripoles/pnp/gate width/.initial=.5} - -\ctikzset{tripoles/pigbt/width/.initial=.6} -\ctikzset{tripoles/pigbt/gate height/.initial=.45} -\ctikzset{tripoles/pigbt/gate height 2/.initial=.15} -\ctikzset{tripoles/pigbt/base height/.initial=.4} -\ctikzset{tripoles/pigbt/height/.initial=1.1} -\ctikzset{tripoles/pigbt/gate width/.initial=.62} -\ctikzset{tripoles/pigbt/base width/.initial=.5} -\ctikzset{tripoles/nigbt/width/.initial=.6} -\ctikzset{tripoles/nigbt/gate height/.initial=.45} -\ctikzset{tripoles/nigbt/gate height 2/.initial=.15} -\ctikzset{tripoles/nigbt/base height/.initial=.4} -\ctikzset{tripoles/nigbt/height/.initial=1.1} -\ctikzset{tripoles/nigbt/gate width/.initial=.62} -\ctikzset{tripoles/nigbt/base width/.initial=.5} - -\ctikzset{tripoles/njfet/width/.initial=.7} -\ctikzset{tripoles/njfet/gate height/.initial=.5} -\ctikzset{tripoles/njfet/gate height 2/.initial=.35} -\ctikzset{tripoles/njfet/gate width/.initial=.5} -\ctikzset{tripoles/njfet/height/.initial=1.1} -\ctikzset{tripoles/pjfet/width/.initial=.7} -\ctikzset{tripoles/pjfet/gate height/.initial=.5} -\ctikzset{tripoles/pjfet/gate height 2/.initial=.35} -\ctikzset{tripoles/pjfet/gate width/.initial=.5} -\ctikzset{tripoles/pjfet/height/.initial=1.1} - -\ctikzset{tripoles/isfet/width/.initial=1} -\ctikzset{tripoles/isfet/gate height/.initial=.35} -\ctikzset{tripoles/isfet/base height/.initial=.5} -\ctikzset{tripoles/isfet/height/.initial=1.1} -\ctikzset{tripoles/isfet/base width/.initial=.3} -\ctikzset{tripoles/isfet/gate width/.initial=.5} -\ctikzset{tripoles/isfet/wave width/.initial=.16} -\ctikzset{tripoles/isfet/wave amp/.initial=.06} -\ctikzset{tripoles/isfet/waves y sep/.initial=.22} -\ctikzset{tripoles/isfet/waves x sep/.initial=.8} - -\newif\ifpgf@circuit@europeanlogicport -\ctikzset{logic ports/.is choice} -\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } } -\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } } - -\newif\ifpgf@circuit@bipole@voltage@backward -\ctikzset{bipole/voltage/direction/.is choice} -\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} -\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} - -\ctikzset{tripoles/american and port/width/.initial=1.1} -\ctikzset{tripoles/american and port/height/.initial=.8} -\ctikzset{tripoles/american and port/port width/.initial=.7} -\ctikzset{tripoles/american and port/input height/.initial=.5} -\ctikzset{tripoles/american nand port/width/.initial=1.1} -\ctikzset{tripoles/american nand port/height/.initial=.8} -\ctikzset{tripoles/american nand port/port width/.initial=.7} -\ctikzset{tripoles/american nand port/circle width/.initial=.15} -\ctikzset{tripoles/american nand port/input height/.initial=.5} -\ctikzset{tripoles/american or port/width/.initial=1.1} -\ctikzset{tripoles/american or port/height/.initial=.8} -\ctikzset{tripoles/american or port/port width/.initial=.7} -\ctikzset{tripoles/american or port/input height/.initial=.5} -\ctikzset{tripoles/american or port/input skip/.initial=.25} -\ctikzset{tripoles/american or port/aaa/.initial=.6} -\ctikzset{tripoles/american or port/bbb/.initial=.4} -\ctikzset{tripoles/american or port/ccc/.initial=.5} -\ctikzset{tripoles/american or port/ddd/.initial=.0} -\ctikzset{tripoles/american nor port/width/.initial=1.1} -\ctikzset{tripoles/american nor port/height/.initial=.8} -\ctikzset{tripoles/american nor port/port width/.initial=.7} -\ctikzset{tripoles/american nor port/input height/.initial=.5} -\ctikzset{tripoles/american nor port/input skip/.initial=.25} -\ctikzset{tripoles/american nor port/circle width/.initial=.15} -\ctikzset{tripoles/american nor port/aaa/.initial=.6} -\ctikzset{tripoles/american nor port/bbb/.initial=.4} -\ctikzset{tripoles/american nor port/ccc/.initial=.5} -\ctikzset{tripoles/american nor port/ddd/.initial=.0} -\ctikzset{tripoles/american xor port/width/.initial=1.1} -\ctikzset{tripoles/american xor port/height/.initial=.8} -\ctikzset{tripoles/american xor port/port width/.initial=.7} -\ctikzset{tripoles/american xor port/input height/.initial=.5} -\ctikzset{tripoles/american xor port/input skip/.initial=.15} -\ctikzset{tripoles/american xor port/distance/.initial=.1} -\ctikzset{tripoles/american xor port/aaa/.initial=.6} -\ctikzset{tripoles/american xor port/bbb/.initial=.4} -\ctikzset{tripoles/american xor port/ccc/.initial=.5} -\ctikzset{tripoles/american xor port/ddd/.initial=.0} -\ctikzset{tripoles/american xnor port/width/.initial=1.1} -\ctikzset{tripoles/american xnor port/height/.initial=.8} -\ctikzset{tripoles/american xnor port/port width/.initial=.7} -\ctikzset{tripoles/american xnor port/input height/.initial=.5} -\ctikzset{tripoles/american xnor port/input skip/.initial=.15} -\ctikzset{tripoles/american xnor port/distance/.initial=.1} -\ctikzset{tripoles/american xnor port/aaa/.initial=.6} -\ctikzset{tripoles/american xnor port/bbb/.initial=.4} -\ctikzset{tripoles/american xnor port/ccc/.initial=.5} -\ctikzset{tripoles/american xnor port/ddd/.initial=.0} -\ctikzset{tripoles/american xnor port/circle width/.initial=.15} -\ctikzset{tripoles/european and port/width/.initial=1.4} -\ctikzset{tripoles/european and port/height/.initial=.65} -\ctikzset{tripoles/european and port/reserved/.initial=.6} -\ctikzset{tripoles/european and port/input height/.initial=.6} -\ctikzset{tripoles/european or port/width/.initial=1.4} -\ctikzset{tripoles/european or port/height/.initial=.65} -\ctikzset{tripoles/european or port/reserved/.initial=.6} -\ctikzset{tripoles/european or port/input height/.initial=.6} -\ctikzset{tripoles/european xor port/width/.initial=1.4} -\ctikzset{tripoles/european xor port/height/.initial=.65} -\ctikzset{tripoles/european xor port/reserved/.initial=.6} -\ctikzset{tripoles/european xor port/input height/.initial=.6} -\ctikzset{tripoles/european nand port/width/.initial=1.4} -\ctikzset{tripoles/european nand port/not height/.initial=.3} -\ctikzset{tripoles/european nand port/not width/.initial=.8} -\ctikzset{tripoles/european nand port/height/.initial=.65} -\ctikzset{tripoles/european nand port/reserved/.initial=.6} -\ctikzset{tripoles/european nand port/input height/.initial=.6} -\ctikzset{tripoles/european not port/width/.initial=1.4} -\ctikzset{tripoles/european not port/not height/.initial=.3} -\ctikzset{tripoles/european not port/not width/.initial=.8} -\ctikzset{tripoles/european not port/height/.initial=.65} -\ctikzset{tripoles/european not port/reserved/.initial=.6} -\ctikzset{tripoles/european not port/input height/.initial=0} -\ctikzset{tripoles/european xnor port/width/.initial=1.4} -\ctikzset{tripoles/european xnor port/not height/.initial=.3} -\ctikzset{tripoles/european xnor port/not width/.initial=.8} -\ctikzset{tripoles/european xnor port/height/.initial=.65} -\ctikzset{tripoles/european xnor port/reserved/.initial=.6} -\ctikzset{tripoles/european xnor port/input height/.initial=.6} -\ctikzset{tripoles/european nor port/width/.initial=1.4} -\ctikzset{tripoles/european nor port/not height/.initial=.3} -\ctikzset{tripoles/european nor port/not width/.initial=.8} -\ctikzset{tripoles/european nor port/height/.initial=.65} -\ctikzset{tripoles/european nor port/reserved/.initial=.6} -\ctikzset{tripoles/european nor port/input height/.initial=.6} -\ctikzset{tripoles/op amp/width/.initial=1.7} -\ctikzset{tripoles/op amp/port width/.initial=.7} -\ctikzset{tripoles/op amp/height/.initial=1.4} -\ctikzset{tripoles/op amp/input height/.initial=.5} -\ctikzset{tripoles/op amp/up pos/.initial=.45} -\ctikzset{tripoles/op amp/font/.initial=} -\ctikzset{tripoles/gm amp/width/.initial=1.7} -\ctikzset{tripoles/gm amp/port width/.initial=.7} -\ctikzset{tripoles/gm amp/height/.initial=1.4} -\ctikzset{tripoles/gm amp/input height/.initial=.5} -\ctikzset{tripoles/gm amp/up pos/.initial=.45} -\ctikzset{tripoles/plain amp/width/.initial=1.7} -\ctikzset{tripoles/plain amp/port width/.initial=.7} -\ctikzset{tripoles/plain amp/height/.initial=1.4} -\ctikzset{tripoles/plain amp/input height/.initial=.5} -\ctikzset{tripoles/plain amp/up pos/.initial=.45} - -\ctikzset{tripoles/thyristor/height/.initial=1.10} -\ctikzset{tripoles/thyristor/height 2/.initial=.5} -\ctikzset{tripoles/thyristor/width/.initial=1.0} -\ctikzset{tripoles/thyristor/diode height/.initial=.5} -\ctikzset{tripoles/thyristor/diode width left/.initial=.4} -\ctikzset{tripoles/thyristor/diode width right/.initial=.3} - -\ctikzset{tripoles/triac/height/.initial=1.1} -\ctikzset{tripoles/triac/width/.initial=1} -\ctikzset{tripoles/triac/diode width left/.initial=.3} -\ctikzset{tripoles/triac/diode width right/.initial=.3} - -\ctikzset{tripoles/spdt/width/.initial=.85} -\ctikzset{tripoles/spdt/height/.initial=.45} -\ctikzset{tripoles/spdt/margin/.initial=.45} - -\ctikzset{tripoles/toggleswitch/height/.initial=.8} -\ctikzset{tripoles/toggleswitch/height 2/.initial=.0} -\ctikzset{tripoles/toggleswitch/width/.initial=.80} - -\ctikzset{tripoles/mixer/width/.initial=0.7} -\ctikzset{tripoles/adder/width/.initial=0.7} -\ctikzset{tripoles/circulator/width/.initial=.7} - -\ctikzset{tripoles/wilkinson/height/.initial=1.3} -\ctikzset{tripoles/wilkinson/width/.initial=1.3} - -\ctikzset{quadpoles/transformer/width/.initial=1.5} -\ctikzset{quadpoles/transformer/width1/.initial=.4} -\ctikzset{quadpoles/transformer/height/.initial=1.5} -\ctikzset{quadpoles/transformer/height1/.initial=.8} -\ctikzset{quadpoles/transformer core/width/.initial=1.5} -\ctikzset{quadpoles/transformer core/height/.initial=1.5} -\ctikzset{quadpoles/transformer core/core height/.initial=.5} -\ctikzset{quadpoles/transformer core/core width/.initial=.05} -\ctikzset{quadpoles/gyrator/width/.initial=1.5} -\ctikzset{quadpoles/gyrator/height/.initial=1.5} -\ctikzset{quadpoles/coupler/width/.initial=1.3} -\ctikzset{quadpoles/coupler/height/.initial=1.3} - - - -\ctikzset{bipole/.is family} -\ctikzset{bipole/kind/.initial = } -\ctikzset{bipole/name/.initial = } -\newif\ifpgf@circuit@bipole@reversed -\ctikzset{bipole/reversed/.is if=pgf@circuit@bipole@reversed} -\newif\ifpgf@circuit@bipole@isvoltage -\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage} -\newif\ifpgf@circuit@bipole@iscurrent -\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent} - -\ctikzset{bipole/voltage/.is family} -\newif\ifpgf@circuit@bipole@voltage@backward -\ctikzset{bipole/voltage/direction/.is choice} -\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} -\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} -\newif\ifpgf@circuit@bipole@voltage@below -\ctikzset{bipole/voltage/position/.is choice} -\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}} -\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}} - -\ctikzset{bipole/voltage/label/unit/.initial=} -\ctikzset{bipole/voltage/label/name/.initial=} - -\ctikzset{bipole/current/.is family} -\newif\ifpgf@circuit@bipole@current@backward -\ctikzset{bipole/current/direction/.is choice} -\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}} -\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}} -\newif\ifpgf@circuit@bipole@current@before -\ctikzset{bipole/current/x position/.is choice} -\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}} -\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}} -\newif\ifpgf@circuit@bipole@current@below -\ctikzset{bipole/current/y position/.is choice} -\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}} -\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}} - -\ctikzset{bipole/current/label/unit/.initial=} -\ctikzset{bipole/current/label/name/.initial=} - -\ctikzset{bipole/label/.is family} -\ctikzset{bipole/label/position/.initial=90} -\ctikzset{bipole/label/unit/.initial=} -\ctikzset{bipole/label/name/.initial=} -\ctikzset{bipole/nodes/.is family} -\ctikzset{bipole/nodes/left/.is choice} -\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}} -\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}} -\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}} -\ctikzset{bipole/nodes/right/.is choice} -\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}} -\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}} -\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}} - - - - -\newif\ifpgf@circuit@europeanresistor -\ctikzset{resistor/.is choice} -\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse } -\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue } - -\ctikzset{inductor/.is choice} -\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}} -\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}} -\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}} - -\newif\ifpgf@circuit@fulldiode -\ctikzset{diode/.is if=pgf@circuit@fulldiode} -\ctikzset{diode/.is choice} -\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse } -\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue } -\ctikzset{thickness/.initial=2} -\ctikzset{color/.initial=black} -\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}} - - -\newif\ifpgf@circ@siunitx -\newif\ifpgf@circ@siunitx@res - -\ctikzset{voltage/.is family} -\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units -\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1 -\ctikzset{voltage/bump a/.initial=1.2} -\ctikzset{voltage/bump b/.initial=1.5} -\ctikzset{voltage/european label distance/.initial=1.4} -\ctikzset{voltage/american label distance/.initial=1.1} -% special cases -\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/generic/voltage/bump b/.initial=2} -\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8} -%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3} -\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2} -\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5} -\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2} -\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8} -\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2} -\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8} -\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/memristor/voltage/bump b/.initial=2} -\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8} -%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4} -\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1} -%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4} -\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2} -%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2} -\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8} -%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4} -\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2} -%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6} -%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6} - -\ctikzset{current/.is family} -\ctikzset{current/distance/.initial = .5} - -\tikzset{american currents/.style = { \circuitikzbasekey/current = american } } -\tikzset{european currents/.style = { \circuitikzbasekey/current = european } } -\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } } -\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } } -\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } } -\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } } - -\newif\ifpgf@circuit@europeangfsurgearrester -\ctikzset{gas filled surge arrester/.is choice} -\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } } -\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } } - -\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } } -\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = european } } -\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } } -\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } } -\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } } -\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full } } -\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty } } -\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } } -\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } } -\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester } } -\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } } -\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } } - -% I should try to make the tree clearer (this voltaege conflicts with the options above) - -\newif\ifpgf@circuit@europeanvoltage -\ctikzset{voltage/.is choice} -\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } } -\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } } - -\newif\ifpgf@circuit@europeancurrent -\ctikzset{current/.is choice} -\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse } -\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue } - -\ctikzset{label/align/.is choice} -\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}} -\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}} -\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}} -%% dependencies - - - - - - -%%%%%%%%%% new -\pgfkeys{\circuitikzbasekey/.search also={/tikz}} - - - - -\input pgfcircutils.tex -\input pgfcircmath.tex - -\input pgfcircshapes.tex -\input pgfcircmonopoles.tex -\input pgfcircbipoles.tex -\input pgfcirctripoles.tex -\input pgfcircquadpoles.tex -\input pgfcircnpoles.tex - -\input pgfcirclabel.tex -\input pgfcircvoltage.tex -\input pgfcirccurrent.tex -\input pgfcircinputarrows.tex - - - - diff --git a/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex b/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex deleted file mode 100644 index 3319bc18c1f..00000000000 --- a/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex +++ /dev/null @@ -1,548 +0,0 @@ -%%%%%%%%%%%% -%% Dimensions - -% coordinate bipoli -\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero -\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right -\newdimen\pgf@circ@res@other -\newdimen\pgf@circ@res@step -\newdimen\pgf@circ@res@temp - -% thickness iniziale -\newdimen \pgfstartlinewidth - -\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - - - -% Names -\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@ -\ctikzset{n/.code = { - \pgfkeys{/tikz/circuitikz/bipole/name=#1} -}} - -% Reflect the node along -\ctikzset{mirrored/.is choice} -\ctikzset{mirror value/.initial=1} -\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} } -\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} } -\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}} - -% Initialize paths -\def\pgfcircresetpath{ - \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, - bipole/reversed=false, bipole/kind=, - bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below, - bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false, - bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after, - bipole/current/y position=above, bipole/current/direction=forward, - mirrored=false - } -} - - -%% Generic bipole path -\def\pgf@circ@bipole@path#1#2{ - \pgfextra{ - \ctikzset{bipole/kind = #1} - - \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} - \def\pgf@circ@temp{} - \ifx\pgf@temp\pgf@circ@temp % if it has not a name - \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} - \ctikzset{bipole/name = #2\pgf@circ@rand} % create it - \fi - - \def\pgf@temp{open} - \def\pgf@circ@temp{#1} - } - \ifpgf@circuit@bipole@reversed - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} - \else - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} - \fi - \pgfextra{ - \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} - {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} - \edef\pgf@circ@direction{\pgfmathresult} - } - ($(\tikztostart) ! .5 ! (\tikztotarget)$) - node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}] - (\ctikzvalof{bipole/name}) {} - \ifx\pgf@temp\pgf@circ@temp % if it is an open - \else - (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) - (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) - \fi - \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi - \drawpoles - \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi - \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi - % reset - \pgfextra{ - \pgfcircresetpath - } - (\tikztotarget) \tikztonodes % e si continua -} - - -%% Path definitions - -\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} -\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi} -\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi} -\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}} -\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}} -\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}} -\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}} -\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} -\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}} -\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} -\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} -\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}} -\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} -\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}} -\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}} -\def\pgf@circ@inductor@path#1{% - \pgfextra{ - \edef\pgf@circ@temp{\ctikzvalof{inductor}}% - \def\pgf@temp{european}% - } - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@europeaninductor@path{#1}% - \else% - \pgfextra{ \def\pgf@temp{cute} }% - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@cuteinductor@path{#1}% - \else% - \pgf@circ@americaninductor@path{#1}% - \fi% - \fi% -} -\def\pgf@circ@vinductor@path#1{ - \pgfextra{ - \edef\pgf@circ@temp{\ctikzvalof{inductor}}% - \def\pgf@temp{european}% - } - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@veuropeaninductor@path{#1}% - \else% - \pgfextra{ \def\pgf@temp{cute} }% - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@vcuteinductor@path{#1}% - \else% - \pgf@circ@vamericaninductor@path{#1}% - \fi% - \fi% -} -\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} -\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}} -\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}} -\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}} -\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}} -\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} -\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}} -\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}} -\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}} -\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}} -\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}} -\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}} -\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} -\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}} -\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}} -\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}} -\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}} -\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}} -\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}} -\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}} -\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}} -\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}} -\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}} -\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}} -\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}} -\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}} -\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}} -\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}} -\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}} -\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}} -\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}} -\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}} -\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}} -\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}} -\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}} -\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}} -\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}} -\def\pgf@circ@spst@path#1{\pgf@circ@bipole@path{spst}{#1}} -\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} -\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}} -\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}} -\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}} -\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}} -\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}} -\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} -\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} -\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}} -\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}} -\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} -\def\pgf@circ@empty@path#1{} -\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}} -\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} -\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}} -\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} -\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} -\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} -\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} -\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} -\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}} -\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}} -\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}} - -\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi} -\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}} -\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}} - -\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}} -\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}} -\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}} -\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}} -\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}} -\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}} -\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}} -\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}} -\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}} -\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}} -\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}} -\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}} -\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}} -\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}} -\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}} -\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}} -\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}} -\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}} - - -%% Styles - -%% Aggiungere per thyristor e tripoli semplici - -\def\comnpatname{\ifpgf@circuit@compat *\else\fi} -\def\compattikzset#1{\tikzset{\comnpatname#1}} - -%\def\ctikzsetbipole#1#2{% -% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}% -%} - -\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}} -\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}} -\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}} -\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}} -\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}} -\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}} -\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}} -\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}} -\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}} -\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}} -\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}} -\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}} -\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}} -\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}} -\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} -\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} -\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} -\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} -\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} -\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}} -\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}} -\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} -\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}} -\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}} -\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}} -\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}} -\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}} -\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}} -\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}} -\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} -\compattikzset{transmission line/.style = {tline = #1}} -\compattikzset{TL/.style = {tline = #1}} -\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} - -\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} -\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} - - -\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}} -\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}} -\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}} -\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}} -\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}} -\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}} -\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}} - -\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}} - -\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} -\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} -\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}} -\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}} -\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}} - -\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}} -\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}} -\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}} -\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}} -\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}} -\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}} -\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}} -\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}} -\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}} -\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}} -\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}} -\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}} -\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}} -\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}} -\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}} -\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}} -\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}} -\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}} - -\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}} -\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}} -\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}} -\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}} -\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}} -\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}} -\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}} - -\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}} -\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}} -\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}} -\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}} -\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}} -\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}} -\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}} - - \compattikzset{Schottky diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} - \compattikzset{Zener diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} - \compattikzset{tunnel diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} - \compattikzset{photodiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi photodiode}} - \compattikzset{led/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi led}} - \compattikzset{varcap/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi varcap}} - \compattikzset{diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi diode}} %%%%%%%%%%%%@@@ - - - - -\compattikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}} -\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}} -\compattikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}} - -\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}} -\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}} -\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spst@path, l=#1}} -\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}} -\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}} - -\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}} -\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}} -\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}} - -% short forms -\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, l=#1}} -\compattikzset{myvsource/.style = {\comnpatname dcvsource = #1}}%For compability, not documented, can be removed in further versions -\compattikzset{myisource/.style = {\comnpatname dcisource = #1}}%For compability, not documented, can be removed in further versions -\compattikzset{vsource/.style = {\comnpatname voltage source = #1}} -\compattikzset{isource/.style = {\comnpatname current source = #1}} -\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}} -\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}} -\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}} -\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}} -\compattikzset{vsourcetri/.style = {triangle voltage source = #1}} -\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}} -\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} -\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} - -\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}} -\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}} -\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} -\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} - -\compattikzset{R/.style= {\comnpatname resistor = #1}} -%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi -\compattikzset{vR/.style= {\comnpatname variable resistor = #1}} -\compattikzset{phR/.style= {\comnpatname photoresistor = #1}} -\compattikzset{thR/.style= {\comnpatname thermistor = #1}} -\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}} -\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}} -\compattikzset{pR/.style= {\comnpatname potentiometer = #1}} -\compattikzset{C/.style = {\comnpatname capacitor = #1}} -\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}} -\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}} -\compattikzset{L/.style = {\comnpatname inductor = #1}} -\compattikzset{vL/.style = {\comnpatname variable inductor = #1}} -\compattikzset{V/.style = {\comnpatname voltage source = #1}} -\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}} -\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}} -\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}} -\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}} -\def\pgf@temp#1{ - \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} } - \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} } - \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} } - \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} } -} -\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} -\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} -\compattikzset{I/.style = {\comnpatname current source = #1}} -\compattikzset{cI/.style = {\comnpatname controlled current source = #1}} -\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}} -\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}} -\def\pgf@temp#1{ - \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} } - \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} } - \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} } - \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} } -} -\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} -\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} -\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} -\compattikzset{Do/.style = {\comnpatname empty diode}} -\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}} -\compattikzset{zDo/.style = {\comnpatname empty Zener diode}} -\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}} -\compattikzset{pDo/.style = {\comnpatname empty photodiode}} -\compattikzset{leDo/.style = {\comnpatname empty led}} -\compattikzset{VCo/.style = {\comnpatname empty varcap}} -\compattikzset{D*/.style = {\comnpatname full diode}} -\compattikzset{tD*/.style = {\comnpatname full tunnel diode}} -\compattikzset{zD*/.style = {\comnpatname full Zener diode}} -\compattikzset{sD*/.style = {\comnpatname full Schottky diode}} -\compattikzset{pD*/.style = {\comnpatname full photodiode}} -\compattikzset{leD*/.style = {\comnpatname full led}} -\compattikzset{VC*/.style = {\comnpatname full varcap}} -\compattikzset{D/.style = {\comnpatname diode}} -\compattikzset{tD/.style = {\comnpatname tunnel diode}} -\compattikzset{zD/.style = {\comnpatname Zener diode}} -\compattikzset{sD/.style = {\comnpatname Schottky diode}} -\compattikzset{pD/.style = {\comnpatname photodiode}} -\compattikzset{leD/.style = {\comnpatname led}} -\compattikzset{VC/.style = {\comnpatname varcap}} - -\compattikzset{Tr/.style = {\comnpatname triac}} -\compattikzset{Mr/.style = {\comnpatname memristor}} -\compattikzset{Ty/.style = {\comnpatname thyristor}} - -\compattikzset{cspst/.style = {\comnpatname closing switch = #1}} -\compattikzset{ospst/.style = {\comnpatname opening switch = #1}} -\compattikzset{spst/.style = {switch = #1}} - -\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}} - - -\def\inheritlogicport#1#2{ - \pgfdeclareshape{#2 port}{ - \inheritsavedanchors[from=#1 #2 port] - \inheritbackgroundpath[from=#1 #2 port] - \inheritanchor[from=#1 #2 port]{in} - \inheritanchor[from=#1 #2 port]{in 1} - \inheritanchor[from=#1 #2 port]{in 2} - \inheritanchor[from=#1 #2 port]{out} - \inheritanchor[from=#1 #2 port]{center} - \inheritanchor[from=#1 #2 port]{left} - } -} - -\ifpgf@circuit@europeanlogicport - \inheritlogicport{european}{and} - \inheritlogicport{european}{or} - \inheritlogicport{european}{xor} - \inheritlogicport{european}{not} - \inheritlogicport{european}{nand} - \inheritlogicport{european}{nor} - \inheritlogicport{european}{xnor} -\else - \inheritlogicport{american}{and} - \inheritlogicport{american}{or} - \inheritlogicport{american}{xor} - \inheritlogicport{american}{not} - \inheritlogicport{american}{nand} - \inheritlogicport{american}{nor} - \inheritlogicport{american}{xnor} -\fi - -% Transistor like bipoles - -\def\pgf@circ@trans@path#1#2{ - \pgfextra{ - \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} - \def\pgf@circ@temp{#2} - \ifx\pgf@temp\pgf@circ@temp % if it has not a name - \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} - \ctikzset{bipole/name = trans\pgf@circ@rand} % create it - \fi - } - \ifpgf@circuit@bipole@reversed - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} - \else - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} - \fi - \pgfextra{ - \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} - {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} - \pgfmathadd{\pgfmathresult}{-90} - \edef\pgf@circ@direction{\pgfmathresult} - } - ($(\tikztostart) ! .5 ! (\tikztotarget)$) - node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}] - (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}} - (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) - (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) - \pgfextra{ - \pgfcircresetpath - } - (\tikztotarget) \tikztonodes % e si continua -} - - -\def\pgf@circ@definetranspath#1{ - \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}} -} - -\pgf@circ@definetranspath{nmos} -\pgf@circ@definetranspath{pmos} -\pgf@circ@definetranspath{npn} -\pgf@circ@definetranspath{pnp} -\pgf@circ@definetranspath{nfet} -\pgf@circ@definetranspath{nigfete} -\pgf@circ@definetranspath{nigfetd} -\pgf@circ@definetranspath{nigfetebulk} -\pgf@circ@definetranspath{pfet} -\pgf@circ@definetranspath{pigfete} -\pgf@circ@definetranspath{pigfetd} -\pgf@circ@definetranspath{pigfetebulk} -\pgf@circ@definetranspath{njfet} -\pgf@circ@definetranspath{pjfet} -\pgf@circ@definetranspath{pigbt} -\pgf@circ@definetranspath{nigbt} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex new file mode 100644 index 00000000000..dabfbcbdb27 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -0,0 +1,828 @@ + +%% Options + + + + +%% Keys + +\long\def\pgf@circ@comment#1{} + +\def\circuitikzbasekey{/tikz/circuitikz} + +\pgfkeys{\circuitikzbasekey/.is family} + +\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}} +\let\ctikzset\circuitikzset +\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} +\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} + +\newif\ifpgf@circ@siunitx +\newif\ifpgf@circuit@compat +\newif\ifpgf@circ@oldvoltagedirection + +% Option ">" for twoports +\newif\ifpgf@circuit@inputarrow +\ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}} +\ctikzset{inputarrow/.is choice} +\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}} +\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}} + +% Option "boxed" for nodes and twoports +\newif\ifpgf@circuit@boxed +\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}} +\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}} +\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}} +\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}} + +% Option "dashed" for nodes and twoports +\newif\ifpgf@circuit@dashed +\pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}} +\ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}} + +% Option "t=*" for nodes +\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}} + + + +\ctikzset{bipoles/.is family} +\ctikzset{bipoles/border margin/.initial=1.1} +\ctikzset{bipoles/thickness/.initial=2} +\ctikzset{bipoles/length/.initial=1.4cm} +\ctikzset{nodes width/.initial=.04} +\newdimen\pgf@circ@Rlen +\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}} + +\ctikzset{monopoles/.is family} +\ctikzset{monopoles/ground/width/.initial=.25} +\ctikzset{monopoles/tground/thickness/.initial=3} +\ctikzset{monopoles/vcc/width/.initial=.2} +\ctikzset{monopoles/match/width/.initial=.4} +\ctikzset{monopoles/chassis/width/.initial=.25} +\ctikzset{monopoles/alternative chassis/width/.initial=.25} +\ctikzset{monopoles/equipotentiality/width/.initial=.25} +\ctikzset{monopoles/tlinestub/width/.initial=.25} +\ctikzset{monopoles/antenna/width/.initial=.25} +\ctikzset{monopoles/antenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/antenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/txantenna/width/.initial=.25} +\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/rxantenna/width/.initial=.25} + +\ctikzset{bipoles/resistor/height/.initial=.3} +\ctikzset{bipoles/resistor/width/.initial=.8} +\ctikzset{bipoles/potentiometer/height/.initial=.8} +\ctikzset{bipoles/potentiometer/height 2/.initial=.3} +\ctikzset{bipoles/potentiometer/width/.initial=.8} +\ctikzset{bipoles/photoresistor/height/.initial=.6} +\ctikzset{bipoles/photoresistor/height 2/.initial=.3} +\ctikzset{bipoles/photoresistor/width/.initial=.8} +\ctikzset{bipoles/thermistor/main/.initial=.7} +\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/thermistorntc/width/.initial=.8} +\ctikzset{bipoles/thermistorntc/main/.initial=.7} +\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7 +\ctikzset{bipoles/thermistorptc/width/.initial=.8} +\ctikzset{bipoles/thermistorptc/main/.initial=.7} +\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7 +\ctikzset{bipoles/thermistor/width/.initial=.8} +\ctikzset{bipoles/varistor/main/.initial=.7} +\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/varistor/width/.initial=.8} +\ctikzset{bipoles/vresistor/height/.initial=.6} +\ctikzset{bipoles/vresistor/width/.initial=.8} +\ctikzset{bipoles/cuteinductor/height/.initial=.3} +\ctikzset{bipoles/cuteinductor/width/.initial=.6} +\ctikzset{bipoles/cuteinductor/coils/.initial=6} +\ctikzset{bipoles/cuteinductor/coil height/.initial=.15} +\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.25} +\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.05} +\ctikzset{bipoles/americaninductor/height/.initial=.3} +\ctikzset{bipoles/americaninductor/height 2/.initial=.1} +\ctikzset{bipoles/americaninductor/width/.initial=.8} +\ctikzset{bipoles/americaninductor/coils/.initial=4} +\ctikzset{bipoles/americaninductor/coil height/.initial=.15} +\ctikzset{bipoles/vcuteinductor/height/.initial=.3} +\ctikzset{bipoles/vcuteinductor/width/.initial=.6} +\ctikzset{bipoles/vcuteinductor/coils/.initial=6} +\ctikzset{bipoles/vcuteinductor/coil height/.initial=.15} +\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.25} +\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.05} +\ctikzset{bipoles/vamericaninductor/height/.initial=.6} +\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2} +\ctikzset{bipoles/vamericaninductor/width/.initial=.8} +\ctikzset{bipoles/vamericaninductor/coils/.initial=4} +\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15} +\ctikzset{bipoles/esource/height/.initial=.60} +\ctikzset{bipoles/esource/width/.initial=.60} +\ctikzset{bipoles/pvsource/height/.initial=.60} +\ctikzset{bipoles/pvsource/width/.initial=.60} +\ctikzset{bipoles/isource/height/.initial=.60} +\ctikzset{bipoles/isource/width/.initial=.60} +\ctikzset{bipoles/dcisource/height/.initial=.60} +\ctikzset{bipoles/dcisource/width/.initial=.60} +\ctikzset{bipoles/dcvsource/height/.initial=.60} +\ctikzset{bipoles/dcvsource/width/.initial=.60} +\ctikzset{bipoles/vsourcetri/height/.initial=.60} +\ctikzset{bipoles/vsourcetri/width/.initial=.60} +\ctikzset{bipoles/isourceam/height/.initial=.60} +\ctikzset{bipoles/isourceam/width/.initial=.60} +\ctikzset{bipoles/vsource/height/.initial=.60} +\ctikzset{bipoles/vsource/width/.initial=.60} +\ctikzset{bipoles/vsourceam/height/.initial=.60} +\ctikzset{bipoles/vsourceam/width/.initial=.60} +\ctikzset{bipoles/vsourceam/margin/.initial=.7} +\ctikzset{bipoles/isourcesin/height/.initial=.60} +\ctikzset{bipoles/isourcesin/width/.initial=.60} +\ctikzset{bipoles/vsourcesin/height/.initial=.60} +\ctikzset{bipoles/vsourcesin/width/.initial=.60} +\ctikzset{bipoles/vsourcesquare/height/.initial=.60} +\ctikzset{bipoles/vsourcesquare/width/.initial=.60} +\ctikzset{bipoles/cisource/height/.initial=.7} +\ctikzset{bipoles/cisource/width/.initial=.7} +\ctikzset{bipoles/cisourceam/height/.initial=.7} +\ctikzset{bipoles/cisourceam/width/.initial=.7} +\ctikzset{bipoles/cvsource/height/.initial=.7} +\ctikzset{bipoles/cvsource/width/.initial=.7} +\ctikzset{bipoles/cvsourceam/height/.initial=.7} +\ctikzset{bipoles/cvsourceam/width/.initial=.7} +\ctikzset{bipoles/cvsourceam/margin/.initial=.7} +\ctikzset{bipoles/cvsourceam/text scale/.initial=1} +\ctikzset{bipoles/cisourcesin/width/.initial=.7} +\ctikzset{bipoles/cvsourcesin/height/.initial=.7} +\ctikzset{bipoles/cvsourcesin/width/.initial=.7} +\ctikzset{bipoles/capacitor/height/.initial=.6} +\ctikzset{bipoles/capacitor/width/.initial=.2} +\ctikzset{bipoles/ecapacitor/height/.initial=.5} +\ctikzset{bipoles/ecapacitor/width/.initial=.2} +\ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath} +\ctikzset{bipoles/pcapacitor/height/.initial=.6} +\ctikzset{bipoles/pcapacitor/width/.initial=.2} +\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} +\ctikzset{bipoles/vcapacitor/height/.initial=.6} +\ctikzset{bipoles/vcapacitor/width/.initial=.5} +\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4} +\ctikzset{bipoles/piezoelectric/height/.initial=.7} +\ctikzset{bipoles/piezoelectric/width/.initial=.5} +\ctikzset{bipoles/battery/height/.initial=.6} +\ctikzset{bipoles/battery/width/.initial=.3} +\ctikzset{bipoles/battery1/height/.initial=.6} +\ctikzset{bipoles/battery1/width/.initial=.3} +\ctikzset{bipoles/diode/height/.initial=.50} +\ctikzset{bipoles/diode/width/.initial=.40} +\ctikzset{bipoles/varcap/height/.initial=.50} +\ctikzset{bipoles/varcap/width/.initial=.45} +\ctikzset{bipoles/interr/height/.initial=.35} +\ctikzset{bipoles/interr/width/.initial=.35} +\ctikzset{bipoles/interr/height 2/.initial=.1} +\ctikzset{bipoles/generic/height/.initial=.30} +\ctikzset{bipoles/generic/width/.initial=.80} +\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30} +\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80} +\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30} +\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60} +\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60} +\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15} +\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25} +\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45} +\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1} +\ctikzset{bipoles/fuse/height/.initial=.20} +\ctikzset{bipoles/fuse/width/.initial=.50} +\ctikzset{bipoles/afuse/height/.initial=.20} +\ctikzset{bipoles/afuse/width/.initial=.50} +\ctikzset{bipoles/generic potentiometer/height/.initial=.80} +\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} +\ctikzset{bipoles/generic potentiometer/width/.initial=.80} +\ctikzset{bipoles/ageneric/height/.initial=.30} +\ctikzset{bipoles/ageneric/width/.initial=.80} +\ctikzset{bipoles/memristor/height/.initial=.30} +\ctikzset{bipoles/memristor/wave height/.initial=.5} +\ctikzset{bipoles/memristor/width/.initial=.80} +\ctikzset{bipoles/tgeneric/height/.initial=.70} +\ctikzset{bipoles/tgeneric/width/.initial=.80} +\ctikzset{bipoles/tfullgeneric/height/.initial=.70} +\ctikzset{bipoles/tfullgeneric/width/.initial=.80} +\ctikzset{bipoles/fullgeneric/height/.initial=.30} +\ctikzset{bipoles/fullgeneric/width/.initial=.80} +\ctikzset{bipoles/open/height/.initial=.25} +\ctikzset{bipoles/open/width/.initial=.8} +\ctikzset{bipoles/ammeter/height/.initial=.60} +\ctikzset{bipoles/ammeter/width/.initial=.60} +\ctikzset{bipoles/ohmmeter/height/.initial=.60} +\ctikzset{bipoles/ohmmeter/width/.initial=.60} +\ctikzset{bipoles/voltmeter/height/.initial=.60} +\ctikzset{bipoles/voltmeter/width/.initial=.60} +\ctikzset{bipoles/buffer/height/.initial=1} +\ctikzset{bipoles/buffer/width/.initial=1} +\ctikzset{bipoles/not port/width/.initial=1} +\ctikzset{bipoles/not port/height/.initial=.8} +\ctikzset{bipoles/not port/circle width/.initial=.15} +\ctikzset{bipoles/lamp/height/.initial=.60} +\ctikzset{bipoles/lamp/width/.initial=.60} +\ctikzset{bipoles/tline/height/.initial=.3} +\ctikzset{bipoles/tline/width/.initial=.8} +\ctikzset{bipoles/squid/height/.initial=.60} +\ctikzset{bipoles/squid/width/.initial=.60} +\ctikzset{bipoles/barrier/height/.initial=.60} +\ctikzset{bipoles/barrier/width/.initial=.60} +\ctikzset{bipoles/thermocouple/height/.initial=.250} +\ctikzset{bipoles/thermocouple/height 2/.initial=.60} +\ctikzset{bipoles/thermocouple/width/.initial=.140} +\ctikzset{bipoles/pushbutton/height/.initial=.5} +\ctikzset{bipoles/pushbutton/height 2/.initial=.0} +\ctikzset{bipoles/pushbutton/width/.initial=.50} + +\ctikzset{bipoles/twoport/width/.initial=.7} +\ctikzset{bipoles/twoport/height/.initial=.7} +\ctikzset{bipoles/twoport/text/.initial=} +\ctikzset{bipoles/vco/width/.initial=.7} +\ctikzset{bipoles/bandpass/width/.initial=.7} +\ctikzset{bipoles/highpass/width/.initial=.7} +\ctikzset{bipoles/lowpass/width/.initial=.7} +\ctikzset{bipoles/adc/width/.initial=.7} +\ctikzset{bipoles/dac/width/.initial=.7} +\ctikzset{bipoles/dsp/width/.initial=.7} +\ctikzset{bipoles/fft/width/.initial=.7} +\ctikzset{bipoles/amp/width/.initial=.7} +\ctikzset{bipoles/vamp/width/.initial=.7} +\ctikzset{bipoles/piattenuator/width/.initial=.7} +\ctikzset{bipoles/vpiattenuator/width/.initial=.7} +\ctikzset{bipoles/tattenuator/width/.initial=.7} +\ctikzset{bipoles/vtattenuator/width/.initial=.7} +\ctikzset{bipoles/phaseshifter/width/.initial=.7} +\ctikzset{bipoles/vphaseshifter/width/.initial=.7} +\ctikzset{bipoles/detector/width/.initial=.7} + +\newif\ifpgf@circuit@mos@arrows +\ctikzset{tripoles/mos style/.is choice} +\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}} +\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}} + +% Option solderdot for fet +\newif\ifpgf@circuit@fet@solderdot +\pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}} +\ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}} +\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}} +\ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}} + +% Option bodydiode for fet +\newif\ifpgf@circuit@fet@bodydiode +\pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}} +\ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}} +\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}} +\ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}} + +% Option draw fet without gate connection +\newif\ifpgf@circuit@bpt@drawgate +\pgf@circuit@bpt@drawgatetrue +\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}} +\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}} +\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}} +\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}} + +% Option draw bpt without base connection +\newif\ifpgf@circuit@bpt@drawbase +\pgf@circuit@bpt@drawbasetrue +\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}} +\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}} +\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}} +\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}} + +% Option draw bpt with optical input +\newif\ifpgf@circuit@bpt@drawphoto +\pgf@circuit@bpt@drawphotofalse +\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}} +\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}} +\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}} +\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}} + +% Option draw pmos with empty circle +\newif\ifpgf@circuit@pmos@emptycircle +\newif\ifpgf@circuit@pmos@emptycircle +\pgf@circuit@pmos@emptycirclefalse +\pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}} +\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}} + + +\newif\ifpgf@circuit@fet@ntype +\pgf@circuit@fet@ntypetrue %default true +%\newif\ifpgf@circuit@fet@ptype +%\ctikzset{tripoles/nmos/.add code={\pgf@circuit@fet@ntypetrue}} +\ctikzset{tripoles/nmos/width/.initial=.7} +\ctikzset{tripoles/nmos/gate height/.initial=.35} +\ctikzset{tripoles/nmos/base height/.initial=.5} +\ctikzset{tripoles/nmos/height/.initial=1.1} +\ctikzset{tripoles/nmos/base width/.initial=.5} +\ctikzset{tripoles/nmos/gate width/.initial=.62} +\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3} +\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3} +\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6} + +\ctikzset{tripoles/pmos/width/.initial=.7} +\ctikzset{tripoles/pmos/gate height/.initial=.35} +\ctikzset{tripoles/pmos/base height/.initial=.5} +\ctikzset{tripoles/pmos/height/.initial=1.1} +\ctikzset{tripoles/pmos/base width/.initial=.5} +\ctikzset{tripoles/pmos/gate width/.initial=.62} +\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/nfet/width/.initial=.7} +\ctikzset{tripoles/nfet/gate height/.initial=.35} +\ctikzset{tripoles/nfet/base height/.initial=.5} +\ctikzset{tripoles/nfet/height/.initial=1.1} +\ctikzset{tripoles/nfet/base width/.initial=.5} +\ctikzset{tripoles/nfet/gate width/.initial=.62} +\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3} +\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3} +\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/pfet/width/.initial=.7} +\ctikzset{tripoles/pfet/gate height/.initial=.35} +\ctikzset{tripoles/pfet/base height/.initial=.5} +\ctikzset{tripoles/pfet/height/.initial=1.1} +\ctikzset{tripoles/pfet/base width/.initial=.5} +\ctikzset{tripoles/pfet/gate width/.initial=.62} +\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/nigfete/width/.initial=.7} +\ctikzset{tripoles/nigfete/gate height/.initial=.35} +\ctikzset{tripoles/nigfete/base height/.initial=.5} +\ctikzset{tripoles/nigfete/height/.initial=1.1} +\ctikzset{tripoles/nigfete/base width/.initial=.5} +\ctikzset{tripoles/nigfete/gate width/.initial=.62} +\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3} +\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3} +\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6} + +\ctikzset{tripoles/nigfetd/width/.initial=.7} +\ctikzset{tripoles/nigfetd/gate height/.initial=.35} +\ctikzset{tripoles/nigfetd/base height/.initial=.5} +\ctikzset{tripoles/nigfetd/height/.initial=1.1} +\ctikzset{tripoles/nigfetd/base width/.initial=.5} +\ctikzset{tripoles/nigfetd/gate width/.initial=.62} +\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3} +\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3} +\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/nigfetebulk/width/.initial=.7} +\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35} +\ctikzset{tripoles/nigfetebulk/base height/.initial=.5} +\ctikzset{tripoles/nigfetebulk/height/.initial=1.1} +\ctikzset{tripoles/nigfetebulk/base width/.initial=.5} +\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62} +\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3} +\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3} +\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/pigfete/width/.initial=.7} +\ctikzset{tripoles/pigfete/gate height/.initial=.35} +\ctikzset{tripoles/pigfete/base height/.initial=.5} +\ctikzset{tripoles/pigfete/height/.initial=1.1} +\ctikzset{tripoles/pigfete/base width/.initial=.5} +\ctikzset{tripoles/pigfete/gate width/.initial=.62} +\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/pigfetd/width/.initial=.7} +\ctikzset{tripoles/pigfetd/gate height/.initial=.35} +\ctikzset{tripoles/pigfetd/base height/.initial=.5} +\ctikzset{tripoles/pigfetd/height/.initial=1.1} +\ctikzset{tripoles/pigfetd/base width/.initial=.5} +\ctikzset{tripoles/pigfetd/gate width/.initial=.62} +\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6} + + +\ctikzset{tripoles/pigfetebulk/width/.initial=.7} +\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35} +\ctikzset{tripoles/pigfetebulk/base height/.initial=.5} +\ctikzset{tripoles/pigfetebulk/height/.initial=1.1} +\ctikzset{tripoles/pigfetebulk/base width/.initial=.5} +\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62} +\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6} + +\ctikzset{tripoles/npn/width/.initial=.6} +\ctikzset{tripoles/npn/base height/.initial=.45} +\ctikzset{tripoles/npn/base height 2/.initial=.15} +\ctikzset{tripoles/npn/base height/.initial=.4} +\ctikzset{tripoles/npn/height/.initial=1.1} +\ctikzset{tripoles/npn/base width/.initial=.5} + +\ctikzset{tripoles/pnp/width/.initial=.6} +\ctikzset{tripoles/pnp/base height/.initial=.45} +\ctikzset{tripoles/pnp/base height 2/.initial=.15} +\ctikzset{tripoles/pnp/base height/.initial=.4} +\ctikzset{tripoles/pnp/height/.initial=1.1} +\ctikzset{tripoles/pnp/base width/.initial=.5} + +\ctikzset{tripoles/pigbt/width/.initial=.6} +\ctikzset{tripoles/pigbt/gate height/.initial=.45} +\ctikzset{tripoles/pigbt/gate height 2/.initial=.15} +\ctikzset{tripoles/pigbt/base height/.initial=.4} +\ctikzset{tripoles/pigbt/height/.initial=1.1} +\ctikzset{tripoles/pigbt/gate width/.initial=.62} +\ctikzset{tripoles/pigbt/base width/.initial=.5} +\ctikzset{tripoles/nigbt/width/.initial=.6} +\ctikzset{tripoles/nigbt/gate height/.initial=.45} +\ctikzset{tripoles/nigbt/gate height 2/.initial=.15} +\ctikzset{tripoles/nigbt/base height/.initial=.4} +\ctikzset{tripoles/nigbt/height/.initial=1.1} +\ctikzset{tripoles/nigbt/gate width/.initial=.62} +\ctikzset{tripoles/nigbt/base width/.initial=.5} + +\ctikzset{tripoles/njfet/width/.initial=.7} +\ctikzset{tripoles/njfet/gate height/.initial=.5} +\ctikzset{tripoles/njfet/gate height 2/.initial=.35} +\ctikzset{tripoles/njfet/gate width/.initial=.5} +\ctikzset{tripoles/njfet/height/.initial=1.1} +\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3} +\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3} +\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6} + +\ctikzset{tripoles/pjfet/width/.initial=.7} +\ctikzset{tripoles/pjfet/gate height/.initial=.5} +\ctikzset{tripoles/pjfet/gate height 2/.initial=.35} +\ctikzset{tripoles/pjfet/gate width/.initial=.5} +\ctikzset{tripoles/pjfet/height/.initial=1.1} +\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6} + +\ctikzset{tripoles/isfet/width/.initial=1} +\ctikzset{tripoles/isfet/gate height/.initial=.35} +\ctikzset{tripoles/isfet/base height/.initial=.5} +\ctikzset{tripoles/isfet/height/.initial=1.1} +\ctikzset{tripoles/isfet/base width/.initial=.3} +\ctikzset{tripoles/isfet/gate width/.initial=.5} +\ctikzset{tripoles/isfet/wave width/.initial=.16} +\ctikzset{tripoles/isfet/wave amp/.initial=.06} +\ctikzset{tripoles/isfet/waves y sep/.initial=.22} +\ctikzset{tripoles/isfet/waves x sep/.initial=.8} +\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3} +\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3} +\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6} + +\newif\ifpgf@circuit@europeanlogicport +\ctikzset{logic ports/.is choice} +\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } } +\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } } + +\newif\ifpgf@circuit@bipole@voltage@backward +\ctikzset{bipole/voltage/direction/.is choice} +\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} +\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} + +\ctikzset{tripoles/american and port/width/.initial=1.1} +\ctikzset{tripoles/american and port/height/.initial=.8} +\ctikzset{tripoles/american and port/port width/.initial=.7} +\ctikzset{tripoles/american and port/input height/.initial=.5} +\ctikzset{tripoles/american nand port/width/.initial=1.1} +\ctikzset{tripoles/american nand port/height/.initial=.8} +\ctikzset{tripoles/american nand port/port width/.initial=.7} +\ctikzset{tripoles/american nand port/circle width/.initial=.15} +\ctikzset{tripoles/american nand port/input height/.initial=.5} +\ctikzset{tripoles/american or port/width/.initial=1.1} +\ctikzset{tripoles/american or port/height/.initial=.8} +\ctikzset{tripoles/american or port/port width/.initial=.7} +\ctikzset{tripoles/american or port/input height/.initial=.5} +\ctikzset{tripoles/american or port/input skip/.initial=.25} +\ctikzset{tripoles/american or port/aaa/.initial=.6} +\ctikzset{tripoles/american or port/bbb/.initial=.4} +\ctikzset{tripoles/american or port/ccc/.initial=.5} +\ctikzset{tripoles/american or port/ddd/.initial=.0} +\ctikzset{tripoles/american nor port/width/.initial=1.1} +\ctikzset{tripoles/american nor port/height/.initial=.8} +\ctikzset{tripoles/american nor port/port width/.initial=.7} +\ctikzset{tripoles/american nor port/input height/.initial=.5} +\ctikzset{tripoles/american nor port/input skip/.initial=.25} +\ctikzset{tripoles/american nor port/circle width/.initial=.15} +\ctikzset{tripoles/american nor port/aaa/.initial=.6} +\ctikzset{tripoles/american nor port/bbb/.initial=.4} +\ctikzset{tripoles/american nor port/ccc/.initial=.5} +\ctikzset{tripoles/american nor port/ddd/.initial=.0} +\ctikzset{tripoles/american xor port/width/.initial=1.1} +\ctikzset{tripoles/american xor port/height/.initial=.8} +\ctikzset{tripoles/american xor port/port width/.initial=.7} +\ctikzset{tripoles/american xor port/input height/.initial=.5} +\ctikzset{tripoles/american xor port/input skip/.initial=.15} +\ctikzset{tripoles/american xor port/distance/.initial=.1} +\ctikzset{tripoles/american xor port/aaa/.initial=.6} +\ctikzset{tripoles/american xor port/bbb/.initial=.4} +\ctikzset{tripoles/american xor port/ccc/.initial=.5} +\ctikzset{tripoles/american xor port/ddd/.initial=.0} +\ctikzset{tripoles/american xnor port/width/.initial=1.1} +\ctikzset{tripoles/american xnor port/height/.initial=.8} +\ctikzset{tripoles/american xnor port/port width/.initial=.7} +\ctikzset{tripoles/american xnor port/input height/.initial=.5} +\ctikzset{tripoles/american xnor port/input skip/.initial=.15} +\ctikzset{tripoles/american xnor port/distance/.initial=.1} +\ctikzset{tripoles/american xnor port/aaa/.initial=.6} +\ctikzset{tripoles/american xnor port/bbb/.initial=.4} +\ctikzset{tripoles/american xnor port/ccc/.initial=.5} +\ctikzset{tripoles/american xnor port/ddd/.initial=.0} +\ctikzset{tripoles/american xnor port/circle width/.initial=.15} +\ctikzset{tripoles/european and port/width/.initial=1.4} +\ctikzset{tripoles/european and port/height/.initial=.65} +\ctikzset{tripoles/european and port/reserved/.initial=.6} +\ctikzset{tripoles/european and port/input height/.initial=.6} +\ctikzset{tripoles/european or port/width/.initial=1.4} +\ctikzset{tripoles/european or port/height/.initial=.65} +\ctikzset{tripoles/european or port/reserved/.initial=.6} +\ctikzset{tripoles/european or port/input height/.initial=.6} +\ctikzset{tripoles/european xor port/width/.initial=1.4} +\ctikzset{tripoles/european xor port/height/.initial=.65} +\ctikzset{tripoles/european xor port/reserved/.initial=.6} +\ctikzset{tripoles/european xor port/input height/.initial=.6} +\ctikzset{tripoles/european nand port/width/.initial=1.4} +\ctikzset{tripoles/european nand port/not height/.initial=.3} +\ctikzset{tripoles/european nand port/not width/.initial=.8} +\ctikzset{tripoles/european nand port/height/.initial=.65} +\ctikzset{tripoles/european nand port/reserved/.initial=.6} +\ctikzset{tripoles/european nand port/input height/.initial=.6} +\ctikzset{tripoles/european not port/width/.initial=1.4} +\ctikzset{tripoles/european not port/not height/.initial=.3} +\ctikzset{tripoles/european not port/not width/.initial=.8} +\ctikzset{tripoles/european not port/height/.initial=.65} +\ctikzset{tripoles/european not port/reserved/.initial=.6} +\ctikzset{tripoles/european not port/input height/.initial=0} +\ctikzset{tripoles/european xnor port/width/.initial=1.4} +\ctikzset{tripoles/european xnor port/not height/.initial=.3} +\ctikzset{tripoles/european xnor port/not width/.initial=.8} +\ctikzset{tripoles/european xnor port/height/.initial=.65} +\ctikzset{tripoles/european xnor port/reserved/.initial=.6} +\ctikzset{tripoles/european xnor port/input height/.initial=.6} +\ctikzset{tripoles/european nor port/width/.initial=1.4} +\ctikzset{tripoles/european nor port/not height/.initial=.3} +\ctikzset{tripoles/european nor port/not width/.initial=.8} +\ctikzset{tripoles/european nor port/height/.initial=.65} +\ctikzset{tripoles/european nor port/reserved/.initial=.6} +\ctikzset{tripoles/european nor port/input height/.initial=.6} +\ctikzset{tripoles/op amp/width/.initial=1.7} +\ctikzset{tripoles/op amp/port width/.initial=.7} +\ctikzset{tripoles/op amp/height/.initial=1.4} +\ctikzset{tripoles/op amp/input height/.initial=.5} +\ctikzset{tripoles/op amp/up pos/.initial=.45} +\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed! +\ctikzset{tripoles/gm amp/width/.initial=1.7} +\ctikzset{tripoles/gm amp/port width/.initial=.7} +\ctikzset{tripoles/gm amp/height/.initial=1.4} +\ctikzset{tripoles/gm amp/input height/.initial=.5} +\ctikzset{tripoles/gm amp/up pos/.initial=.45} +\ctikzset{tripoles/plain amp/width/.initial=1.7} +\ctikzset{tripoles/plain amp/port width/.initial=.7} +\ctikzset{tripoles/plain amp/height/.initial=1.4} +\ctikzset{tripoles/plain amp/input height/.initial=.5} +\ctikzset{tripoles/plain amp/up pos/.initial=.45} + +\ctikzset{tripoles/thyristor/height/.initial=1.10} +\ctikzset{tripoles/thyristor/height 2/.initial=.5} +\ctikzset{tripoles/thyristor/width/.initial=1.0} +\ctikzset{tripoles/thyristor/diode height/.initial=.5} +\ctikzset{tripoles/thyristor/diode width left/.initial=.4} +\ctikzset{tripoles/thyristor/diode width right/.initial=.3} + +\ctikzset{tripoles/triac/height/.initial=1.1} +\ctikzset{tripoles/triac/width/.initial=1} +\ctikzset{tripoles/triac/diode width left/.initial=.3} +\ctikzset{tripoles/triac/diode width right/.initial=.3} + +\ctikzset{tripoles/spdt/width/.initial=.85} +\ctikzset{tripoles/spdt/height/.initial=.45} +\ctikzset{tripoles/spdt/margin/.initial=.45} + +\ctikzset{tripoles/toggleswitch/height/.initial=.8} +\ctikzset{tripoles/toggleswitch/height 2/.initial=.0} +\ctikzset{tripoles/toggleswitch/width/.initial=.80} + +\ctikzset{tripoles/mixer/width/.initial=0.7} +\ctikzset{tripoles/adder/width/.initial=0.7} +\ctikzset{tripoles/circulator/width/.initial=.7} +\ctikzset{tripoles/oscillator/width/.initial=.7} + + +\ctikzset{tripoles/wilkinson/height/.initial=1.3} +\ctikzset{tripoles/wilkinson/width/.initial=1.3} + +\ctikzset{quadpoles/transformer/width/.initial=1.5} +\ctikzset{quadpoles/transformer/width1/.initial=.4} +\ctikzset{quadpoles/transformer/height/.initial=1.5} +\ctikzset{quadpoles/transformer/height1/.initial=.8} +\ctikzset{quadpoles/transformer core/width/.initial=1.5} +\ctikzset{quadpoles/transformer core/height/.initial=1.5} +\ctikzset{quadpoles/transformer core/core height/.initial=.5} +\ctikzset{quadpoles/transformer core/core width/.initial=.05} +\ctikzset{quadpoles/gyrator/width/.initial=1.5} +\ctikzset{quadpoles/gyrator/height/.initial=1.5} +\ctikzset{quadpoles/fourport/width/.initial=1.3} +\ctikzset{quadpoles/fourport/height/.initial=1.3} +\ctikzset{quadpoles/coupler/width/.initial=1.3} +\ctikzset{quadpoles/coupler/height/.initial=1.3} +\ctikzset{quadpoles/coupler2/width/.initial=1.3} +\ctikzset{quadpoles/coupler2/height/.initial=1.3} + + +\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8} +\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6} + + +\ctikzset{bipole/.is family} +\ctikzset{bipole/kind/.initial = } +\ctikzset{bipole/name/.initial = } +\newif\ifpgf@circuit@bipole@reversed +\ctikzset{bipole/reversed/.is if=pgf@circuit@bipole@reversed} +\newif\ifpgf@circuit@bipole@isvoltage +\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage} +\newif\ifpgf@circuit@bipole@iscurrent +\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent} + +\ctikzset{bipole/voltage/.is family} +\newif\ifpgf@circuit@bipole@voltage@backward +\ctikzset{bipole/voltage/direction/.is choice} +\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} +\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} +\newif\ifpgf@circuit@bipole@voltage@below +\ctikzset{bipole/voltage/position/.is choice} +\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}} +\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}} + +\ctikzset{bipole/voltage/label/unit/.initial=} +\ctikzset{bipole/voltage/label/name/.initial=} + +\ctikzset{bipole/current/.is family} +\newif\ifpgf@circuit@bipole@current@backward +\ctikzset{bipole/current/direction/.is choice} +\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}} +\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}} +\newif\ifpgf@circuit@bipole@current@before +\ctikzset{bipole/current/x position/.is choice} +\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}} +\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}} +\newif\ifpgf@circuit@bipole@current@below +\ctikzset{bipole/current/y position/.is choice} +\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}} +\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}} + +\ctikzset{bipole/current/label/unit/.initial=} +\ctikzset{bipole/current/label/name/.initial=} + +\ctikzset{bipole/label/.is family} +\ctikzset{bipole/label/position/.initial=90} +\ctikzset{bipole/label/unit/.initial=} +\ctikzset{bipole/label/name/.initial=} +\ctikzset{bipole/nodes/.is family} +\ctikzset{bipole/nodes/left/.is choice} +\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}} +\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}} +\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}} +\ctikzset{bipole/nodes/right/.is choice} +\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}} +\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}} +\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}} + + + + +\newif\ifpgf@circuit@europeanresistor +\ctikzset{resistor/.is choice} +\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse } +\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue } + +\ctikzset{inductor/.is choice} +\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}} +\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}} +\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}} + +\newif\ifpgf@circuit@fulldiode +\ctikzset{diode/.is if=pgf@circuit@fulldiode} +\ctikzset{diode/.is choice} +\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse } +\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue } +\ctikzset{thickness/.initial=2} +\ctikzset{color/.initial=black} +\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}} + + +\newif\ifpgf@circ@siunitx +\newif\ifpgf@circ@siunitx@res + +\ctikzset{voltage/.is family} +\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units +\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1 +\ctikzset{voltage/bump a/.initial=1.2} +\ctikzset{voltage/bump b/.initial=1.5} +\ctikzset{voltage/european label distance/.initial=1.4} +\ctikzset{voltage/american label distance/.initial=1.1} +% special cases +\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/generic/voltage/bump b/.initial=2} +\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8} +%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3} +\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2} +\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5} +\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2} +\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8} +\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2} +\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8} +\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/memristor/voltage/bump b/.initial=2} +\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8} +%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4} +\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1} +%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4} +\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2} +%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2} +\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8} +%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4} +\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2} +%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6} +%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6} + +\ctikzset{current/.is family} +\ctikzset{current/distance/.initial = .5} + +\tikzset{american currents/.style = { \circuitikzbasekey/current = american } } +\tikzset{european currents/.style = { \circuitikzbasekey/current = european } } +\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } } +\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } } +\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } } +\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } } + +\newif\ifpgf@circuit@europeangfsurgearrester +\ctikzset{gas filled surge arrester/.is choice} +\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } } +\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } } + +\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } } +\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = european } } +\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } } +\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } } +\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } } +\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full } } +\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty } } +\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } } +\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } } +\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester } } +\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } } +\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } } + +% I should try to make the tree clearer (this voltaege conflicts with the options above) + +\newif\ifpgf@circuit@europeanvoltage +\ctikzset{voltage/.is choice} +\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } } +\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } } + +\newif\ifpgf@circuit@europeancurrent +\ctikzset{current/.is choice} +\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse } +\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue } + +\ctikzset{label/align/.is choice} +\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}} +\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}} +\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}} + +%%%%%%%%%% new +\pgfkeys{\circuitikzbasekey/.search also={/tikz}} + + +\input pgfcircutils.tex +\input pgfcircmath.tex + +\input pgfcircshapes.tex +\input pgfcircmonopoles.tex +\input pgfcircbipoles.tex +\input pgfcirctripoles.tex +\input pgfcircquadpoles.tex + +\input pgfcirclabel.tex +\input pgfcircvoltage.tex +\input pgfcirccurrent.tex + diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbasic.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbasic.tex new file mode 100644 index 00000000000..f6ff09e521d --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbasic.tex @@ -0,0 +1,570 @@ +%%%%%%%%%%%% +%% Dimensions + +% coordinate bipoli +\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero +\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right +\newdimen\pgf@circ@res@other +\newdimen\pgf@circ@res@step +\newdimen\pgf@circ@res@temp + +% thickness iniziale +\newdimen \pgfstartlinewidth + +\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + + + +% Names +\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@ +\ctikzset{n/.code = { + \pgfkeys{/tikz/circuitikz/bipole/name=#1} +}} + +% Reflect the node along +\ctikzset{mirrored/.is choice} +\ctikzset{mirror value/.initial=1} +\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} } +\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} } +\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}} + +% Initialize paths +\def\pgfcircresetpath{ + \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, + bipole/reversed=false, bipole/kind=, + bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below, + bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false, + bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after, + bipole/current/y position=above, bipole/current/direction=forward, + mirrored=false + } +} + + +%% Generic bipole path +\def\pgf@circ@bipole@path#1#2{ + \pgfextra{ + \ctikzset{bipole/kind = #1} + + \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \def\pgf@circ@temp{} + \ifx\pgf@temp\pgf@circ@temp % if it has not a name + \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} + \ctikzset{bipole/name = #2\pgf@circ@rand} % create it + \fi + + \def\pgf@temp{open} + \def\pgf@circ@temp{#1} + } + \ifpgf@circuit@bipole@reversed + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} + \else + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} + \fi + \pgfextra{ + \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} + {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} + \edef\pgf@circ@direction{\pgfmathresult} + } + ($(\tikztostart) ! .5 ! (\tikztotarget)$) + node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}] + (\ctikzvalof{bipole/name}) {} + \ifx\pgf@temp\pgf@circ@temp % if it is an open + \else + \ifdefined\pgf@anchor@#1@pathstart% if special path-anchors are defined, use them! + (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart) + (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center) + \else + (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left) + (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) + \fi + \fi + \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi + \drawpoles + \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi + \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi + % reset + \pgfextra{ + \pgfcircresetpath + } + (\tikztotarget) \tikztonodes % e si continua +} + + +%% Path definitions + +\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} +\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi} +\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi} +\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}} +\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}} +\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}} +\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}} +\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} +\def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}} +\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}} +\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} +\def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}} +\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} +\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}} +\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} +\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}} +\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}} +\def\pgf@circ@inductor@path#1{% + \pgfextra{ + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + } + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@europeaninductor@path{#1}% + \else% + \pgfextra{ \def\pgf@temp{cute} }% + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@cuteinductor@path{#1}% + \else% + \pgf@circ@americaninductor@path{#1}% + \fi% + \fi% +} +\def\pgf@circ@vinductor@path#1{ + \pgfextra{ + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + } + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@veuropeaninductor@path{#1}% + \else% + \pgfextra{ \def\pgf@temp{cute} }% + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@vcuteinductor@path{#1}% + \else% + \pgf@circ@vamericaninductor@path{#1}% + \fi% + \fi% +} +\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} +\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}} +\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}} +\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}} +\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}} +\def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}} +\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} +\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}} +\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}} +\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}} +\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}} +\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}} +\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}} +\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} +\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}} +\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}} +\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}} +\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}} +\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}} +\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}} +\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}} +\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}} +\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}} +\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}} +\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}} +\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}} +\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}} +\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}} +\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}} +\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}} +\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}} +\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}} +\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}} +\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}} +\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}} +\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}} +\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}} +\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}} +\def\pgf@circ@spst@path#1{\pgf@circ@bipole@path{spst}{#1}} +\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} +\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}} +\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}} +\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}} +\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}} +\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}} +\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} +\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} +\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}} +\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}} +\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} +\def\pgf@circ@empty@path#1{} +\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}} +\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} +\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}} +\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} +\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} +\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} +\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} +\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} +\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}} +\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}} +\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}} + +\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi} +\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}} +\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}} + +\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}} +\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}} +\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}} +\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}} +\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}} +\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}} +\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}} +\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}} +\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}} +\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}} +\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}} +\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}} +\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}} +\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}} +\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}} +\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}} +\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}} +\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}} + +%% Styles + +%% Aggiungere per thyristor e tripoli semplici + +\def\comnpatname{\ifpgf@circuit@compat *\else\fi} +\def\compattikzset#1{\tikzset{\comnpatname#1}} + +%\def\ctikzsetbipole#1#2{% +% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}% +%} + +\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}} +\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}} +\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}} +\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}} +\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}} +\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}} +\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}} +\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}} +\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}} +\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}} +\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}} +\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}} +\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}} +\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}} +\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} +\compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}} +\compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}} +\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} +\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} +\compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}} +\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} +\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} +\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}} +\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}} +\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} +\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}} +\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}} +\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}} +\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}} +\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}} +\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}} +\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}} +\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} +\compattikzset{transmission line/.style = {tline = #1}} +\compattikzset{TL/.style = {tline = #1}} +\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} + +\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} + + +\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}} +\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}} +\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}} +\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}} +\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}} +\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}} +\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}} + +\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}} + +\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} +\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} +\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}} +\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}} +\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}} + +\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}} +\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}} +\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}} +\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}} +\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}} +\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}} +\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}} +\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}} +\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}} +\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}} +\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}} +\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}} +\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}} +\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}} +\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}} +\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}} +\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}} +\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}} + +\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}} +\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}} +\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}} +\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}} +\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}} +\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}} +\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}} + +\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}} +\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}} +\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}} +\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}} +\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}} +\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}} +\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}} + + \compattikzset{Schottky diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} + \compattikzset{Zener diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} + \compattikzset{tunnel diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} + \compattikzset{photodiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi photodiode}} + \compattikzset{led/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi led}} + \compattikzset{varcap/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi varcap}} + \compattikzset{diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi diode}} %%%%%%%%%%%%@@@ + + + + +\compattikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}} +\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}} +\compattikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}} + +\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}} +\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}} +\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spst@path, l=#1}} +\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}} +\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}} + +\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}} +\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}} +\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}} + +% short forms +\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} + + +\compattikzset{vsource/.style = {\comnpatname voltage source = #1}} +\compattikzset{isource/.style = {\comnpatname current source = #1}} +\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}} +\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}} +\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}} +\compattikzset{vsourcetri/.style = {triangle voltage source = #1}} +\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}} +\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} +\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} + +\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}} +\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} +\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} + +\compattikzset{R/.style= {\comnpatname resistor = #1}} +%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi +\compattikzset{vR/.style= {\comnpatname variable resistor = #1}} +\compattikzset{phR/.style= {\comnpatname photoresistor = #1}} +\compattikzset{thR/.style= {\comnpatname thermistor = #1}} +\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}} +\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}} +\compattikzset{pR/.style= {\comnpatname potentiometer = #1}} +\compattikzset{C/.style = {\comnpatname capacitor = #1}} +\compattikzset{eC/.style = {\comnpatname ecapacitor = #1}} +\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}} +\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}} +\compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}} +\compattikzset{L/.style = {\comnpatname inductor = #1}} +\compattikzset{vL/.style = {\comnpatname variable inductor = #1}} +\compattikzset{V/.style = {\comnpatname voltage source = #1}} +\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}} +\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}} +\compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}} +\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}} +\def\pgf@temp#1{ + \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} } + \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} } + \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} } + \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\compattikzset{I/.style = {\comnpatname current source = #1}} +\compattikzset{cI/.style = {\comnpatname controlled current source = #1}} +\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}} +\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}} +\def\pgf@temp#1{ + \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} } + \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} } + \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} } + \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\compattikzset{Do/.style = {\comnpatname empty diode}} +\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}} +\compattikzset{zDo/.style = {\comnpatname empty Zener diode}} +\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}} +\compattikzset{pDo/.style = {\comnpatname empty photodiode}} +\compattikzset{leDo/.style = {\comnpatname empty led}} +\compattikzset{VCo/.style = {\comnpatname empty varcap}} +\compattikzset{D*/.style = {\comnpatname full diode}} +\compattikzset{tD*/.style = {\comnpatname full tunnel diode}} +\compattikzset{zD*/.style = {\comnpatname full Zener diode}} +\compattikzset{sD*/.style = {\comnpatname full Schottky diode}} +\compattikzset{pD*/.style = {\comnpatname full photodiode}} +\compattikzset{leD*/.style = {\comnpatname full led}} +\compattikzset{VC*/.style = {\comnpatname full varcap}} +\compattikzset{D/.style = {\comnpatname diode}} +\compattikzset{tD/.style = {\comnpatname tunnel diode}} +\compattikzset{zD/.style = {\comnpatname Zener diode}} +\compattikzset{sD/.style = {\comnpatname Schottky diode}} +\compattikzset{pD/.style = {\comnpatname photodiode}} +\compattikzset{leD/.style = {\comnpatname led}} +\compattikzset{VC/.style = {\comnpatname varcap}} + +\compattikzset{Tr/.style = {\comnpatname triac}} +\compattikzset{Mr/.style = {\comnpatname memristor}} +\compattikzset{Ty/.style = {\comnpatname thyristor}} + +\compattikzset{cspst/.style = {\comnpatname closing switch = #1}} +\compattikzset{ospst/.style = {\comnpatname opening switch = #1}} +\compattikzset{spst/.style = {\comnpatname switch = #1}} + +\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}} + +\compattikzset{vdd/.style = {\comnpatname vcc = #1}} +\compattikzset{vss/.style = {\comnpatname vee = #1}} + +\def\inheritlogicport#1#2{ + \pgfdeclareshape{#2 port}{ + \inheritsavedanchors[from=#1 #2 port] + \inheritbackgroundpath[from=#1 #2 port] + \inheritanchor[from=#1 #2 port]{in} + \inheritanchor[from=#1 #2 port]{in 1} + \inheritanchor[from=#1 #2 port]{in 2} + \inheritanchor[from=#1 #2 port]{out} + \inheritanchor[from=#1 #2 port]{center} + \inheritanchor[from=#1 #2 port]{left} + } +} + +\ifpgf@circuit@europeanlogicport + \inheritlogicport{european}{and} + \inheritlogicport{european}{or} + \inheritlogicport{european}{xor} + \inheritlogicport{european}{not} + \inheritlogicport{european}{nand} + \inheritlogicport{european}{nor} + \inheritlogicport{european}{xnor} +\else + \inheritlogicport{american}{and} + \inheritlogicport{american}{or} + \inheritlogicport{american}{xor} + \inheritlogicport{american}{not} + \inheritlogicport{american}{nand} + \inheritlogicport{american}{nor} + \inheritlogicport{american}{xnor} +\fi + +% Transistor like bipoles + +\def\pgf@circ@trans@path#1#2{ + \pgfextra{ + \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \def\pgf@circ@temp{#2} + \ifx\pgf@temp\pgf@circ@temp % if it has not a name + \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} + \ctikzset{bipole/name = trans\pgf@circ@rand} % create it + \fi + } + \ifpgf@circuit@bipole@reversed + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} + \else + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} + \fi + \pgfextra{ + \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} + {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} + \pgfmathadd{\pgfmathresult}{-90} + \edef\pgf@circ@direction{\pgfmathresult} + } + ($(\tikztostart) ! .5 ! (\tikztotarget)$) + node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}] + (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}} + \@ifundefined{pgf@anchor@#1@pathstart}{%if special path-anchors are defined, use them! + (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left) + (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) + }{ + (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart) + (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center) + } + \pgfextra{ + \pgfcircresetpath + } + (\tikztotarget) \tikztonodes % e si continua +} + + +\def\pgf@circ@definetranspath#1{ + \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}} +} + +\pgf@circ@definetranspath{elmech} +\pgf@circ@definetranspath{nmos} +\pgf@circ@definetranspath{pmos} +\pgf@circ@definetranspath{npn} +\pgf@circ@definetranspath{pnp} +\pgf@circ@definetranspath{nfet} +\pgf@circ@definetranspath{nigfete} +\pgf@circ@definetranspath{nigfetd} +\pgf@circ@definetranspath{nigfetebulk} +\pgf@circ@definetranspath{pfet} +\pgf@circ@definetranspath{pigfete} +\pgf@circ@definetranspath{pigfetd} +\pgf@circ@definetranspath{pigfetebulk} +\pgf@circ@definetranspath{njfet} +\pgf@circ@definetranspath{pjfet} +\pgf@circ@definetranspath{pigbt} +\pgf@circ@definetranspath{nigbt} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index 8a1e62e29fc..8a7bd806ea1 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -153,7 +153,7 @@ #1 \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} \northeast \pgf@circ@res@up = \pgf@y @@ -277,6 +277,35 @@ } +%% Electrolytic Capacitor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ecapacitor/height}}{ecapacitor}{\ctikzvalof{bipoles/ecapacitor/height}}{\ctikzvalof{bipoles/ecapacitor/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/ecapacitor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 5 + \pgfsetrectcap + % % % Draw plus pole + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfsetfillcolor{white} + \pgfusepath{draw,fill} + % % Draw minus pole + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfsetfillcolor{black} + \pgfusepath{draw,fill} + \pgfsetfillcolor{black} + % % plus pole annotation + \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}] + {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$} +} + %% Battery \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{ @@ -394,10 +423,18 @@ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - - \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$} - \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$} - + \ifpgf@circ@oldvoltagedirection + \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$} + \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$} + \else + \ifpgf@circuit@bipole@voltage@backward + \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$} + \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$} + \else + \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$} + \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$} + \fi + \fi \pgfusepath{draw} } @@ -481,6 +518,51 @@ } +%% Empty Source +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{ + \pgfpointorigin + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% PV Source +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pvsource/height}}{pvsource}{\ctikzvalof{bipoles/pvsource/height}}{\ctikzvalof{bipoles/pvsource/width}}{ + \pgfpointorigin + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfusepath{draw} + + %Adapted from battery1 + \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}} + \pgfusepath{draw} + + %Arrow Part + \pgfscope + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}} + \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}} + \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}} + \pgfusepath{draw} + \endpgfscope + +} + %% Empty Source \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{ \pgfpointorigin @@ -503,8 +585,16 @@ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} \pgfusepath{draw} \pgfscope + \ifpgf@circ@oldvoltagedirection \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \else + \ifpgf@circuit@bipole@current@backward + \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgftransformrotate{180} + \else + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \fi\fi + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope } @@ -549,7 +639,15 @@ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} \pgfusepath{draw} \pgfscope - \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \ifpgf@circ@oldvoltagedirection + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \else + \ifpgf@circuit@bipole@current@backward + \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgftransformrotate{180} + \else + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \fi\fi \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope } @@ -1605,6 +1703,33 @@ \pgfusepath{draw} } + +%% Piezoelectric Element + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piezoelectric/height}}{piezoelectric}{\ctikzvalof{bipoles/piezoelectric/height}}{\ctikzvalof{bipoles/piezoelectric/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 5 + + %% Outer markings + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + %% Inner Box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left+4}{\pgf@circ@res@up-1}}{\pgfpoint{\pgf@circ@res@right-4}{\pgf@circ@res@down+1}} + \pgfusepath{draw} + +} + + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Handling of terminals @@ -1929,7 +2054,9 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step - + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -1969,6 +2096,9 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi % draw circle \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step} @@ -2016,6 +2146,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2043,6 +2177,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} @@ -2081,6 +2216,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2108,6 +2247,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} @@ -2146,6 +2286,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2173,6 +2317,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} @@ -2211,6 +2356,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2244,7 +2393,9 @@ \def\textii{D} \fi\fi - % draw inner symbol + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} @@ -2263,6 +2414,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2296,7 +2451,9 @@ \def\textii{A} \fi\fi - % draw inner symbol + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} @@ -2314,6 +2471,10 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -2352,6 +2513,10 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -2384,36 +2549,35 @@ %% Amplifier \pgfcircdeclarebipole{}{ - %\ifpgf@circuit@box + \ifpgf@circuit@boxed \ctikzvalof{bipoles/twoport/width} - %\else - % \ctikzvalof{bipoles/amp/width} - %\fi + \else + \ctikzvalof{bipoles/amp/width} + \fi }{amp}{ - %\ifpgf@circuit@box + \ifpgf@circuit@boxed \ctikzvalof{bipoles/twoport/width} - %\else - % \ctikzvalof{bipoles/amp/width} - % \fi + \else + \ctikzvalof{bipoles/amp/width} + \fi }{ - % \ifpgf@circuit@box + \ifpgf@circuit@boxed \ctikzvalof{bipoles/twoport/width} - % \else - % \ctikzvalof{bipoles/amp/width} - % \fi + \else + \ctikzvalof{bipoles/amp/width} + \fi }{ \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi % draw outer box - %\ifpgf@circuit@box - % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} - %\fi - % draw outer box - % draw outer box - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfusepath{draw} + \ifpgf@circuit@boxed + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + \fi % draw input arrow \ifpgf@circuit@inputarrow @@ -2423,31 +2587,62 @@ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} } \fi + + \ifpgf@circuit@boxed + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn + \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box + \else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \fi - \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}} + \pgfpathclose \pgfusepath{draw} + + % draw inner text + \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} } %% variable amplifier -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamp/width}}{vamp}{\ctikzvalof{bipoles/vamp/width}}{\ctikzvalof{bipoles/vamp/width}}{ - \pgf@circ@res@step = \ctikzvalof{bipoles/vamp/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by 2 - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgf@circ@res@other = \pgf@circ@res@left - \advance\pgf@circ@res@other by \pgf@circ@res@step +\pgfcircdeclarebipole{}{ + \ifpgf@circuit@boxed + \ctikzvalof{bipoles/twoport/width} + \else + \ctikzvalof{bipoles/amp/width} + \fi + }{vamp}{ + \ifpgf@circuit@boxed + \ctikzvalof{bipoles/twoport/width} + \else + \ctikzvalof{bipoles/amp/width} + \fi + }{ + \ifpgf@circuit@boxed + \ctikzvalof{bipoles/twoport/width} + \else + \ctikzvalof{bipoles/amp/width} + \fi + }{ + \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen - % draw outer box - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfusepath{draw} + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box + \ifpgf@circuit@boxed + \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + \fi + + % draw input arrow \ifpgf@circuit@inputarrow { \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth @@ -2455,18 +2650,35 @@ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} } \fi + + \ifpgf@circuit@boxed + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn + \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box + \else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \fi + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}} + \pgfpathclose \pgfusepath{draw} + % draw inner text + \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} + + % draw arrow + \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsend{latex} - \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.7\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}} \pgfusepath{draw} } @@ -2478,7 +2690,11 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step - + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2503,6 +2719,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}} @@ -2524,6 +2741,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2548,6 +2769,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}} @@ -2573,7 +2795,11 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step - + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2598,6 +2824,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}} @@ -2616,6 +2843,10 @@ \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2640,6 +2871,7 @@ % draw inner symbol \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}} @@ -2662,7 +2894,11 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step - + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2700,7 +2936,11 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step - + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2745,7 +2985,11 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgf@circ@res@other = \pgf@circ@res@left \advance\pgf@circ@res@other by \pgf@circ@res@step - + + \ifpgf@circuit@dashed + \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \fi + % draw outer box \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -2760,6 +3004,8 @@ \fi % draw inner stuff + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{0.8\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}} \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex index e559b5e2c5a..053149bfb19 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -99,10 +99,27 @@ \fi \else \fi +%reverse current direction for voltage sources + \ifpgf@circ@oldvoltagedirection\else + \ifpgf@circuit@bipole@isvoltage + \ifpgf@circuit@bipole@voltage@backward + \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward, + \circuitikzbasekey/bipole/current/x position = after, + \circuitikzbasekey/bipole/current/y position = below } + \else + \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward, + \circuitikzbasekey/bipole/current/x position = before, + \circuitikzbasekey/bipole/current/y position = above } + \fi\fi\fi } } -\ctikzset{i/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } } \ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex deleted file mode 100644 index d710fb62d8a..00000000000 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex +++ /dev/null @@ -1,23 +0,0 @@ -% Copyright 2013 by Stefan Erhardt -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Show input arrows for selected parts - - -\ctikzset{>/.style = { - \circuitikzbasekey/inputarrow = true - } -} - - -\endinput - - - diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex index 6d5d09aeb50..e8feabfc80c 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex @@ -501,65 +501,5 @@ } -% oscillator -\pgfdeclareshape{oscillator}{ - \anchor{center}{ - \pgfpointorigin - } - \anchor{north}{ - \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \pgf@x=-0.5\pgf@x - \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \pgf@y=0.5\pgf@y - } - \anchor{south}{ - \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \pgf@x=-0.5\pgf@x - \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \pgf@y=-0.5\pgf@y - } - \anchor{east}{ - \pgfpointorigin - \pgf@x=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - } - \anchor{west}{ - \pgfpointorigin - } - \anchor{text}{ - \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \pgf@x=-2\pgf@x - \advance \pgf@x by -.5\wd\pgfnodeparttextbox - \pgf@y=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \advance \pgf@y by -1.5\ht\pgfnodeparttextbox - } - \behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen - \pgf@circ@res@step=.5\pgf@circ@res@step - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfstartlinewidth=\pgflinewidth - - % draw circle - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathcircle{\pgfpoint{-\pgf@circ@res@step}{0}} {\pgf@circ@res@step} - \pgfusepath{draw} - - % draw inner sine waves - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetlinewidth{\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{0\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - - \endpgfscope - } -} \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex deleted file mode 100644 index 790d997a040..00000000000 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex +++ /dev/null @@ -1,599 +0,0 @@ -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% N-poles - -\pgfkeys{/tikz/circuitikz,lab/.code={ - - -}} - -\long\def\pgfcircdeclarenpole#1#2#3{ - \pgfdeclareshape{#1} - { - \anchor{center}{ - \northwest - \pgf@x=0pt - } - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=.5\pgf@x - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x - } - \anchor{A2}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{B1}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{A1}{ - \northwest - } - \anchor{B2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{base}{ - \northwest - \pgf@x=0pt - } - #3 - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - - #2 - - } - } -} - - - -\def\pgf@circ@drawtransformerbasicanchor{ - \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height} - \anchor{AA2}{ - \northwest - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=-\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } - \anchor{BB1}{ - \northwest - \pgf@x=-\pgf@x - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } - \anchor{AA1}{ - \northwest - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } - \anchor{BB2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=-\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } -} - -\def\pgf@circ@drawtransformerbasicbody{ - \def\stretto{.4} - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgftransformlineattime{.5}{% - \pgfpoint% - {\stretto\pgf@circ@res@left}% - {\pgf@circ@res@up}% - }{% - \pgfpoint - {\stretto\pgf@circ@res@left}% - {\pgf@circ@res@down}% - } - - \edef\pgf@circ@temp{\ctikzvalof{inductor}}% - \def\pgf@temp{european}% - \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} - \else% - \def\pgf@temp{cute} - \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} - \else% - \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} - \fi% - \fi% - - - \endpgfscope - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgftransformlineattime{.5}{% - \pgfpoint% - {\stretto\pgf@circ@res@right}% - {\pgf@circ@res@down}% - }{% - \pgfpoint - {\stretto\pgf@circ@res@right}% - {\pgf@circ@res@up}% - } - - \edef\pgf@circ@temp{\ctikzvalof{inductor}}% - \def\pgf@temp{european}% - \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} - \else% - \def\pgf@temp{cute} - \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} - \else% - \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} - \fi% - \fi% - - \endpgfscope - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} - - \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} - - \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfusepath{draw} - -} - - - - % contrib Kristofer M. Monisit - - \pgfdeclareshape{fd op amp} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - } - \savedanchor\left{% - \pgf@y=0pt - } - \savedanchor\inOne{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{-}{ - \inOne - } - \anchor{+}{ - \inOne - \pgf@y=-\pgf@y - } - \savedanchor\up{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgfpointlineattime{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ - \pgfpoint{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgf@circ@res@up}} - {\pgfpoint{.7\pgf@circ@res@right}{0pt}} - } - \anchor{up}{ - \up - } - \anchor{down}{ - \up - \pgf@y=-\pgf@y - } - \anchor{out +}{ - \northwest - \pgf@y=.5\pgf@y - \pgf@x=-.7\pgf@x - } - \anchor{out -}{ - \northwest - \pgf@y=-.5\pgf@y - \pgf@x=-.7\pgf@x - } - \anchor{west}{ - \left - } - \anchor{east}{ - \left - \pgf@x=-\pgf@x - } - - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - % Negative input terminal - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} - - - % Positive input terminal - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} - - - % Negative output terminal - \pgfpathmoveto{\pgfpoint - {0.7\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$} - - - % Positive output terminal - \pgfpathmoveto{\pgfpoint - {0.7\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$} - - - % Draw them all! - \pgfusepath{draw} - - % Triangle - \pgfscope - \pgfsetlinewidth{2\pgflinewidth} - \pgftransformxshift{.7\pgf@circ@res@left} - \pgf@circ@res@step=\pgf@circ@res@right - \advance\pgf@circ@res@step by -\pgf@circ@res@left - \pgf@circ@res@step=.7\pgf@circ@res@step - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfusepath{draw} - \endpgfscope - } - } - - - - -\pgfcircdeclarequadpole{transformer}{ - - \pgf@circ@drawtransformerbasicbody - -}{\pgf@circ@drawtransformerbasicanchor} - -\pgfcircdeclarequadpole{transformer core}{ - - \pgf@circ@drawtransformerbasicbody - - \pgfmoveto{\pgfpoint% - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% - {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% - } - \pgflineto{ - \pgfpoint - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% - {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% - } - - \pgfmoveto{\pgfpoint% - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% - {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% - } - \pgflineto{ - \pgfpoint - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% - {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% - } - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth} - \pgfusepath{draw} -}{\pgf@circ@drawtransformerbasicanchor} - - -\pgfcircdeclarequadpole{gyrator}{ - - \def\stretto{.4} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfusepath{draw} - - \pgfsetlinewidth{2\pgflinewidth} - \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}} - \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down} - - \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}} - \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} - \pgfusepath{draw} - -}{} - -%% coupler -% defines a general outer box for couplers -% TikZ usage: -% \draw (0,0) node[coupler](coup){\SI{-3}{dB}} -% (coup.port1) to[short,-o] ++(-1,0) -% - -\long\def\pgfcircdeclarecoupler#1#2{ - \pgfdeclareshape{#1}{ - \anchor{center}{ - \northwest - \pgf@x=0pt - \pgf@y=0pt - } - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=.5\pgf@x - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{port1}{ - \northwest - \pgf@y=-0.5\pgf@y - } - \anchor{port2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-0.5\pgf@y - } - \anchor{port3}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=0.5\pgf@y - } - \anchor{port4}{ - \northwest - \pgf@y=0.5\pgf@y - } - \anchor{1}{ - \northwest - \pgf@y=-0.5\pgf@y - } - \anchor{2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-0.5\pgf@y - } - \anchor{3}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=0.5\pgf@y - } - \anchor{4}{ - \northwest - \pgf@y=0.5\pgf@y - } - \anchor{text}{ - \northwest - \advance \pgf@y by 0.5\ht\pgfnodeparttextbox - \pgf@x=-.5\wd\pgfnodeparttextbox - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - \pgfstartlinewidth=\pgflinewidth - - % draw outer box - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfusepath{draw} - - % draw inner stuff - #2 - - } - } -} - -% straight coupler -\pgfcircdeclarecoupler{coupler}{ - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}} - \pgfsetarrows{latex-latex} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}} - \pgfsetarrows{latex-latex} - \pgfusepath{draw} -} - -% "bended" coupler -\pgfcircdeclarecoupler{coupler2}{ - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} - \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} - \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} - \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} - \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - - -} - diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index bbe5ce53176..b0566e7840c 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -308,7 +308,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$} % Positive input terminal @@ -318,7 +318,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$} % Negative output terminal @@ -328,7 +328,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$} % Positive output terminal @@ -338,7 +338,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$} % Draw them all! @@ -424,14 +424,14 @@ }{} -%% coupler -% defines a general outer box for couplers +%% four-port +% defines a general outer box for four-ports % TikZ usage: % \draw (0,0) node[coupler](coup){\SI{-3}{dB}} % (coup.port1) to[short,-o] ++(-1,0) % -\long\def\pgfcircdeclarecoupler#1#2{ +\long\def\pgfcircdeclarefourport#1#2{ \pgfdeclareshape{#1}{ \anchor{center}{ \northwest @@ -440,11 +440,11 @@ } \savedanchor\northwest{% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y \pgf@y=.5\pgf@y \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} \pgf@x=.5\pgf@x - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x } \anchor{north}{ \northwest @@ -516,6 +516,7 @@ \northwest \pgf@y=0.5\pgf@y } + \anchor{text}{ \northwest \advance \pgf@y by 0.5\ht\pgfnodeparttextbox @@ -539,13 +540,19 @@ % draw inner stuff #2 - + + % draw inner text + \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} } } } +% four-port +\pgfcircdeclarefourport{fourport}{} + + % straight coupler -\pgfcircdeclarecoupler{coupler}{ +\pgfcircdeclarefourport{coupler}{ \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} @@ -564,7 +571,7 @@ } % "bended" coupler -\pgfcircdeclarecoupler{coupler2}{ +\pgfcircdeclarefourport{coupler2}{ \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} @@ -592,4 +599,3 @@ } - diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex index 08d90980197..4673d710b31 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -148,4 +148,24 @@ } + +%% box + +\pgfdeclareshape{box}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + + \pgfscope + \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen + \pgf@circ@res@step = 0.5\pgf@circ@res@step + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope + } + +} + \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index 148a1564e49..5c8313efe67 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -11,227 +11,8 @@ %% Tripoles -\pgfdeclareshape{mixer} -{ - \savedanchor\northwest{ - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{center}{ - \pgfpointorigin - } - \anchor{left}{% - \northwest - \pgf@y=0pt - } - \anchor{in 1}{ - \northwest - \pgf@y=0pt - } - \anchor{in1}{ - \northwest - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{in 2}{ - \northwest - \pgf@y=-\pgf@y - \pgf@x=0pt - } - \anchor{in2}{ - \northwest - \pgf@y=-\pgf@y - \pgf@x=0pt - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{center}{ - \pgf@y=0pt - \pgf@x=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen - - \pgfscope - \pgfstartlinewidth=\pgflinewidth - - % draw outer circle - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} - \pgfusepath{draw} - - % draw inner stuff - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}} - \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}} - \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}} - \pgfsetlinewidth{2\pgflinewidth} - \pgfusepath{draw} - \endpgfscope - } -} - -\pgfdeclareshape{adder} -{ - \savedanchor\northwest{ - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{center}{ - \pgfpointorigin - } - \anchor{left}{% - \northwest - \pgf@y=0pt - } - \anchor{in 1}{ - \northwest - \pgf@y=0pt - } - \anchor{in1}{ - \northwest - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{in 2}{ - \northwest - \pgf@y=-\pgf@y - \pgf@x=0pt - } - \anchor{in2}{ - \northwest - \pgf@y=-\pgf@y - \pgf@x=0pt - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{center}{ - \pgf@y=0pt - \pgf@x=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen - - \pgfscope - \pgfstartlinewidth=\pgflinewidth - - % draw outer circle - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} - \pgfusepath{draw} - - % draw inner stuff - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}} - \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}} - \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}} - \pgfsetlinewidth{2\pgflinewidth} - \pgfusepath{draw} - \endpgfscope - } -} - - - \pgfdeclareshape{spdt} +\pgfdeclareshape{spdt} { \savedanchor\northwest{% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} @@ -1062,7 +843,7 @@ \anchor{text}{ \northeast \pgfpoint - {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)} + {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left)} {0.6\pgf@y} } % @@ -1113,10 +894,19 @@ \anchor{south east}{ \northeast \pgf@y=-\pgf@y - } - + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{nobase}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x + } #2 - \backgroundpath{ + \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} % % @@ -1133,249 +923,46 @@ } } - - - - - -\long\def\pgfcircdeclaremos#1#2#3{ - \pgfcircdeclaretransistor{#1}{ - \anchor{G}{ - \left - } - \anchor{gate}{ - \left - } - \anchor{B}{ - \left - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x - } - \anchor{base}{ - \left - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x - } - #2 - } - {#3} -} - - - - - - - - - -\pgfcircdeclaremos{nmos}{ - \anchor{D}{ +\pgfcircdeclaretransistor{pnp}{ + \anchor{E}{ \northeast } - \anchor{drain}{ + \anchor{emitter}{ \northeast } - \anchor{S}{ + \anchor{C}{ \northeast \pgf@y=-\pgf@y } - \anchor{source}{ + \anchor{collector}{ \northeast \pgf@y=-\pgf@y } -}{% +}{ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfscope - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} - \pgfsetlinewidth{2\pgflinewidth} - \pgfusepath{draw} - \endpgfscope - - \ifpgf@circuit@mos@arrows - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgfresetnontranslationattimefalse - \pgftransformlineattime{.6}{% - \pgfpoint% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% - }{% - \pgfpoint - {\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - \fi - - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} - {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfusepath{draw} -} - - -\pgfcircdeclaremos{pmos}{ - \anchor{S}{ - \northeast - } - \anchor{source}{ - \northeast - } - \anchor{D}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{drain}{ - \northeast - \pgf@y=-\pgf@y - } -}{% - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} - \pgfusepath{draw} - - \ifpgf@circuit@mos@arrows - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgfresetnontranslationattimefalse - \pgftransformlineattime{.4}{% - \pgfpoint% - {\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% - }{% - \pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - \fi - - \pgfscope - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}} - \pgfsetlinewidth{2\pgflinewidth} - \pgfusepath{draw} - \endpgfscope - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} - {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathcircle{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} - {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} - \pgfusepath{draw,fill} - -} - - - - - - - -\pgfcircdeclaretransistor{pnp}{ - \anchor{E}{ - \northeast - } - \anchor{emitter}{ - \northeast - } - \anchor{B}{ - \left - } - \anchor{base}{ - \left - } - \anchor{C}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{collector}{ - \northeast - \pgf@y=-\pgf@y - } -}{ - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height 2}\pgf@circ@res@up}} \pgfusepath{draw} \pgfscope \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@down}} \pgfsetlinewidth{2\pgflinewidth} \pgfusepath{draw} \endpgfscope \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height 2}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} @@ -1386,20 +973,45 @@ \pgftransformlineattime{.5}{% \pgfpoint% {\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@up}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}% }{% \pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height 2}\pgf@circ@res@up}% } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} - {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfusepath{draw} + \ifpgf@circuit@bpt@drawphoto + \pgfscope + \pgfsetarrowsstart{latex'} + \pgfpathmoveto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}} + \pgfpathlineto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}} + \pgfpathlineto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}} + \pgfusepath{draw} + \endpgfscope + \else + \ifpgf@circuit@bpt@drawbase + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + \fi + \fi } @@ -1414,12 +1026,6 @@ \anchor{collector}{ \northeast } - \anchor{B}{ - \left - } - \anchor{base}{ - \left - } \anchor{E}{ \northeast \pgf@y=-\pgf@y @@ -1431,28 +1037,28 @@ }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height 2}\pgf@circ@res@up}} \pgfusepath{draw} \pgfscope \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@down}} \pgfsetlinewidth{2\pgflinewidth} \pgfusepath{draw} \endpgfscope \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height 2}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} @@ -1462,22 +1068,46 @@ \pgfresetnontranslationattimefalse \pgftransformlineattime{.5}{% \pgfpoint% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height 2}\pgf@circ@res@down}% }{% \pgfpoint{\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@down}% } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} - {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfusepath{draw} - + \ifpgf@circuit@bpt@drawphoto + \pgfscope + \pgfsetarrowsstart{latex'} + \pgfpathmoveto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}} + \pgfpathlineto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}} + \pgfpathlineto{\pgfpointadd{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}} + \pgfusepath{draw} + \endpgfscope + \else + \ifpgf@circuit@bpt@drawbase + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + \fi + \fi } @@ -1667,23 +1297,351 @@ %% % IGFET (e.g. MOSFET) \long\def\pgfcircdeclarefet#1#2#3{ - \pgfcircdeclaretransistor{#1}{ - \anchor{B}{ - \left - \pgf@x=\pgf@circ@res@right - } - \anchor{base}{ - \left - \pgf@x=\pgf@circ@res@right - } - #2 - } - {#3} +\pgfdeclareshape{#1}{ + \anchor{center} + {\pgfpointorigin} + \savedanchor\northeast{% upper right + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x=0pt + } + \savedanchor\left{%center left + \pgf@y=0pt + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x + } + \anchor{text}{ + \northeast + \pgfpoint + {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)} + {0.6\pgf@y} + } + % + % pseudo-bipole + \anchor{left}{ % south + \northeast + \pgf@y=-\pgf@y + } + \anchor{right}{ + \northeast + } + \anchor{north}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=\pgf@circ@res@step + \pgf@x=.5\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \pgf@x=0pt + \pgf@y=0pt + } + \anchor{south}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + \pgf@x=.5\pgf@x + } + \anchor{south west}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{north east}{ + \northeast + } + \anchor{north west}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=\pgf@circ@res@step + } + \anchor{south east}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \left + } + \anchor{gate}{ + \left + } + \anchor{B}{ + \left + \pgf@x=\pgf@circ@res@right + } + \anchor{base}{ + \left + \pgf@x=\pgf@circ@res@right + } + \anchor{Bulk}{ + \left + \pgf@x=\pgf@circ@res@right + } + \anchor{nobase}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x + } + \anchor{nogate}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x + } + #2 + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + % + % + \northeast + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = \pgf@x + \left + \pgf@circ@res@left = \pgf@x + % + #3 + % BODY DIODE + \ifpgf@circuit@fet@bodydiode + \drawbodydiode{#1} + \fi + } +} } - - -\pgfcircdeclarefet{nfet}{ +\long\def\drawbodydiode#1{ + \pgfscope + \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \ifpgf@circuit@fet@ntype + \pgftransformrotate{90} + \else + \pgftransformrotate{-90} + \fi + \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}} + \ifpgf@circuit@fulldiode + \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}} + \else + \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}} + \fi + \endpgfscope + %Draw upper connection to body diode + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}} + \ifpgf@circuit@fet@ntype + \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}} + \else + \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}} + \fi + \pgfusepath{draw} + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}} + \pgftransformscale{0.5} + \pgfnode{circ}{center}{}{}{\pgfusepath{fill}} + \endpgfscope{} + %Draw lower connection to body diode + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}} + \ifpgf@circuit@fet@ntype + \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}} + \else + \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}} + \fi + \pgfusepath{draw} + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}} + \pgftransformscale{0.5} + \pgfnode{circ}{center}{}{}{\pgfusepath{fill}} + \endpgfscope +} + +\pgfcircdeclarefet{nmos}{ + \anchor{B}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@x + } + \anchor{base}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@x + } + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } +}{% + \pgf@circuit@fet@ntypetrue + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + \ifpgf@circuit@mos@arrows + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% + }{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \fi + + \ifpgf@circuit@bpt@drawgate + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + \fi +} + + +\pgfcircdeclarefet{pmos}{ + \anchor{B}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@x + } + \anchor{base}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@x + } + \anchor{S}{ + \northeast + } + \anchor{source}{ + \northeast + } + \anchor{D}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{drain}{ + \northeast + \pgf@y=-\pgf@y + } +}{% + \pgf@circuit@fet@ntypefalse + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} + \pgfusepath{draw} + + \ifpgf@circuit@mos@arrows + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.4}{% + \pgfpoint% + {\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% + }{% + \pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \fi + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} + \ifpgf@circuit@bpt@drawgate + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + \fi + \pgfpathcircle{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + \ifpgf@circuit@pmos@emptycircle + \pgfsetfillcolor{white} + \fi + \pgfusepath{draw,fill} +} + + + +\pgfcircdeclarefet{nfet}{ \anchor{D}{ \northeast } @@ -1706,6 +1664,7 @@ } }{% + \pgf@circuit@fet@ntypetrue \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}} @@ -1767,18 +1726,19 @@ {\pgf@circ@res@up+\pgf@circ@res@down}% }{% \pgfpoint% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}% {\pgf@circ@res@up+\pgf@circ@res@down}% } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfusepath{draw} + \fi } @@ -1805,6 +1765,7 @@ } }{% + \pgf@circuit@fet@ntypefalse \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}} @@ -1871,19 +1832,20 @@ {\pgf@circ@res@up+\pgf@circ@res@down}% }{% \pgfpoint% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}% {\pgf@circ@res@up+\pgf@circ@res@down}% } \pgftransformrotate{180} \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfusepath{draw} + \fi } @@ -1915,6 +1877,7 @@ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y } }{% + \pgf@circuit@fet@ntypetrue \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -1963,12 +1926,13 @@ \pgfusepath{draw} % SOLDER DOT at source-bulk connection + \ifpgf@circuit@fet@solderdot \pgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} \pgfnode{circ}{center}{}{}{} \endpgfscope{} - + \fi % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -1998,14 +1962,19 @@ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope + \ifpgf@circuit@bpt@drawgate % GATE CONNECTION \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} \pgfusepath{draw} + \fi } + + + % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector \pgfcircdeclarefet{nigfetebulk}{ %nur ohne strich zwischen Bulk und Source \anchor{D}{ @@ -2033,6 +2002,7 @@ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@y } }{% + \pgf@circuit@fet@ntypetrue \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -2110,13 +2080,14 @@ } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate % GATE CONNECTION \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} \pgfusepath{draw} + \fi } @@ -2149,6 +2120,7 @@ } }{% + \pgf@circuit@fet@ntypetrue \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -2186,12 +2158,13 @@ % SOLDER DOT at source-bulk connection + \ifpgf@circuit@fet@solderdot \pgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} \pgfnode{circ}{center}{}{}{} \endpgfscope{} - + \fi % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -2220,7 +2193,7 @@ } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate % GATE CONNECTION \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left} @@ -2228,6 +2201,7 @@ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}} \pgfusepath{draw} + \fi } % P-CHANNEL IGFET ENHANCEMENT TYPE @@ -2257,6 +2231,7 @@ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@y } }{% +\pgf@circuit@fet@ntypefalse \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -2311,12 +2286,13 @@ % SOLDER DOT at source-bulk connection + \ifpgf@circuit@fet@solderdot \pgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} \pgfnode{circ}{center}{}{}{} \endpgfscope - + \fi % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -2347,7 +2323,7 @@ } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate % GATE CONNECTION (in line with source) \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left} @@ -2355,6 +2331,7 @@ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} \pgfusepath{draw} + \fi } % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector @@ -2384,6 +2361,7 @@ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@y } }{% + \pgf@circuit@fet@ntypefalse \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -2468,7 +2446,7 @@ } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate % GATE CONNECTION (in line with source) \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate width}\pgf@circ@res@left} @@ -2476,6 +2454,7 @@ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} \pgfusepath{draw} + \fi } @@ -2506,6 +2485,7 @@ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y } }{% + \pgf@circuit@fet@ntypefalse \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -2552,12 +2532,13 @@ % SOLDER DOT at source-bulk connection + \ifpgf@circuit@fet@solderdot \pgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} \pgfnode{circ}{center}{}{}{} \endpgfscope{} - + \fi % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -2588,7 +2569,7 @@ } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - + \ifpgf@circuit@bpt@drawgate % GATE CONNECTION \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left} @@ -2596,6 +2577,7 @@ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}} \pgfusepath{draw} + \fi } @@ -2604,12 +2586,7 @@ %% Contrib Danilo Piazzalunga - - - - - -\pgfcircdeclaretransistor{njfet}{ +\pgfcircdeclarefet{njfet}{ \anchor{G}{ \left \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} @@ -2639,6 +2616,7 @@ \pgf@y=-\pgf@y } }{% + \pgf@circuit@fet@ntypetrue \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}} @@ -2679,8 +2657,7 @@ } \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - - + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}} @@ -2690,7 +2667,7 @@ } -\pgfcircdeclaretransistor{pjfet}{ +\pgfcircdeclarefet{pjfet}{ \anchor{G}{ \left \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} @@ -2720,6 +2697,7 @@ \pgf@y=-\pgf@y } }{% + \pgf@circuit@fet@ntypefalse \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}} @@ -2802,6 +2780,7 @@ \pgf@y=-\pgf@y } }{% + \pgf@circuit@fet@ntypetrue \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % DRAIN CONNECTION \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} @@ -2856,12 +2835,13 @@ % SOLDER DOT at source-bulk connection - \pgfscope - \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} - \pgfnode{circ}{center}{}{}{} - \endpgfscope{} - + \ifpgf@circuit@fet@solderdot + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + \fi % ARROW \pgfscope \pgfslopedattimetrue @@ -2907,18 +2887,6 @@ } - - - - - - - - - - - - %% Black thyristor \pgfcircdeclarebipole{ @@ -3307,7 +3275,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\ $-$} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$} \pgfpathmoveto{\pgfpoint @@ -3316,7 +3284,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\ $+$} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} % @@ -3420,56 +3388,446 @@ } -\pgfdeclareshape{circulator} +\pgfdeclareshape{mixer} { \savedanchor\northwest{ - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x - \pgf@x=.5\pgf@x + \ifpgf@circuit@boxed + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x + \pgf@x=.5\pgf@x + \else + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x + \pgf@x=.5\pgf@x + \fi } \anchor{center}{ \pgfpointorigin } \anchor{left}{% \northwest - \pgf@y=0pt + \pgf@y=0pt } \anchor{1}{ \northwest \pgf@y=0pt - } + } \anchor{2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{3}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x } - \anchor{3}{ + \anchor{4}{ \northwest - \pgf@y=-\pgf@y + \pgf@y=\pgf@y \pgf@x=0pt } - \anchor{east}{ + \anchor{in 1}{ \northwest \pgf@y=0pt - \pgf@x=-\pgf@x } - \anchor{west}{ + \anchor{in1}{ \northwest \pgf@y=0pt } - \anchor{south}{ + \anchor{in}{ \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ + \pgf@y=0pt + } + \anchor{in 2}{ \northwest + \pgf@y=-\pgf@y \pgf@x=0pt } - \anchor{south west}{ + \anchor{in2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \ifpgf@circuit@boxed + \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + \fi + + % draw outer circle + \ifpgf@circuit@boxed + \pgf@circ@res@step=.7\pgf@circ@res@step + \pgfsetdash{}{0pt} % draw solid circle if boxed + \else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \fi + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}} + \pgfusepath{draw} + + \endpgfscope + } +} + +\pgfdeclareshape{adder} +{ + \savedanchor\northwest{ + \ifpgf@circuit@boxed + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x + \pgf@x=.5\pgf@x + \else + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x + \pgf@x=.5\pgf@x + \fi + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{1}{ + \northwest + \pgf@y=0pt + } + \anchor{2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{3}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{4}{ + \northwest + \pgf@y=\pgf@y + \pgf@x=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{in2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \ifpgf@circuit@boxed + \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + \fi + + % draw outer circle + \ifpgf@circuit@boxed + \pgf@circ@res@step=.7\pgf@circ@res@step{} + \pgfsetdash{}{0pt} % draw solid circle if boxed + \else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \fi + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + + \endpgfscope + } +} + +\pgfdeclareshape{oscillator} +{ + \savedanchor\northwest{ + \ifpgf@circuit@boxed + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x + \else + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@x + \fi + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{north}{ + \northwest + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@x=.5\pgf@x + \pgf@y=-\pgf@y + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{text}{ + \pgf@x=-2\pgf@x + \advance \pgf@x by -.5\wd\pgfnodeparttextbox + \advance \pgf@y by -1.5\ht\pgfnodeparttextbox + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@Rlen{} + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east" + + % draw outer box + \ifpgf@circuit@boxed{} + \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + \fi + + % draw outer circle + \ifpgf@circuit@boxed + \pgf@circ@res@step=.7\pgf@circ@res@step{} + \pgfsetdash{}{0pt} % draw solid circle if boxed + \else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \fi + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner sine waves + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}} + \pgfusepath{draw} + + \endpgfscope + } +} + +\pgfdeclareshape{circulator} +{ + \savedanchor\northwest{ + \ifpgf@circuit@boxed + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x + \pgf@x=.5\pgf@x + \else + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x + \pgf@x=.5\pgf@x + \fi + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{1}{ + \northwest + \pgf@y=0pt + } + \anchor{2}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{3}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ \northwest \pgf@y=-\pgf@y } @@ -3493,19 +3851,31 @@ \pgfscope \pgfstartlinewidth=\pgflinewidth + % draw outer box + \ifpgf@circuit@boxed + \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + \fi + % draw outer circle - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \ifpgf@circuit@boxed{} + \pgf@circ@res@step=.7\pgf@circ@res@step{} + \pgfsetdash{}{0pt} % draw solid circle if boxed + \else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \fi \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} \pgfusepath{draw} % inner arrow \pgfsetdash{}{0pt} % always draw solid line for inner symbol \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex} \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}} \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step} \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}} \pgfusepath{draw} + \endpgfscope } } @@ -3596,6 +3966,8 @@ \pgfusepath{draw} % draw inner stuff + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} @@ -3635,5 +4007,108 @@ } } +% electromechanical device (motor/generator) +\pgfdeclareshape{elmech} +{ + \savedanchor\northwest{ + %\ifpgf@circuit@boxed + % \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + % \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y + % \pgf@y=.5\pgf@y + % \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + % \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x + % \pgf@x=.5\pgf@x + %\else + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf@x + \pgf@x=.5\pgf@x + %\fi + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{text}{ + \pgfpointorigin + \advance \pgf@x by -.5\wd\pgfnodeparttextbox + \advance \pgf@y by -.5\ht\pgfnodeparttextbox + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{right}{% + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{top}{ + \northwest + \pgf@x=0pt + } + \anchor{pathstart}{ + \northwest + \pgf@x=0pt + } + \anchor{pathend}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{bottom}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@Rlen + \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen + \pgfscope + \pgfstartlinewidth=\pgflinewidth + % draw outer box + % \ifpgf@circuit@boxed + % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + % \fi + % draw outer circle + %\ifpgf@circuit@boxed + % \pgf@circ@res@step=.7\pgf@circ@res@step + % \pgfsetdash{}{0pt} % draw solid circle if boxed + %\else + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + %\fi + \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfsetfillcolor{black} + \pgfusepath{draw,fill} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfsetfillcolor{white} + \pgfusepath{draw,fill} + \endpgfscope + } +} \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 97e6259df39..2127cecb934 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -47,9 +47,23 @@ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above, \circuitikzbasekey/bipole/voltage/direction=forward} \else + \ifpgf@circ@oldvoltagedirection \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below, \circuitikzbasekey/bipole/voltage/direction=backward} + \else + \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below, + \circuitikzbasekey/bipole/voltage/direction=forward} + \fi \fi + \ifpgf@circ@oldvoltagedirection\else + \ifpgf@circuit@bipole@iscurrent + \ifpgf@circuit@bipole@current@backward + \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below, + \circuitikzbasekey/bipole/voltage/direction=forward} + \else + \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below, + \circuitikzbasekey/bipole/voltage/direction=backward} + \fi\fi\fi \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1} \ctikzsetvalof{bipole/voltage/label/unit}{} \ifpgf@circ@siunitx @@ -122,11 +136,21 @@ \fi \else \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$} - (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$} + \ifpgf@circ@oldvoltagedirection + (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$} + (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$} + \else + (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$} + (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$} + \fi \else - (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$} - (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$} + \ifpgf@circ@oldvoltagedirection + (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$} + (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$} + \else + (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$} + (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$} + \fi \fi \fi } diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty index 6565fb9668e..610a5767d17 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -1,4 +1,4 @@ -% Copyright 2007-2009 by Massimo Redaelli +% Copyright 2007-2016 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -11,22 +11,78 @@ %%%%% %%%%% %%%%% -%%%%% Se c'è l'opzione symbol, fallback to siunitx con warning +%%%%% Se c'è l'opzione symbol, fallback to siunitx with warning %%%%% %%%%% \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.4} +\def\pgfcircversion{0.5} +\def\pgfcircversiondate{2016/04/24} \ProvidesPackage{circuitikz}% - [2015/05/15 The CircuiTikz circuit drawing package version \pgfcircversion] + [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion] %% Version 2.0 of pgf/TikZ is required \RequirePackage{tikz} \usetikzlibrary{calc} \usepgflibrary{arrows} + +% The options are listed in the manual in this order + +\DeclareOption{europeanvoltage}{ + \ctikzset{voltage=european} +} + +\DeclareOption{americanvoltage}{ + \ctikzset{voltage=american} +} + +\DeclareOption{europeancurrent}{ + \ctikzset{current = european} +} + +\DeclareOption{americancurrent}{ + \ctikzset{current = american} +} + +\DeclareOption{europeanvoltage}{ + \ctikzset{voltage = european} +} + +\DeclareOption{americanresistor}{ + \ctikzset{resistor = american} +} + +\DeclareOption{europeanresistor}{ + \ctikzset{resistor = european} +} + +\DeclareOption{americaninductor}{ + \ctikzset{inductor = american} +} + +\DeclareOption{europeaninductor}{ + \ctikzset{inductor = european} +} + +\DeclareOption{cuteinductor}{ + \ctikzset{inductor = cute} +} + +\DeclareOption{americanport}{ + \ctikzset{logic ports = american} +} + +\DeclareOption{europeanport}{ + \ctikzset{logic ports = european} +} + +\DeclareOption{europeanport}{ + \ctikzset{logic ports = european} +} + \DeclareOption{european}{ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european} \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester = european} @@ -101,7 +157,6 @@ \ctikzset{gas filled surge arrester = european} } - \DeclareOption{siunitx}{ \pgf@circ@siunitxtrue } @@ -110,28 +165,6 @@ \pgf@circ@siunitxfalse } -\DeclareOption{arrowmos}{ - \pgf@circuit@mos@arrowstrue -} - -\DeclareOption{noarrowmos}{ - \pgf@circuit@mos@arrowsfalse -} - -\DeclareOption{straightlabels}{ - \ctikzset{label/align = straight} -} - -\DeclareOption{rotatelabels}{ - \ctikzset{label/align = rotate} -} - -\DeclareOption{smartlabels}{ - \ctikzset{label/align = smart} -} - - - \DeclareOption{fulldiode}{ \ctikzset{diode = full} } @@ -140,62 +173,76 @@ \ctikzset{diode = empty} } -\DeclareOption{europeanvoltage}{ - \ctikzset{voltage=european} +\DeclareOption{arrowmos}{ + \pgf@circuit@mos@arrowstrue } -\DeclareOption{americanvoltage}{ - \ctikzset{voltage=american} +\DeclareOption{noarrowmos}{ + \pgf@circuit@mos@arrowsfalse } -\DeclareOption{europeancurrent}{ - \ctikzset{current = european} +\DeclareOption{fetbodydiode}{ + \pgf@circuit@fet@bodydiodetrue } -\DeclareOption{americancurrent}{ - \ctikzset{current = american} +\DeclareOption{nofetbodydiode}{ + \pgf@circuit@fet@bodydiodefalse } -\DeclareOption{europeanvoltage}{ - \ctikzset{voltage = european} +\DeclareOption{fetsolderdot}{ + \pgf@circuit@fet@solderdottrue } -\DeclareOption{americanresistor}{ - \ctikzset{resistor = american} +\DeclareOption{nofetsolderdot}{ + \pgf@circuit@fet@solderdotfalse } -\DeclareOption{europeanresistor}{ - \ctikzset{resistor = european} +\DeclareOption{emptypmoscircle}{ + \pgf@circuit@pmos@emptycircletrue } -\DeclareOption{americaninductor}{ - \ctikzset{inductor = american} -} - -\DeclareOption{europeaninductor}{ - \ctikzset{inductor = european} -} -\DeclareOption{cuteinductor}{ - \ctikzset{inductor = cute} +\DeclareOption{lazymos}{ + \ctikzset{tripoles/nmos/width=.5} + \ctikzset{tripoles/nmos/gate height=.35} + \ctikzset{tripoles/nmos/base height=.35} + \ctikzset{tripoles/nmos/height/.initial=1.2} + \ctikzset{tripoles/nmos/base width=.5} + \ctikzset{tripoles/nmos/gate width=.65} + + \ctikzset{tripoles/pmos/width=.5} + \ctikzset{tripoles/pmos/gate height=.35} + \ctikzset{tripoles/pmos/base height=.35} + \ctikzset{tripoles/pmos/height/.initial=1.2} + \ctikzset{tripoles/pmos/base width=.5} + \ctikzset{tripoles/pmos/gate width=.65} + + \pgf@circuit@pmos@emptycircletrue } -\DeclareOption{americanport}{ - \ctikzset{logic ports = american} +\DeclareOption{straightlabels}{ + \ctikzset{label/align = straight} } -\DeclareOption{europeanport}{ - \ctikzset{logic ports = european} +\DeclareOption{rotatelabels}{ + \ctikzset{label/align = rotate} } -\DeclareOption{europeanport}{ - \ctikzset{logic ports = european} +\DeclareOption{smartlabels}{ + \ctikzset{label/align = smart} } \DeclareOption{compatibility}{ \pgf@circuit@compattrue } +\DeclareOption{oldvoltagedirection}{ + \pgf@circ@oldvoltagedirectiontrue +} +\DeclareOption{nooldvoltagedirection}{ + \pgf@circ@oldvoltagedirectionfalse +} + \DeclareOption{betterproportions}{ \ctikzset{monopoles/ground/width/.initial=.15} @@ -257,15 +304,9 @@ } %%%%%%%%% +\input pgfcirc.defines.tex - - -\input circuitikz.code.tex - -% Latex specific -\ctikzset{tripoles/op amp/font/.initial=\scriptsize} - -\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility} +\ExecuteOptions{nofetbodydiode,nofetsolderdot,nooldvoltagedirection,europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility} \ProcessOptions\relax @@ -275,13 +316,11 @@ \RequirePackage{siunitx} \fi -\input circuitikz1.code.tex +\input pgfcircbasic.tex \newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}} %override (unused) circuitikz environment for compability to externalization) \let\circuitikz\tikzpicture \let\endcircuitikz\endtikzpicture - \endinput - -- cgit v1.2.3