diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits')
3 files changed, 649 insertions, 654 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex index ddf8a29f629..30ecbff3c4d 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex @@ -88,17 +88,14 @@ \pgfdeclareshape{direction ee} { \savedanchor\northeast{ - % Right border is given by right extend \pgf@x=0pt% - \csname pgf@arrow@right@\pgfkeysvalueof{/pgf/direction ee arrow}\endcsname % Height is given by minimum height/2 \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/minimum height}}% \pgf@y=.5\pgf@y } \savedanchor\southwest{ % Left border is given by left extend - \pgf@x=0pt% - \csname pgf@arrow@left@\pgfkeysvalueof{/pgf/direction ee arrow}\endcsname + \pgfarrowtotallength{\pgfkeysvalueof{/pgf/direction ee arrow}}% \pgf@x=-\pgf@x% % Height is given by minimum height/2 \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/minimum height}}% @@ -131,10 +128,8 @@ \beforebackgroundpath{ { - \pgfsetarrowsend{\pgfkeysvalueof{/pgf/direction ee arrow}} \pgfsys@beginscope - \pgflowlevelsynccm% - \pgflowlevelobj{}{\pgf@endarrow}% + \pgfarrowdraw{\pgfkeysvalueof{/pgf/direction ee arrow}}% \pgfsys@endscope } } diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex index 5b2beb2b0fb..e137e113cdc 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex @@ -10,131 +10,131 @@ \usepgflibrary{shapes.gates.logic} \pgfkeys{/pgf/.cd, - and gate IEC symbol/.initial=$\char`\&$, - nand gate IEC symbol/.initial=$\char`\&$, - or gate IEC symbol/.initial=$\geq1$, - nor gate IEC symbol/.initial=$\geq1$, - xor gate IEC symbol/.initial={$=1$}, - xnor gate IEC symbol/.initial={$=1$}, - not gate IEC symbol/.initial=1, - buffer gate IEC symbol/.initial=1, - logic gate IEC symbol align/.initial=top, - logic gate IEC symbol color/.initial=% no value + and gate IEC symbol/.initial=$\char`\&$, + nand gate IEC symbol/.initial=$\char`\&$, + or gate IEC symbol/.initial=$\geq1$, + nor gate IEC symbol/.initial=$\geq1$, + xor gate IEC symbol/.initial={$=1$}, + xnor gate IEC symbol/.initial={$=1$}, + not gate IEC symbol/.initial=1, + buffer gate IEC symbol/.initial=1, + logic gate IEC symbol align/.initial=top, + logic gate IEC symbol color/.initial=% no value } \pgfkeys{/pgf/logic gate IEC symbol align/.cd, - top/.code=\pgftransformyshift{\innerhalfheight}, - bottom/.code=\pgftransformyshift{-\innerhalfheight}, - left/.code=\pgftransformxshift{-\innerhalfwidth}, - right/.code=\pgftransformxshift{\innerhalfwidth} + top/.code=\pgftransformyshift{\innerhalfheight}, + bottom/.code=\pgftransformyshift{-\innerhalfheight}, + left/.code=\pgftransformxshift{-\innerhalfwidth}, + right/.code=\pgftransformxshift{\innerhalfwidth} } \def\pgf@lib@sh@logicgates@IEC@foregroundpath#1{% - \dimensions% - {% - \pgftransformshift{\centerpoint}% - \edef\pgf@lib@sh@temp{\pgfkeysvalueof{/pgf/logic gate IEC symbol align}}% - \edef\pgf@lib@sh@@temp{/pgf/logic gate IEC symbol align/.cd, \pgf@lib@sh@temp}% - \expandafter\pgfkeys\expandafter{\pgf@lib@sh@@temp}% - \expandafter\pgftext\expandafter[\pgf@lib@sh@temp]{% - \pgfkeysgetvalue{/pgf/logic gate IEC symbol color}{\pgf@lib@sh@temp}% - \ifx\pgf@lib@sh@temp\pgfutil@empty% - \else% - \expandafter\color\expandafter{\pgf@lib@sh@temp}% - \fi% - \pgfkeysvalueof{/pgf/#1 gate IEC symbol}% - }% - }% -} + \dimensions% + {% + \pgftransformshift{\centerpoint}% + \edef\pgf@lib@sh@temp{\pgfkeysvalueof{/pgf/logic gate IEC symbol align}}% + \edef\pgf@lib@sh@@temp{/pgf/logic gate IEC symbol align/.cd, \pgf@lib@sh@temp}% + \expandafter\pgfkeys\expandafter{\pgf@lib@sh@@temp}% + \expandafter\pgftext\expandafter[\pgf@lib@sh@temp]{% + \pgfkeysgetvalue{/pgf/logic gate IEC symbol color}{\pgf@lib@sh@temp}% + \ifx\pgf@lib@sh@temp\pgfutil@empty% + \else% + \expandafter\color\expandafter{\pgf@lib@sh@temp}% + \fi% + \pgfkeysvalueof{/pgf/#1 gate IEC symbol}% + }% + }% +} \def\pgf@lib@sh@logicgates@dimensions@IEC#1{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y.5\dp\pgfnodeparttextbox% - % - % Adjust for the width of the gate symbol. - % - \setbox\pgf@hbox\hbox{{\pgfkeysvalueof{/pgf/#1 gate IEC symbol}}}% add braces as color-aftergroup-fix TT - \pgf@xa.5\wd\pgf@hbox% - \pgf@ya.5\ht\pgf@hbox% - \advance\pgf@ya.5\dp\pgf@hbox% - \ifdim\pgf@x<\pgf@xa% - \pgf@x\pgf@xa% - \fi% - \ifdim\pgf@y<\pgf@ya% - \pgf@y\pgf@ya% - \fi% - \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}% - \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}% - % - % Adjust for minimum height and width. - % - \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}% - \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}% - \ifdim\pgf@x<.5\pgf@xa% - \pgf@x.5\pgf@xa% - \fi% - \ifdim\pgf@y<.5\pgf@ya% - \pgf@y.5\pgf@ya% - \fi% - % - % Adjust the height for the number of inputs. - % - \c@pgf@counta\pgf@lib@sh@logicgate@numinputs% - \advance\c@pgf@counta1\relax% - \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \pgf@yb2.0\pgf@yb% - \advance\pgf@yb\pgflinewidth% - \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/logic gate input sep}}% - \edef\inputsep{\the\pgf@yc}% - \addtosavedmacro\inputsep% - \ifdim\pgf@yb<\pgf@yc% - \pgf@yb\pgf@yc% - \fi% - \multiply\pgf@yb\c@pgf@counta% - \ifdim\pgf@y<.5\pgf@yb% - \pgf@y.5\pgf@yb% - \fi% - % - \pgf@xa\pgf@y% - \pgfmathaddtolength\pgf@xa{-\pgfkeysvalueof{/pgf/inner xsep}}% - \edef\innerhalfwidth{\the\pgf@xa}% - \addtosavedmacro\innerhalfwidth% - % - \pgf@ya\pgf@y% - \pgfmathaddtolength\pgf@ya{-\pgfkeysvalueof{/pgf/inner ysep}}% - \edef\innerhalfheight{\the\pgf@ya}% - \addtosavedmacro\innerhalfheight% - % - % Take into account the outer sep. - % - \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}% - \pgfmathaddtolength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}% - % - \edef\halfwidth{\the\pgf@x}% - \edef\halfheight{\the\pgf@y}% - \addtosavedmacro\halfwidth% - \addtosavedmacro\halfheight% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y.5\dp\pgfnodeparttextbox% + % + % Adjust for the width of the gate symbol. + % + \setbox\pgf@hbox\hbox{{\pgfkeysvalueof{/pgf/#1 gate IEC symbol}}}% add braces as color-aftergroup-fix TT + \pgf@xa.5\wd\pgf@hbox% + \pgf@ya.5\ht\pgf@hbox% + \advance\pgf@ya.5\dp\pgf@hbox% + \ifdim\pgf@x<\pgf@xa% + \pgf@x\pgf@xa% + \fi% + \ifdim\pgf@y<\pgf@ya% + \pgf@y\pgf@ya% + \fi% + \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}% + \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}% + % + % Adjust for minimum height and width. + % + \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}% + \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}% + \ifdim\pgf@x<.5\pgf@xa% + \pgf@x.5\pgf@xa% + \fi% + \ifdim\pgf@y<.5\pgf@ya% + \pgf@y.5\pgf@ya% + \fi% + % + % Adjust the height for the number of inputs. + % + \c@pgf@counta\pgf@lib@sh@logicgate@numinputs% + \advance\c@pgf@counta1\relax% + \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \pgf@yb2.0\pgf@yb% + \advance\pgf@yb\pgflinewidth% + \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/logic gate input sep}}% + \edef\inputsep{\the\pgf@yc}% + \addtosavedmacro\inputsep% + \ifdim\pgf@yb<\pgf@yc% + \pgf@yb\pgf@yc% + \fi% + \multiply\pgf@yb\c@pgf@counta% + \ifdim\pgf@y<.5\pgf@yb% + \pgf@y.5\pgf@yb% + \fi% + % + \pgf@xa\pgf@x% + \pgfmathaddtolength\pgf@xa{-\pgfkeysvalueof{/pgf/inner xsep}}% + \edef\innerhalfwidth{\the\pgf@xa}% + \addtosavedmacro\innerhalfwidth% + % + \pgf@ya\pgf@y% + \pgfmathaddtolength\pgf@ya{-\pgfkeysvalueof{/pgf/inner ysep}}% + \edef\innerhalfheight{\the\pgf@ya}% + \addtosavedmacro\innerhalfheight% + % + % Take into account the outer sep. + % + \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}% + \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}% + % + \edef\halfwidth{\the\pgf@x}% + \edef\halfheight{\the\pgf@y}% + \addtosavedmacro\halfwidth% + \addtosavedmacro\halfheight% }% \def\pgf@lib@sh@logicgate@IEC@inputanchor#1{% - \dimensions% - \centerpoint% - \advance\pgf@x-\halfwidth% - \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname% - \advance\pgf@x-\invertedradius% - \advance\pgf@x-\outerinvertedradius% - \fi% - % - \pgfutil@tempdima\halfheight% - \multiply\pgfutil@tempdima2\relax% - \c@pgf@counta\numinputs% - \advance\c@pgf@counta1\relax% - \divide\pgfutil@tempdima\c@pgf@counta% - \multiply\pgfutil@tempdima#1\relax% - \advance\pgf@y\halfheight% - \advance\pgf@y-\pgfutil@tempdima% + \dimensions% + \centerpoint% + \advance\pgf@x-\halfwidth% + \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname% + \advance\pgf@x-\invertedradius% + \advance\pgf@x-\outerinvertedradius% + \fi% + % + \pgfutil@tempdima\halfheight% + \multiply\pgfutil@tempdima2\relax% + \c@pgf@counta\numinputs% + \advance\c@pgf@counta1\relax% + \divide\pgfutil@tempdima\c@pgf@counta% + \multiply\pgfutil@tempdima#1\relax% + \advance\pgf@y\halfheight% + \advance\pgf@y-\pgfutil@tempdima% } @@ -142,117 +142,117 @@ % Shape and gate IEC % \pgfdeclareshape{and gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. - % - \pgfmathloop% - \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% - \else% - \pgfutil@ifundefined{pgf@anchor@and gate IEC@input \pgfmathcounter}{% - \expandafter\xdef\csname pgf@anchor@and gate IEC@input \pgfmathcounter\endcsname{% - \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% - }% - }{}% - \repeatpgfmathloop% - \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An and gate must have at least two inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{and}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \anchor{center}{\centerpoint}% - \anchor{mid}{\midpoint} - \anchor{mid west}{% - \dimensions% - \midpoint% - \advance\pgf@x-\halfwidth}% - \anchor{mid east}{% - \dimensions% - \midpoint% - \advance\pgf@x\halfwidth}% - \anchor{base}{\basepoint} - \anchor{base west}{% - \dimensions% - \basepoint% - \advance\pgf@x-\halfwidth}% - \anchor{base east}{% - \dimensions% - \basepoint% - \advance\pgf@x\halfwidth}% - \anchor{north}{\dimensions\centerpoint\advance\pgf@y\halfheight}% - \anchor{south}{\dimensions\centerpoint\advance\pgf@y-\halfheight}% - \anchor{east}{\dimensions\centerpoint\advance\pgf@x\halfwidth}% - \anchor{west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth}% - \anchor{north east}{\dimensions\centerpoint\advance\pgf@x\halfwidth\advance\pgf@y\halfheight}% - \anchor{north west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y\halfheight}% - \anchor{south east}{\dimensions\centerpoint\advance\pgf@x\halfwidth\advance\pgf@y-\halfheight}% - \anchor{south west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y-\halfheight}% - \anchor{output}{\dimensions\centerpoint\advance\pgf@x\halfwidth} - \backgroundpath{% - \dimensions% - \pgf@xc\halfwidth% - \pgf@yc\halfheight% - \pgfmathaddtolength\pgf@xc{-\pgfkeysvalueof{/pgf/outer xsep}}% - \pgfmathaddtolength\pgf@yc{-\pgfkeysvalueof{/pgf/outer xsep}}% - {% - \pgftransformshift{\centerpoint}% - \pgfpathrectangle{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}% - {% - \pgf@xc2.0\pgf@xc% - \pgf@yc2.0\pgf@yc% - \pgfqpoint{\pgf@xc}{\pgf@yc}% - }% - \pgfpathclose% - % - % Draw inputs. - % - \pgf@xc-\halfwidth% - \advance\pgf@xc-\invertedradius% - \pgf@yc\halfheight% - \pgfutil@tempdima2.0\pgf@yc% - \c@pgf@counta\numinputs% - \advance\c@pgf@counta1\relax% - \divide\pgfutil@tempdima\c@pgf@counta% - \pgfmathloop% - \ifnum\pgfmathcounter>\numinputs% - \else% - \advance\pgf@yc-\pgfutil@tempdima% - \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname% - {% - \pgfpathcircle{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\invertedradius}% - }% - \fi% - \repeatpgfmathloop% - }% - } - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{and}} - \anchorborder{% - \pgfextract@process\externalpoint{}% - \dimensions% - \pgfpointadd{\centerpoint}{\pgfpointborderrectangle{\externalpoint}{\pgfqpoint{\halfwidth}{\halfheight}}}% - }% + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. + % + \pgfmathloop% + \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% + \else% + \pgfutil@ifundefined{pgf@anchor@and gate IEC@input \pgfmathcounter}{% + \expandafter\xdef\csname pgf@anchor@and gate IEC@input \pgfmathcounter\endcsname{% + \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% + }% + }{}% + \repeatpgfmathloop% + \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% + \pgferror{An and gate must have at least two inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{and}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \anchor{center}{\centerpoint}% + \anchor{mid}{\midpoint} + \anchor{mid west}{% + \dimensions% + \midpoint% + \advance\pgf@x-\halfwidth}% + \anchor{mid east}{% + \dimensions% + \midpoint% + \advance\pgf@x\halfwidth}% + \anchor{base}{\basepoint} + \anchor{base west}{% + \dimensions% + \basepoint% + \advance\pgf@x-\halfwidth}% + \anchor{base east}{% + \dimensions% + \basepoint% + \advance\pgf@x\halfwidth}% + \anchor{north}{\dimensions\centerpoint\advance\pgf@y\halfheight}% + \anchor{south}{\dimensions\centerpoint\advance\pgf@y-\halfheight}% + \anchor{east}{\dimensions\centerpoint\advance\pgf@x\halfwidth}% + \anchor{west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth}% + \anchor{north east}{\dimensions\centerpoint\advance\pgf@x\halfwidth\advance\pgf@y\halfheight}% + \anchor{north west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y\halfheight}% + \anchor{south east}{\dimensions\centerpoint\advance\pgf@x\halfwidth\advance\pgf@y-\halfheight}% + \anchor{south west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y-\halfheight}% + \anchor{output}{\dimensions\centerpoint\advance\pgf@x\halfwidth} + \backgroundpath{% + \dimensions% + \pgf@xc\halfwidth% + \pgf@yc\halfheight% + \pgfmathaddtolength\pgf@xc{-\pgfkeysvalueof{/pgf/outer xsep}}% + \pgfmathaddtolength\pgf@yc{-\pgfkeysvalueof{/pgf/outer xsep}}% + {% + \pgftransformshift{\centerpoint}% + \pgfpathrectangle{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}% + {% + \pgf@xc2.0\pgf@xc% + \pgf@yc2.0\pgf@yc% + \pgfqpoint{\pgf@xc}{\pgf@yc}% + }% + \pgfpathclose% + % + % Draw inputs. + % + \pgf@xc-\halfwidth% + \advance\pgf@xc-\invertedradius% + \pgf@yc\halfheight% + \pgfutil@tempdima2.0\pgf@yc% + \c@pgf@counta\numinputs% + \advance\c@pgf@counta1\relax% + \divide\pgfutil@tempdima\c@pgf@counta% + \pgfmathloop% + \ifnum\pgfmathcounter>\numinputs% + \else% + \advance\pgf@yc-\pgfutil@tempdima% + \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname% + {% + \pgfpathcircle{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\invertedradius}% + }% + \fi% + \repeatpgfmathloop% + }% + } + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{and}} + \anchorborder{% + \pgfextract@process\externalpoint{}% + \dimensions% + \pgfpointadd{\centerpoint}{\pgfpointborderrectangle{\externalpoint}{\pgfqpoint{\halfwidth}{\halfheight}}}% + }% } @@ -262,76 +262,76 @@ % Shape nand gate IEC % \pgfdeclareshape{nand gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. - % - \pgfmathloop% - \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% - \else% - \pgfutil@ifundefined{pgf@anchor@nand gate IEC@input \pgfmathcounter}{% - \expandafter\xdef\csname pgf@anchor@nand gate IEC@input \pgfmathcounter\endcsname{% - \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% - }% - }{}% - \repeatpgfmathloop% - \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{A nand gate must have at least two inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{nand}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \anchor{output}{% - \csname pgf@anchor@and gate IEC@east\endcsname% - \advance\pgf@x\invertedradius% - \advance\pgf@x\outerinvertedradius% - } - \backgroundpath{% - \csname pgf@sh@bg@and gate IEC\endcsname% - \pgfpathcircle{% - \centerpoint% - \advance\pgf@x\halfwidth% - \advance\pgf@x\invertedradius% - }{+\invertedradius}% - } - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nand}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. + % + \pgfmathloop% + \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% + \else% + \pgfutil@ifundefined{pgf@anchor@nand gate IEC@input \pgfmathcounter}{% + \expandafter\xdef\csname pgf@anchor@nand gate IEC@input \pgfmathcounter\endcsname{% + \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% + }% + }{}% + \repeatpgfmathloop% + \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% + \pgferror{A nand gate must have at least two inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{nand}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \anchor{output}{% + \csname pgf@anchor@and gate IEC@east\endcsname% + \advance\pgf@x\invertedradius% + \advance\pgf@x\outerinvertedradius% + } + \backgroundpath{% + \csname pgf@sh@bg@and gate IEC\endcsname% + \pgfpathcircle{% + \centerpoint% + \advance\pgf@x\halfwidth% + \advance\pgf@x\invertedradius% + }{+\invertedradius}% + } + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nand}} + \inheritanchorborder[from=and gate IEC] } @@ -341,65 +341,65 @@ % Shape or gate IEC % \pgfdeclareshape{or gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. - % - \pgfmathloop% - \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% - \else% - \pgfutil@ifundefined{pgf@anchor@or gate IEC@input \pgfmathcounter}{% - \expandafter\xdef\csname pgf@anchor@or gate IEC@input \pgfmathcounter\endcsname{% - \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% - }% - }{}% - \repeatpgfmathloop% - \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An or gate must have at least two inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{or}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \inheritanchor[from=and gate IEC]{output} - \inheritbackgroundpath[from=and gate IEC] - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{or}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. + % + \pgfmathloop% + \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% + \else% + \pgfutil@ifundefined{pgf@anchor@or gate IEC@input \pgfmathcounter}{% + \expandafter\xdef\csname pgf@anchor@or gate IEC@input \pgfmathcounter\endcsname{% + \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% + }% + }{}% + \repeatpgfmathloop% + \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% + \pgferror{An or gate must have at least two inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{or}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \inheritanchor[from=and gate IEC]{output} + \inheritbackgroundpath[from=and gate IEC] + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{or}} + \inheritanchorborder[from=and gate IEC] } @@ -409,65 +409,65 @@ % Shape nor gate IEC % \pgfdeclareshape{nor gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. - % - \pgfmathloop% - \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% - \else% - \pgfutil@ifundefined{pgf@anchor@nor gate IEC@input \pgfmathcounter}{% - \expandafter\xdef\csname pgf@anchor@nor gate IEC@input \pgfmathcounter\endcsname{% - \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% - }% - }{}% - \repeatpgfmathloop% - \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{A nor gate must have at least two inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{nor}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \inheritanchor[from=nand gate IEC]{output}% - \inheritbackgroundpath[from=nand gate IEC] - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nor}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. + % + \pgfmathloop% + \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% + \else% + \pgfutil@ifundefined{pgf@anchor@nor gate IEC@input \pgfmathcounter}{% + \expandafter\xdef\csname pgf@anchor@nor gate IEC@input \pgfmathcounter\endcsname{% + \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% + }% + }{}% + \repeatpgfmathloop% + \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% + \pgferror{A nor gate must have at least two inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{nor}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \inheritanchor[from=nand gate IEC]{output}% + \inheritbackgroundpath[from=nand gate IEC] + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nor}} + \inheritanchorborder[from=and gate IEC] } @@ -477,65 +477,65 @@ % Shape xor gate IEC % \pgfdeclareshape{xor gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{2}% Maximum 1024 (!) inputs. - % - \pgfmathloop% - \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% - \else% - \pgfutil@ifundefined{pgf@anchor@xor gate IEC@input \pgfmathcounter}{% - \expandafter\xdef\csname pgf@anchor@xor gate IEC@input \pgfmathcounter\endcsname{% - \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% - }% - }{}% - \repeatpgfmathloop% - \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An xor gate must have two inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{xor}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \inheritanchor[from=and gate IEC]{output} - \inheritbackgroundpath[from=and gate IEC] - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xor}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{2}% Maximum 1024 (!) inputs. + % + \pgfmathloop% + \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% + \else% + \pgfutil@ifundefined{pgf@anchor@xor gate IEC@input \pgfmathcounter}{% + \expandafter\xdef\csname pgf@anchor@xor gate IEC@input \pgfmathcounter\endcsname{% + \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% + }% + }{}% + \repeatpgfmathloop% + \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% + \pgferror{An xor gate must have two inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{xor}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \inheritanchor[from=and gate IEC]{output} + \inheritbackgroundpath[from=and gate IEC] + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xor}} + \inheritanchorborder[from=and gate IEC] } @@ -545,65 +545,65 @@ % \pgfdeclareshape{xnor gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. - % - \pgfmathloop% - \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% - \else% - \pgfutil@ifundefined{pgf@anchor@xnor gate IEC@input \pgfmathcounter}{% - \expandafter\xdef\csname pgf@anchor@xnor gate IEC@input \pgfmathcounter\endcsname{% - \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% - }% - }{}% - \repeatpgfmathloop% - \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{A xnor gate must have two inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{xnor}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \inheritanchor[from=nand gate IEC]{output} - \inheritbackgroundpath[from=nand gate IEC] - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xnor}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs. + % + \pgfmathloop% + \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs% + \else% + \pgfutil@ifundefined{pgf@anchor@xnor gate IEC@input \pgfmathcounter}{% + \expandafter\xdef\csname pgf@anchor@xnor gate IEC@input \pgfmathcounter\endcsname{% + \noexpand\pgf@lib@sh@logicgate@IEC@inputanchor{\pgfmathcounter}% + }% + }{}% + \repeatpgfmathloop% + \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% + \pgferror{A xnor gate must have two inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{xnor}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \inheritanchor[from=nand gate IEC]{output} + \inheritbackgroundpath[from=nand gate IEC] + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xnor}} + \inheritanchorborder[from=and gate IEC] } @@ -612,59 +612,59 @@ % Shape buffer gate IEC % \pgfdeclareshape{buffer gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1}% Maximum 1 input. - % - \expandafter\gdef\csname pgf@anchor@buffer gate IEC@input\endcsname{% - \pgf@lib@sh@logicgate@IEC@inputanchor{1}% - }% - \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax% - \PackageError{PGF}{A buffer gate must have one inputs}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{xor}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \inheritanchor[from=and gate IEC]{output} - \inheritbackgroundpath[from=and gate IEC] - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{buffer}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1}% Maximum 1 input. + % + \expandafter\gdef\csname pgf@anchor@buffer gate IEC@input\endcsname{% + \pgf@lib@sh@logicgate@IEC@inputanchor{1}% + }% + \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax% + \pgferror{A buffer gate must have one inputs}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{xor}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \inheritanchor[from=and gate IEC]{output} + \inheritbackgroundpath[from=and gate IEC] + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{buffer}} + \inheritanchorborder[from=and gate IEC] } @@ -674,60 +674,60 @@ % Shape not gate IEC % \pgfdeclareshape{not gate IEC}{ - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate IEC\endcsname{% - \pgf@lib@sh@logicgate@parseinputs{1}% - % - \pgfutil@ifundefined{pgf@anchor@not gate IEC@input}{% - \expandafter\gdef\csname pgf@anchor@not gate IEC@input\endcsname{% - \pgf@lib@sh@logicgate@IEC@inputanchor{1}% - }}{}% - \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax% - \PackageError{PGF}{A not gate must have one input}{}% - \fi% - }% - \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% - \saveddimen\invertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - }% - \saveddimen\outerinvertedradius{% - \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% - \advance\pgf@x.5\pgflinewidth% - } - \savedmacro\dimensions{% - \pgf@lib@sh@logicgates@dimensions@IEC{not}% - } - \savedanchor\centerpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y.5\ht\pgfnodeparttextbox% - \advance\pgf@y-.5\dp\pgfnodeparttextbox% - } - \savedanchor\midpoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@y{+0.5ex}% - } - \savedanchor\basepoint{% - \pgf@x.5\wd\pgfnodeparttextbox% - \pgf@y0pt% - } - \inheritanchor[from=and gate IEC]{center} - \inheritanchor[from=and gate IEC]{mid} - \inheritanchor[from=and gate IEC]{mid west} - \inheritanchor[from=and gate IEC]{mid east} - \inheritanchor[from=and gate IEC]{base} - \inheritanchor[from=and gate IEC]{base west} - \inheritanchor[from=and gate IEC]{base east} - \inheritanchor[from=and gate IEC]{north} - \inheritanchor[from=and gate IEC]{south} - \inheritanchor[from=and gate IEC]{east} - \inheritanchor[from=and gate IEC]{west} - \inheritanchor[from=and gate IEC]{north east} - \inheritanchor[from=and gate IEC]{north west} - \inheritanchor[from=and gate IEC]{south east} - \inheritanchor[from=and gate IEC]{south west} - \inheritanchor[from=nand gate IEC]{output} - \inheritbackgroundpath[from=nand gate IEC] - \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{not}} - \inheritanchorborder[from=and gate IEC] + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate IEC\endcsname{% + \pgf@lib@sh@logicgate@parseinputs{1}% + % + \pgfutil@ifundefined{pgf@anchor@not gate IEC@input}{% + \expandafter\gdef\csname pgf@anchor@not gate IEC@input\endcsname{% + \pgf@lib@sh@logicgate@IEC@inputanchor{1}% + }}{}% + \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax% + \pgferror{A not gate must have one input}% + \fi% + }% + \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% + \saveddimen\invertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + }% + \saveddimen\outerinvertedradius{% + \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}% + \advance\pgf@x.5\pgflinewidth% + } + \savedmacro\dimensions{% + \pgf@lib@sh@logicgates@dimensions@IEC{not}% + } + \savedanchor\centerpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y.5\ht\pgfnodeparttextbox% + \advance\pgf@y-.5\dp\pgfnodeparttextbox% + } + \savedanchor\midpoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgfmathsetlength\pgf@y{+0.5ex}% + } + \savedanchor\basepoint{% + \pgf@x.5\wd\pgfnodeparttextbox% + \pgf@y0pt% + } + \inheritanchor[from=and gate IEC]{center} + \inheritanchor[from=and gate IEC]{mid} + \inheritanchor[from=and gate IEC]{mid west} + \inheritanchor[from=and gate IEC]{mid east} + \inheritanchor[from=and gate IEC]{base} + \inheritanchor[from=and gate IEC]{base west} + \inheritanchor[from=and gate IEC]{base east} + \inheritanchor[from=and gate IEC]{north} + \inheritanchor[from=and gate IEC]{south} + \inheritanchor[from=and gate IEC]{east} + \inheritanchor[from=and gate IEC]{west} + \inheritanchor[from=and gate IEC]{north east} + \inheritanchor[from=and gate IEC]{north west} + \inheritanchor[from=and gate IEC]{south east} + \inheritanchor[from=and gate IEC]{south west} + \inheritanchor[from=nand gate IEC]{output} + \inheritbackgroundpath[from=nand gate IEC] + \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{not}} + \inheritanchorborder[from=and gate IEC] } \endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex index ae857c6fd42..f941abd2647 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex @@ -217,7 +217,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An and gate must have at least two inputs}{}% + \pgferror{An and gate must have at least two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -454,7 +454,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{A nand gate must have at least two inputs}{}% + \pgferror{A nand gate must have at least two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -619,7 +619,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An or gate must have at least two inputs}{}% + \pgferror{An or gate must have at least two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -967,7 +967,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{A nor gate must have at least two inputs}{}% + \pgferror{A nor gate must have at least two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -1166,7 +1166,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An xor gate must have at two inputs}{}% + \pgferror{An xor gate must have at two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -1497,7 +1497,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An xnor gate must have two inputs}{}% + \pgferror{An xnor gate must have two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -1657,7 +1657,7 @@ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate US\endcsname{% \pgf@lib@sh@logicgate@parseinputs{1}% \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax% - \PackageError{PGF}{A not gate must have one input}{}% + \pgferror{A not gate must have one input}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -1960,7 +1960,7 @@ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate US\endcsname{% \pgf@lib@sh@logicgate@parseinputs{1}% \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax% - \PackageError{PGF}{A buffer gate must have one input}{}% + \pgferror{A buffer gate must have one input}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -2153,7 +2153,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{An and gate must have at least two inputs}{}% + \pgferror{An and gate must have at least two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% @@ -2405,7 +2405,7 @@ }{}% \repeatpgfmathloop% \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax% - \PackageError{PGF}{A nand gate must have at least two inputs}{}% + \pgferror{A nand gate must have at least two inputs}% \fi% }% \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}% |