diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/libcct.m4')
-rw-r--r-- | Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 | 139 |
1 files changed, 75 insertions, 64 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 b/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 index d46990f88a1..acac0b3ef85 100644 --- a/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 +++ b/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 @@ -1,7 +1,7 @@ divert(-1) libcct.m4 -* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under * +* Circuit_macros Version 10.7, copyright (c) 2024 J. D. Aplevich under * * the LaTeX Project Public Licence in file Licence.txt. The files of * * this distribution may be redistributed or modified provided that this * * copyright notice is included and provided that modifications are clearly * @@ -1760,12 +1760,11 @@ define(`m4R',`ifelse(`$2',R,-)')define(`m4sc',`dimen_/24')dnl Amplifier' define(`amp',`eleminit_(`$1') define(`m4wd',`ifelse(`$2',,`dimen_',`($2)')')dnl {line to rvec_(max(0,rp_len/2-m4wd/2),0) - {line from rvec_(m4wd,0) \ - to rvec_(0,m4wd/2) \ - then to rvec_(0,-m4wd/2) \ - then to rvec_(m4wd,0) `$3'} - line from rvec_(m4wd,0) to rvec_(max(m4wd,rp_len/2+m4wd/2),0) } - {[box invis ht_ m4wd wid_ m4wd] at rvec_(max(m4wd,rp_len)/2,0)} + {[ End: vec_(m4wd,0); line from End \ + to vec_(0,m4wd/2) \ + then to vec_(0,-m4wd/2) \ + then to End `$3'] with .End at rvec_(m4wd,0) } + line from rvec_(m4wd,0) to rvec_(max(m4wd,rp_len/2+m4wd/2),0) } line to rvec_(max(rp_len,m4wd),0) invis ') `integrator( linespec,size,attributes )' @@ -1800,7 +1799,7 @@ define(`opamp', `[ pushdef(`m4dlgth',`ifinstr(`$4',=,dimen_,ifelse(`$4',,dimen_,`($4)'))')dnl pushkeys_(`$4',`body::N; lgth:m4dlgth; wdth:m4`'lgth;')dnl pushdef(`dna_',`$5')dnl - eleminit_(`$1',max(elen_-m4lgth/4,m4lgth)) + ifelse(`$1',,`lgt=elen_',`eleminit_(`$1'); lgt=max(rp_len,m4lgth)') W: Here N: vec_(0,m4wdth/2) S: vec_(0,-m4wdth/2) @@ -1811,7 +1810,7 @@ define(`opamp', then to 0.75 between S and E then to S then to W m4body line from 0.75 between W and E to E', `line to N then to E then to S then to W m4body; move to E') - if rp_len > m4lgth then { line to rvec_(rp_len-m4lgth,0) } + if lgt > m4lgth then { line to rvec_(lgt-m4lgth,0) } Out: Here } NE: vec_(m4lgth/2,m4wdth/4); E1: NE SE: vec_(m4lgth/2,-m4wdth/4); E2: SE @@ -2769,7 +2768,7 @@ define(`m4a',ifelse(substr($1,decr(m4I_),1),u,`define(`m4I_',decr(m4I_))'u, define(`$1',substr($1,0,m4I_)`'substr($1,m4t))')')dnl `Conditional subcomponent draw - sc_draw(dna string, chars, iftrue, iffalse)' + sc_draw(dna string, substring, iftrue, iffalse)' define(`sc_draw',`m4_dna(`$1',`$2')ifelse(m4I_,-1,`$4',`$3')') `(r|l|c)label( label, label, label, @@ -4030,62 +4029,74 @@ define(`tstrip',`[ setdir_(`$1') `$4' popdef(`m4wid',`m4ht',`m4box') resetdir_ ]') - `jack(U|D|L|R|degrees, chars) + `jack(U|D|L|R|degrees, chars [;keys]) Phone jack; arg1 sets drawing direction - chars: - L|LM|LB|LMB=long and aux contacts; M|B make|break arrows - S|SM|SB|SMB=short and aux contacts; M|B make|break arrows - R=right orientation with respect to drawing direction ' + chars: A sequence of letters L, S, C, each + possibly followed by M, B, MB, or BM, e.g. LLMSBM + L draws a long contac arm, M adds a Make contact, + B a Break contact, and MB or BM adds both + S similarly draws a short contact + C adds a central medium contact + also: + X=bring aux contacts to external dots + R=right jack orientation wrt to drawing direction + keys: dots=dot keys; (default circle=fill_(1)) + arrowht=expr; (dimen_/8) + sleeve=attributes; e.g. shaded "red" + sleeveht=expr; (4.5*arrowht) + sleevewid=expr; (sleeveht/6) + armlen=expr; len of long armature (dimen_*.75) ' define(`jack',`[ setdir_(`$1') - define(`dna_',`ifelse(`$2',,L,`$2',R,L,`$2')')dnl - s=ifinstr(dna_,R,-1,1) - ght = dimen_/2 - {Sleeve: [shade(1,lbox(dimen_/12,ght))] } - G: Sleeve+vec_(0,-ght/2*s) - F: Sleeve+vec_(dimen_/24,0) - aht = dimen_/8 - Q: Sleeve+vec_(-dimen_*0.7,s*(ght*0.45-aht*3)) - define(`m4jbm',) m4auxcontacts(`dna_',L,s,) - Q: Sleeve+vec_(-dimen_*0.7,(aht*3-ght*0.45)*s) - define(`m4jbm',) m4auxcontacts(`dna_',S,-s,) - `$3'; resetdir_ ] ') - -define(`m4auxcontacts',`ifinstr($1,$2, - `define(`m4I_',index($1,$2))dnl - define(`m4abm',ifelse(substr($1,incr(m4I_),1),M, - M`'ifelse(substr($1,eval(2+m4I_),1),B,B), - substr($1,incr(m4I_),1),B, - B`'ifelse(substr($1,eval(2+m4I_),1),M,M)))dnl - define(`$1',substr($1,0,m4I_)`'substr($1,eval(m4I_+len(m4abm)+1)))dnl - cht = aht*ifelse(ifinstr(m4jbm,M,T)`'ifinstr(m4abm,B,T),TT,3.9,3) - Z: jackcontact(ifelse(`$2',S,0.5,0.6)*dimen_,m4abm`'ifelse($4,,,H),$3) \ - with .T at Q+vec_(0,$3*cht) - $2`'$4: Z.T; Q: $2`'$4 define(`m4jbm',m4abm) - ifinstr(m4abm,M, $2`'M`'$4: Z.M) ifinstr(m4abm,B,; $2`'B`'$4: Z.B) - m4auxcontacts(`$1',$2,$3,ifelse($4,,1,`incr($4)'))')') - - `jackcontact(length,chars,sign) - Phone jack contact to left - chars: - R: right orientation to drawing direction - M|B: make|break contact arrows ' -define(`jackcontact',`[ Point: (0,0) - line from Point ifinstr(`$2',H,`-vec_(dimen_/10,0)', - `to vec_(-dimen_/16,neg_(`$3')*dimen_/16) \ - then to vec_(-dimen_/8,0) then') \ - to vec_(neg_(`$1'),0) - T: dot(,,1) - C: T+vec_(dimen_/5,0) - ifinstr(`$2',H,` - Connector: [shade(1,lbox(dimen_/24,cht))] \ - at T+vec_((`$1')-dimen_*0.16,neg_(`$3')*cht/2)')dnl - ifinstr(`$2',M,` - M: C+vec_(0,`$3'*aht*1.9) - arrow m4c_l <- ht aht wid aht from C+vec_(0,`$3'*aht*0.4) \ - to M ')dnl - ifinstr(`$2',B,` - B: C+vec_(0,neg_(`$3')*aht*1.5) - arrow m4c_l <- ht aht wid aht from C to B ') ; `$4' ] ') + pushkeys_(`$2',`dots:circle=fill_(1):N; + arm::N; armlen:dimen_*0.75; arrowht:dimen_/8; + sleeve::N; sleeveht:m4`'arrowht*4.5; sleevewid:m4`'sleeveht/6; ')dnl + pushdef(`dna_',`$2') pushdef(`rght',sc_draw(`dna_',R,-)1)dnl + pushdef(`m4extrn',sc_draw(`dna_',X,X)) pushdef(`m4vd',`dimen_/16')dnl + ifelse(dna_,,`define(`dna_',L)') + Sleeve: [lbox(m4sleevewid,m4sleeveht,m4sleeve)] + F: Sleeve+vec_(m4sleevewid/2,0) + Ctr: (2 between F and Sleeve)+vec_(-(m4armlen+m4vd), 0); + G: Sleeve+vec_(0,-m4sleeveht/2*(rght)); Sx: G+(Ctr-Sleeve) + H: 2 between G and Sleeve; Lx: H+(Ctr-Sleeve) + Q: Ctr; m4jcontacts(dna_,L,rght,,m4armlen) + Q: Ctr; m4jcontacts(dna_,C,rght,,m4armlen) + Q: Ctr; m4jcontacts(dna_,S,neg_(rght),,m4armlen) + ifelse(m4extrn,X,`ifelse(rght,-1, + `T: Sleeve + (Lx-Ctr)+((Between_(G,H,dimen_/6))-G) + line from H to T then to T+(Ctr-Sleeve); H: dot(,m4dots); ', + `T: Sleeve + (Sx-Ctr)+((Between_(H,G,dimen_/6))-H) + line from G to T then to T+(Ctr-Sleeve); G: dot(,m4dots); ')') + `$3'; resetdir_ popdef(`m4dots',`m4arm', `m4armlen', `m4arrowht', + `m4sleeve', `m4sleeveht', `m4sleevewid',`dna_', `rght', `m4extrn', `m4vd') + ] ') + `m4jcontacts(dna_, L|S|C, 1|-1, blank|n, armlen)' +define(`m4jcontacts',`ifinstr(`$1',`$2', + `pushdef(`dna_',$1) pushdef(`m4code',regexp(dna_,$2\(M\|B\|MB\|BM\)?,\&))dnl + sc_draw(`dna_',m4code, + `pushdef(`armln',`ifelse(`$2',S,0.55/0.75*,`$2',C,0.65/0.75*)'`$5')dnl + pushdef(`connht',`ifelse($4,,3,ifelse(m4code,$2`'B,4.5,3))')dnl + $2`'x: Q ifelse(`$2',C,, + `+vec_(0,$3*ifelse(`$4',,m4sleeveht/2,connht*m4arrowht)); Q: $2`'x') + $2`'$4: dot(at Q,m4dots) + Armature: line chop last [].wid/2 chop 0 to rvec_(armln-2*m4vd,0) dnl + ifelse($4,,`then to rvec_(armln-m4vd,neg_(`$3')*m4vd) \ + then to rvec_(armln,0)') + Contact: Q+vec_(m4arrowht*2,0) + ifelse($4,,,`Connector: [lbox(m4vd,connht*m4arrowht,m4sleeve)] \ + at last []+vec_(armln-3*m4vd,neg_(`$3')*connht*m4arrowht/2)') + ifinstr(m4code,M,`$2`'M`'$4: Contact+vec_(0,`$3'*m4arrowht*1.9) + $2`'M`'$4`'A: arrow m4c_l <- ht m4arrowht wid m4arrowht \ + from Contact+vec_(0,`$3'*m4arrowht*0.4) \ + to $2`'M`'$4 ifelse(m4extrn,X,`then to $2`'$4+vec_(0,`$3'*m4arrowht*1.9) + $2`'M`'$4: dot(,m4dots)'); $2`'x: $2`'M`'$4') + ifinstr(m4code,B,`$2`'B`'$4: Contact+vec_(0,neg_(`$3')*m4arrowht*1.5) + $2`'B`'$4`'A: arrow m4c_l <- ht m4arrowht wid m4arrowht from Contact \ + to $2`'B`'$4 dnl + ifelse(m4extrn,X,`then to $2`'$4+vec_(0,neg_(`$3')*m4arrowht*1.5) + $2`'B`'$4:dot(,m4dots)')') + m4jcontacts(dna_,$2,$3,ifelse($4,,1,`incr($4)'),`$5') + popdef(`armln',`connht')') + popdef(`m4code',`dna_')')') `plug(U|D|L|R|degrees, chars) Phone plug; arg1 sets drawing direction |