diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-12 23:13:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-12 23:13:31 +0000 |
commit | 43feab97abfa5a781cd20b13d118c894afee47fb (patch) | |
tree | 7436698e3c97e95d9974744d70f92149fa1809dd /Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty | |
parent | c0fc6f08ac435f1171b1349d429fce172e37a3f2 (diff) |
CircuiTikZ 0.2.4 (12sep11)
git-svn-id: svn://tug.org/texlive/trunk@23913 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty | 559 |
1 files changed, 466 insertions, 93 deletions
diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty index 6fae7459b46..d077f87b73b 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty @@ -11,6 +11,243 @@ %% Tripoles +%\long\def\pgfcircdeclaremixed{ + \pgfdeclareshape{mixer} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/height}\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{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \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}} + + + \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@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/margin}\pgf@circ@res@up + + \pgfscope + \pgfpathellipse + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{\pgf@circ@res@other}{0pt}} + {\pgfpoint{0pt}{\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpointpolar{-45}{\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{45}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpointpolar{-135}{\pgf@circ@res@other}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@up}{0pt}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{0pt}} + + \pgfusepath{draw} + + } + } +%} + + + + \pgfdeclareshape{spdt} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out 1}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{out 2}{ + \northwest + \pgf@x=-\pgf@x + \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 + } + \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}} + + + \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@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left + + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} + + \pgfusepath{draw} + + \pgfscope + \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}} + \endpgfscope + \pgfscope + \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfscope + \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}} + \pgfpathlineto{ + \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}} + {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}} + } + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + } + } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Logic ports +%% + + + + + \long\def\pgfcircdeclarelogicport#1#2{ \pgfdeclareshape{american #1 port} @@ -23,10 +260,6 @@ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x \pgf@x=.5\pgf@x } - \anchor{south}{ - \north - \pgf@y=-\pgf@y - } \savedanchor\left{% \pgf@y=0pt } @@ -59,7 +292,38 @@ \pgf@y=0pt \pgf@x=-.8\pgf@x } - + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \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}} @@ -416,10 +680,6 @@ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x \pgf@x=.5\pgf@x } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } \savedanchor\left{% \pgf@y=0pt } @@ -435,7 +695,38 @@ \anchor{center}{ \pgfpointorigin } - + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \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}} @@ -501,10 +792,6 @@ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x \pgf@x=.5\pgf@x } - \anchor{south}{ - \north - \pgf@y=-\pgf@y - } \savedanchor\left{% \pgf@y=0pt } @@ -537,7 +824,38 @@ \pgf@y=0pt \pgf@x=-.8\pgf@x } - + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \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}} \northwest @@ -610,53 +928,91 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \long\def\pgfcircdeclaretransistor#1#2#3{ \pgfdeclareshape{#1} { - \anchor{center}{\pgfpointorigin} - \savedanchor\north{% + \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\northeast{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x - } - \anchor{south}{ - \north - \pgf@y=-\pgf@y - } - \savedanchor\left{% +% \savedanchor\northeast{% +% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} +% \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y +% \pgf@y=.5\pgf@y +% \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} +% \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x +% } + \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}{ - \north - \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} + \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}{ - \north + \anchor{left}{ % south + \northeast \pgf@y=-\pgf@y } \anchor{right}{ - \north + \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 + } + #2 \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} % % - \north + \northeast \pgf@circ@res@up = \pgf@y \pgf@circ@res@down = -\pgf@y \pgf@circ@res@right = \pgf@x @@ -705,17 +1061,17 @@ \pgfcircdeclaremos{nmos}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -781,17 +1137,17 @@ \pgfcircdeclaremos{pmos}{ \anchor{S}{ - \north + \northeast } \anchor{source}{ - \north + \northeast } \anchor{D}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{drain}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -846,11 +1202,18 @@ {\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} + } @@ -861,10 +1224,10 @@ \pgfcircdeclaretransistor{pnp}{ \anchor{E}{ - \north + \northeast } \anchor{emitter}{ - \north + \northeast } \anchor{B}{ \left @@ -873,11 +1236,11 @@ \left } \anchor{C}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{collector}{ - \north + \northeast \pgf@y=-\pgf@y } }{ @@ -938,10 +1301,10 @@ \pgfcircdeclaretransistor{npn}{ \anchor{C}{ - \north + \northeast } \anchor{collector}{ - \north + \northeast } \anchor{B}{ \left @@ -950,11 +1313,11 @@ \left } \anchor{E}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{emitter}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1013,10 +1376,10 @@ \pgfcircdeclaretransistor{pigbt}{ \anchor{E}{ - \north + \northeast } \anchor{emitter}{ - \north + \northeast } \anchor{B}{ \left @@ -1025,11 +1388,11 @@ \left } \anchor{C}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{collector}{ - \north + \northeast \pgf@y=-\pgf@y } }{ @@ -1100,10 +1463,10 @@ \pgfcircdeclaretransistor{nigbt}{ \anchor{C}{ - \north + \northeast } \anchor{collector}{ - \north + \northeast } \anchor{B}{ \left @@ -1112,11 +1475,11 @@ \left } \anchor{E}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{emitter}{ - \north + \northeast \pgf@y=-\pgf@y } }{ @@ -1230,17 +1593,17 @@ \pgfcircdeclarefet{nfet}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } @@ -1323,17 +1686,17 @@ \pgfcircdeclarefet{pfet}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1423,17 +1786,17 @@ % N-CHANNEL IGFET ENHANCEMENT TYPE \pgfcircdeclarefet{nigfete}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1524,17 +1887,17 @@ % N-CHANNEL IGFET DEPLETION TYPE \pgfcircdeclarefet{nigfetd}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1614,17 +1977,17 @@ % P-CHANNEL IGFET ENHANCEMENT TYPE \pgfcircdeclarefet{pigfete}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1723,17 +2086,17 @@ % P-CHANNEL IGFET DEPLETION TYPE \pgfcircdeclarefet{pigfetd}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1848,17 +2211,17 @@ \pgf@y=-.5\pgf@y } \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1929,17 +2292,17 @@ \pgf@y=.5\pgf@y } \anchor{S}{ - \north + \northeast } \anchor{source}{ - \north + \northeast } \anchor{D}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{drain}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -2161,6 +2524,9 @@ \northwest \pgf@y=-\pgf@y } + \anchor{north}{ + \northwest + } \savedanchor\left{% \pgf@y=0pt } @@ -2209,6 +2575,13 @@ \pgf@y=0pt \pgf@x=-\pgf@x } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \pgf@x=-\pgf@x + } \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} |