diff options
author | Karl Berry <karl@freefriends.org> | 2023-02-11 21:16:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-02-11 21:16:14 +0000 |
commit | 664389d85e86be950cd80065e2af3665a0feadfd (patch) | |
tree | 78c812cf43c4ea3e2713af7e6b947e885127ea4f /Master/texmf-dist/tex/generic | |
parent | d6abdd7b762edd06a176a6ca5dfe4bb308a078bc (diff) |
circuitikz (11feb23)
git-svn-id: svn://tug.org/texlive/trunk@65785 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
13 files changed, 411 insertions, 102 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index c80c4ba02eb..f3a7b7f42e6 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index c6677c331f5..be54c93e344 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -5568,6 +5568,109 @@ % %>>> +% solder jumpers: definitions and code %<<< +\ctikzset{bipoles/solder jumper/width/.initial=0.36} +\ctikzset{bipoles/solder jumper/height/.initial=0.3} % must be less than width, otherwise no gap! +\ctikzset{bipoles/solder jumper/close height/.initial=0.6}% fraction of the vertical gap filled +\ctikzset{bipoles/double solder jumper/width/.initial=0.57} +% +\def\pgfcirc@base@solder@jumper{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpatharc{90}{270}{\pgf@circ@res@up} + \pgfpathclose + \pgfusepath{draw,fill} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpatharc{90}{-90}{\pgf@circ@res@up} + \pgfpathclose + \pgfusepath{draw,fill} +} +% simple solder jumpers +% #1 -> name +% #2 -> open or close (0 means open, 1 closed) +\long\def\pgfcircdeclaresolderjumper#1#2{ + \pgfcircdeclarebipolescaled{switches} + { + \anchor{out}{\northeast \pgf@y=0cm} + \anchor{in}{\southwest\pgf@y=0cm} + \anchor{text}{\northeast + \pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax + \advance\pgf@y by .6\ht\pgfnodeparttextbox\relax + } + } + {\ctikzvalof{bipoles/solder jumper/height}} + {#1} + {\ctikzvalof{bipoles/solder jumper/height}} + {\ctikzvalof{bipoles/solder jumper/width}}{ + % + \pgfcirc@base@solder@jumper + \ifnum #2=0 \else + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up} + {\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up} + {\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \fi + } +} +\pgfcircdeclaresolderjumper{osjumper}{0} +\pgfcircdeclaresolderjumper{csjumper}{1} +\pgfcirc@activate@bipole{l}{osjumper}{osjumper}{open solder jumper} +\pgfcirc@activate@bipole{l}{csjumper}{csjumper}{closed solder jumper} +% three pins (two-ways) solder jumpers +% #1 -> name +% #2 -> first side open or closed +% #3 -> second side open or closed +\long\def\pgfcircdeclaredoublesolderjumper#1#2#3{ + \pgfcircdeclarebipolescaled{switches} + { + % + \anchor{out}{\northeast \pgf@y=0cm} + \anchor{in}{\southwest\pgf@y=0cm} + \anchor{tap}{\northeast\pgf@x=0cm} + \anchor{tap up}{\northeast\pgf@x=0cm} + \anchor{tap down}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y} + \anchor{text}{\northeast + \pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax + \advance\pgf@y by .6\ht\pgfnodeparttextbox\relax + } + } + {\ctikzvalof{bipoles/solder jumper/height}} + {#1} + {\ctikzvalof{bipoles/solder jumper/height}} + {\ctikzvalof{bipoles/double solder jumper/width}} + { + \pgfcirc@base@solder@jumper + \pgfpathrectanglecorners + {\pgfpoint{-.5\pgf@circ@res@up}{\pgf@circ@res@up}} + {\pgfpoint{.5\pgf@circ@res@up}{\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \ifnum #2=0 \else + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} + {\pgfpoint{-.5\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \fi + \ifnum #3=0 \else + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} + {\pgfpoint{.5\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \fi + } +} +% +\pgfcircdeclaredoublesolderjumper{odsjumper}{0}{0} +\pgfcircdeclaredoublesolderjumper{ldsjumper}{1}{0} +\pgfcircdeclaredoublesolderjumper{rdsjumper}{0}{1} +\pgfcircdeclaredoublesolderjumper{cdsjumper}{1}{1} +\pgfcirc@activate@bipole{l}{odsjumper}{odsjumper}{open double solder jumper} +\pgfcirc@activate@bipole{l}{ldsjumper}{ldsjumper}{left double solder jumper} +\pgfcirc@activate@bipole{l}{rdsjumper}{rdsjumper}{right double solder jumper} +\pgfcirc@activate@bipole{l}{cdsjumper}{cdsjumper}{closed double solder jumper} + +% %>>> + %%%%%%%%%%%%%%%%% %% Instruments %%%%%%%%%%%%%%%%% @@ -6534,6 +6637,8 @@ \ctikzset{bipoles/mic/height/.initial=1.2} \ctikzset{bipoles/mic/depth/.initial=.1} \ctikzset{bipoles/mic/width/.initial=.8}% +\ctikzset{bipoles/tlmic/width/.initial=.5}% it MUST be mic width *5/8 +\ctikzset{bipoles/mic/bar thickness/.initial=1} % arresters, fuses, lamps, etc @@ -6592,6 +6697,15 @@ \pgf@circ@draworfill } +\def\pgf@circ@draw@mic@bar#1{%relative length of the bar + \pgfsetroundcap + \pgfsetlinewidth{\ctikzvalof{bipoles/mic/bar thickness}\pgflinewidth}% + % adjust the vertical position; the symbol looks better if the circle touch the bar + \pgfpathmoveto{\pgfpoint{#1\pgf@circ@res@left}{\pgf@circ@res@up+0.4\pgflinewidth}} + \pgfpathlineto{\pgfpoint{#1\pgf@circ@res@right}{\pgf@circ@res@up+0.4\pgflinewidth}} + \pgfusepath{draw} +} + \pgfcircdeclarebipolescaled{misc} {} {\ctikzvalof{bipoles/mic/depth}} @@ -6600,14 +6714,11 @@ {\ctikzvalof{bipoles/mic/width}}{ \pgfscope - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up} - \pgf@circ@draworfill - \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up} + \pgf@circ@draworfill + \pgf@circ@draw@mic@bar{.6} \endpgfscope - \pgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}} % 0.25358 is 0.6-0.4*cos(30) @@ -6616,9 +6727,18 @@ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfusepath{draw} +} +\pgfcircdeclarebipolescaled{misc} +{} +{\ctikzvalof{bipoles/tlmic/width}} +{tlmic} +{\ctikzvalof{bipoles/tlmic/width}} +{\ctikzvalof{bipoles/tlmic/width}}{ - \pgfusepath{draw} - \endpgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{\pgf@circ@res@up} + \pgf@circ@draworfill + \pgf@circ@draw@mic@bar{1} } %% european gas filled surge arrester @@ -6875,6 +6995,7 @@ \pgfcirc@path@to@style{l}{gfsurgearrester}{gas filled surge arrester}{} \pgfcirc@path@to@style{l}{gfsurgearrester}{gf surge arrester}{} \pgfcirc@activate@bipole@simple{l}{mic} +\pgfcirc@activate@bipole@simple{l}{tlmic} \pgfcirc@activate@bipole@simple{l}{loudspeaker} % %>>> diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex index 852042033ea..3f921aaa6d5 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex index b34bea8b1c9..ed86ae3c62f 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex index 00be2b62520..ee77a872f9a 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex index 96ecfd5adcd..a208715d0cb 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -412,9 +412,19 @@ %% Node shapes for RF bipoles%<<< \ctikzset{bipoles/tline/height/.initial=.3} \ctikzset{bipoles/tline/width/.initial=.6} - +\newif\ifpgf@circ@bare@tline +\ctikzset{bipoles/tline/bare/.is if=pgf@circ@bare@tline} \pgfcircdeclarebipolescaled{RF} -{} +{ + \savedmacro{\recessright}{\edef\recessright{\ifpgf@circ@bare@tline -0.4\else 0.0\fi}} + \anchor{center right}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@y=0pt} + \anchor{top right}{\northeast \advance\pgf@x by -0.4\pgf@y} + \anchor{bottom right}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@y=-\pgf@y} + \anchor{center left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x\pgf@y=0pt} + \anchor{top left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x} + \anchor{bottom left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x\pgf@y=-\pgf@y} + \anchor{right}{\northeast \advance\pgf@x by \recessright\pgf@y\pgf@y=0pt} +} {\ctikzvalof{bipoles/tline/height}} {tline} {\ctikzvalof{bipoles/tline/height}} @@ -433,10 +443,12 @@ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up} \pgfusepath{stroke} \endpgfscope - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} - \pgfusepath{stroke} + \ifpgf@circ@bare@tline\else + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfusepath{stroke} + \fi } % microstrip transmission line diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex index 5ebf59cbde0..31aa4eb0736 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -2160,4 +2160,96 @@ } % %>>> +%% definitions and shape for wedgeinv and circleinv%<<< + +\ctikzset{wedge inversion mark/width/.initial = 0.2} +\ctikzset{wedge inversion mark/height/.initial = 0.1} +\pgfdeclareshape{wedgeinv}{ + \savedmacro{\ctikzclass}{\edef\ctikzclass{muxdemuxes}} + \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} + \savedanchor\northeast{% + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgf@y=\ctikzvalof{wedge inversion mark/height}\pgf@circ@scaled@Rlen + \pgf@x=\ctikzvalof{wedge inversion mark/width}\pgf@circ@scaled@Rlen + } + \anchor{center}{\pgfpointorigin} + \anchor{top}{\northeast\pgf@x=0pt\relax} + \anchor{apex}{\northeast\pgf@y=0pt\relax} + \anchor{base}{\pgfpointorigin} + \anchor{mid}{\northeast\pgf@x=0.5\pgf@x\pgf@y=0.5\pgf@y} + % not standard geoanchors, south west is the same as 0,0... + \anchor{right}{\northeast\pgf@y=0pt\relax} + \anchor{east}{\northeast\pgf@y=0pt\relax} + \anchor{e}{\northeast\pgf@y=0pt\relax} + \anchor{left}{\pgfpointorigin} + \anchor{west}{\pgfpointorigin} + \anchor{w}{\pgfpointorigin} + \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x} + \anchor{s}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x} + \anchor{north}{\northeast\pgf@x=0.5\pgf@x} + \anchor{n}{\northeast\pgf@x=0.5\pgf@x} + \anchor{south west}{\pgfpointorigin} + \anchor{sw}{\pgfpointorigin} + \anchor{north east}{\northeast} + \anchor{ne}{\northeast} + \anchor{north west}{\northeast\pgf@x=0pt\relax} + \anchor{nw}{\northeast\pgf@x=0pt\relax} + \anchor{south east}{\northeast\pgf@y=0pt\relax} + \anchor{se}{\northeast\pgf@y=0pt\relax} + % + \pgf@circ@draw@component{ + \northeast\pgf@circ@res@up=\pgf@y\pgf@circ@res@right=\pgf@x + \pgfsetbeveljoin % otherwise it sticks often "inside" the component + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathclose + \pgfusepath{draw} + } +} +% this is *almost* the same as notcirc, but scales with muxdemuxes and +% has the default anchor to the left side +\pgfdeclareshape{circleinv}{ + \savedmacro{\ctikzclass}{\edef\ctikzclass{muxdemuxes}} + \savedanchor\northwest{% + \pgf@circ@notradius + \pgf@y=\pgf@circ@res@temp + \pgf@x=-\pgf@y + } + \pgfcirc@northwest@symmetric@geoanchors + %% use the left side as default anchor + \anchor{center}{\northwest\pgf@y=0pt} + \anchor{geocenter}{\pgfpointorigin} + \anchor{base}{\northwest\pgf@y=0pt} + \anchor{apex}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} + \anchor{mid}{\northwest\pgf@x=0pt} + \anchor{top}{\northwest\pgf@x=0pt} + \anchor{bottom}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} + \anchorborder{ + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + \northwest\pgf@circ@res@temp=\pgf@y + \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}% + {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}} + } + \pgf@circ@draw@component{ + \pgfscope + \northwest\pgf@circ@res@temp=\pgf@y + \pgf@circ@setcolor + \pgf@circ@setlinewidth{multipoles}{\pgflinewidth} + \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@temp} + \ifx\tikz@fillcolor\pgfutil@empty + % set the default fill color to white + \pgfsetfillcolor{white} + % ...but override it if the class is defined! + \pgf@circ@setifdefinedfill{draw, fill}{draw, fill} + \else + \pgfsetfillcolor{\tikz@fillcolor} + \fi + \pgfusepath{draw,fill} + \endpgfscope + } +} +%% %>>> + % vim: set fdm=marker fmr=%<<<,%>>>: diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex index 0cacd11fb46..c0edc823c38 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index 568caa1f64a..127c2975df5 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -1065,12 +1065,30 @@ } %% converters help function +%% definition for styling the DC symbols (GitHub issue #680) +\ctikzset{blocks dc in segments/.initial=1} +\ctikzset{blocks dc out segments/.initial=1} +\ctikzset{blocks dc segments/.code={% + \ctikzset{blocks dc in segments=#1}% + \ctikzset{blocks dc out segments=#1}% + } +} \def\pgf@circ@twoport@converter@dc#1#2{% \pgfscope \pgftransformshift{\pgfpoint{#1\pgf@circ@res@step}{#2\pgf@circ@res@step}} \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0.125\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@step}{0.125\pgf@circ@res@step}} \pgfusepath{draw} + \ifpgf@circuit@full@dashed\else % do not apply the specific dash if fully dashing + \edef\@@up{\ctikzvalof{blocks dc in segments}} + \edef\@@down{\ctikzvalof{blocks dc out segments}} + \ifdim\dimexpr#1\pgf@circ@res@step\relax<0pt + \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@res@step/(4*\@@up-2)} + \else + \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@res@step/(4*\@@down-2)} + \fi + \pgfsetdash{{\pgf@circ@res@other}{\pgf@circ@res@other}}{0pt} + \fi \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{-0.125\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@step}{-0.125\pgf@circ@res@step}} \pgfusepath{draw} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex index ca5e2b00a88..07f3ac987bb 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index 35f147bf49a..d3bd3dd76cc 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -210,31 +210,31 @@ \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/not width/.initial=.9} \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 buffer port/width/.initial=1.4} \ctikzset{tripoles/european buffer port/not height/.initial=.3} -\ctikzset{tripoles/european buffer port/not width/.initial=.8} +\ctikzset{tripoles/european buffer port/not width/.initial=.9} \ctikzset{tripoles/european buffer port/height/.initial=.65} \ctikzset{tripoles/european buffer port/reserved/.initial=.6} \ctikzset{tripoles/european buffer port/input height/.initial=0} \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/not width/.initial=.9} \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/not width/.initial=.9} \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/not width/.initial=.9} \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} @@ -2493,27 +2493,13 @@ \pgfdeclareshape{notcirc}{ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}} - \anchor{center}{\pgfpointorigin} \savedanchor\northwest{% \pgf@circ@notradius \pgf@y=\pgf@circ@res@temp \pgf@x=-\pgf@y } - \anchor{center}{\pgf@y=0pt \pgf@x=0pt} - \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} - \anchor{east}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} - \anchor{e}{\northwest\pgf@y=0pt \pgf@x=-\pgf@x} - \anchor{left}{\northwest\pgf@y=0pt} - \anchor{west}{\northwest\pgf@y=0pt} - \anchor{w}{\northwest \pgf@y=0pt} - \anchor{south}{\northwest \pgf@x=0pt\pgf@y=-\pgf@y} - \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} - \anchor{north}{\northwest\pgf@x=0pt} - \anchor{n}{\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} + \pgfcirc@northwest@symmetric@geoanchors + \anchor{center}{\pgfpointorigin} \anchorborder{ \pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y @@ -3013,6 +2999,12 @@ \ctikzset{tripoles/hemt/bodydiode distance/.initial=.3} \ctikzset{tripoles/hemt/bodydiode conn/.initial=.6} \ctikzset{tripoles/hemt/curr direction/.initial=1} +%% New parameters +\ctikzset{tripoles/hemt/curr direction/.initial=1} +\ctikzset{tripoles/hemt/gate asym/.initial=0} +\newif\ifpgf@circ@hemt@split +\ctikzset{tripoles/hemt/split gate/.is if=pgf@circ@hemt@split} +\ctikzset{tripoles/hemt/source arrow/.initial=0} \ctikzset{tripoles/nfet/width/.initial=.7} \ctikzset{tripoles/nfet/gate height/.initial=.35} @@ -5284,7 +5276,16 @@ \pgfcirc@ferroelectric{pmosd}{\ctikzvalof{tripoles/pmosd/depletion width}} } %% HEMT FET Transistor +\def\pgf@circ@hemt@gate@anchor@helper{% + \northeast + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgfmathsetlength{\pgf@circ@res@step}{{(1+\gateasym)*\pgf@circ@res@up+(1-\gateasym)*\pgf@circ@res@down}} + \left + \pgf@y=\pgf@circ@res@step +} \pgfcircdeclaretransistor{hemt}{ + \savedmacro{\gateasym}{\edef\gateasym{\ctikzvalof{tripoles/hemt/gate asym}}} \anchor{inner up}{ \northeast \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y @@ -5293,43 +5294,108 @@ \northeast \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y } + % override gate/base anchors + \anchor{G}{\pgf@circ@hemt@gate@anchor@helper} + \anchor{gate}{\pgf@circ@hemt@gate@anchor@helper} + \anchor{nogate}{\pgf@circ@hemt@gate@anchor@helper\pgf@x=\ctikzvalof{tripoles/hemt/base width}\pgf@x} + \anchor{B}{\pgf@circ@hemt@gate@anchor@helper} + \anchor{base}{\pgf@circ@hemt@gate@anchor@helper} + \anchor{nobase}{\pgf@circ@hemt@gate@anchor@helper\pgf@x=\ctikzvalof{tripoles/hemt/base width}\pgf@x} }{% % add the circle if requested (before everything else, so we can fill it) \pgfcirc@transistorcircle + % upper connection \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}} - + % lower connection \pgfpathmoveto{\pgfpoint {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} + {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}} + {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfusepath{draw} - \pgfscope - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}} + \edef\@@tmp{\ctikzvalof{tripoles/hemt/source arrow}} + \ifnum\@@tmp=0 \else + \ifpgf@circuit@trans@arrowatend + \ifnum\@@tmp > 0 % + \pgftransformshift{\pgfpoint + {\pgf@circ@res@right} + {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} + \else + \pgftransformshift{\pgfpoint + {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} + \ifnum\@@tmp < 0 \pgftransformrotate{180}\fi + \fi + \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}} + \else + % the position here is a bit strange... + \pgftransformshift{\pgfpoint + {0.5*\pgf@circ@res@right+0.5*\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}} + \ifnum\@@tmp < 0 \pgftransformrotate{180}\fi + \pgfnode{trarrow}{center}{}{}{\pgfusepath{stroke}} + \fi + \fi + \endpgfscope + \pgfscope + % draw gate (base) bar + \ifpgf@circ@hemt@split + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {(1.1+\gateasym)*\pgf@circ@res@up + + (0.9-\gateasym)*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {(1.05+\gateasym)*\pgf@circ@res@up + + (0.95-\gateasym)*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {(0.95+\gateasym)*\pgf@circ@res@up + + (1.05-\gateasym)*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {(0.9+\gateasym)*\pgf@circ@res@up + + (1.1-\gateasym)*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}} + \else + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}} + \fi \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} \pgfusepath{draw} \endpgfscope - + % draw the gate horizontal segment \ifpgf@circuit@bpt@drawgate \pgfpathmoveto{\pgfpoint {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left} - {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}} + {(1+\gateasym)*\pgf@circ@res@up+(1-\gateasym)*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} + {(1+\gateasym)*\pgf@circ@res@up+(1-\gateasym)*\pgf@circ@res@down}} \pgfusepath{draw} \fi } +\tikzset{GaN hemt/.style={hemt, + circuitikz/tripoles/hemt/base height=0.6,%length of the "base" vertical bar + circuitikz/tripoles/hemt/gate height=0.5,%distance of the S/D terminals + circuitikz/tripoles/hemt/bodydiode conn=0.85,% attachment point of body diode + circuitikz/tripoles/hemt/gate asym=-0.1,% slightly down + circuitikz/tripoles/hemt/split gate=true,% split gate + circuitikz/tripoles/hemt/source arrow=1,% right-facing arrow + }, +} \long\def\drawfetcore#1{ \pgftransformationadjustments diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex index f614b86f229..356098f1327 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 4b6c22dfea1..8b66ca8f736 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % |