diff options
author | Karl Berry <karl@freefriends.org> | 2020-05-10 20:45:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-05-10 20:45:43 +0000 |
commit | be9c569650668cf1f39d05db60ea78d27aed7a0c (patch) | |
tree | c70e303c8f179aa8aa043331e4b638edc69d12c0 /Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 | |
parent | 2a04d6a07cf1e11df5244f9fe92f9b7c6744c5c4 (diff) |
circuit-macros
git-svn-id: svn://tug.org/texlive/trunk@55089 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/liblog.m4')
-rw-r--r-- | Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 b/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 index 495ab2ad2b5..ce261707ca1 100644 --- a/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 +++ b/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 @@ -1,7 +1,7 @@ divert(-1) liblog.m4 Logic gates -* Circuit_macros Version 9.2, copyright (c) 2020 J. D. Aplevich under * +* Circuit_macros Version 9.3, copyright (c) 2020 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 * @@ -52,6 +52,8 @@ define(`Mux_wid',8) `Multiplexer defaults' define(`Mux_ht',18) define(`lg_plen',4) `Logic pin' +define(`lg_pinsep',`(3*L_unit)') `logic pin separation in logic units' +define(`lg_chipwd',`(18*L_unit)') `default chip width' define(`lg_pintxt', `"ifxfig(`$1',`ifsvg(`svg_small(`$1',75)',`sp_{\scriptsize `$1'}sp_')')"') `Logic pin text with bar where possible' @@ -485,17 +487,17 @@ define(`NOT_gate',`ifinstr(`$2',B, `The comprehensive logic pin: lg_pin(location, label, Picname, n|e|s|w [L|M|I|O][N][E], pinno, optlen) - label=text indicating logical pin function; - Picname=pic label for referring to the pin; - n|e|s|w=orientation; + label=text (indicating logical pin function, usually) + Picname=pic label for referring to the pin + n|e|s|w=orientation (north, east, south, west) L=active low out; M=active low in; I=inward arrow; O=outward arrow - N=negated; E=edge trigger' + N=negated (NOT-circle); E=edge trigger' define(`lg_pin',`ifelse(`$1',,,`move to $1') - define(`dna_',`substr(`$4',1)')define(`m4lE',)define(`m4lN',)dnl + define(`dna_',`substr(`$4',1)')define(`m4lE',)define(`m4lch',0)dnl define(`m4ld',`ifelse(`$4',,e,`substr(`$4',0,1)')')dnl define(`m4lph',`ifelse(m4ld,n,0,m4ld,w,-1,m4ld,s,0,1)')dnl define(`m4lpv',`ifelse(m4ld,n,1,m4ld,w,0,m4ld,s,-1,0)')dnl - define(`m4lpl',`ifelse(`$6',,`lg_plen',`$6')')dnl + define(`m4lpl',`ifelse(`$6',,`lg_plen',(`$6')/L_unit)')dnl sc_draw(`dna_',E,`define(`m4lE',1)dnl { line from rsvec_(lp_xy(0,N_rad)) \ to rsvec_(lp_xy(-N_diam*sqrt(3)/2,0)) then to rsvec_(lp_xy(0,-N_rad)) }') @@ -504,29 +506,22 @@ define(`lg_pin',`ifelse(`$1',,,`move to $1') m4ld,s,`above_',`rjust_') at Here dnl ifxfig(`+(lp_xy(-0.72bp__,0))') dnl ifelse(m4lE,1,`+svec_(lp_xy(-N_diam*sqrt(3)/2,0))') }') - sc_draw(`dna_',N,`define(`m4lN',N) + sc_draw(`dna_',N,`define(`m4lch',N_diam*L_unit) { NOT_circle \ at rsvec_(lp_xy(N_rad,0)) }') - sc_draw(`dna_',L,`define(`m4lN',M) + sc_draw(`dna_',L,`define(`m4lch',N_rad*2.5*L_unit) {line from rsvec_(lp_xy(0, - ifelse(m4ld,w,-,m4ld,s,-)N_rad*3/2)) to rsvec_(lp_xy(N_rad*2.5,0)) }') - sc_draw(`dna_',M,`define(`m4lN',M) + ifelse(m4ld,w,-,m4ld,s,-)N_rad*3/2)) to rsvec_(lp_xy(N_rad*2.5,0)) \ + then to Here }') + sc_draw(`dna_',M,`define(`m4lch',N_rad*2.5*L_unit) { line to rsvec_(lp_xy(N_rad*2.5, - ifelse(m4ld,w,-,m4ld,s,-)N_rad*3/2)) then to rsvec_(lp_xy(N_rad*2.5,0))}') - {ifelse(`$3',,,`$3':) line to rsvec_(lp_xy(m4lpl,0))dnl - ifelse(m4lN,N,`chop N_diam*L_unit chop 0')dnl + ifelse(m4ld,w,-,m4ld,s,-)N_rad*3/2)) then to rsvec_(lp_xy(N_rad*2.5,0)) \ + then to Here}') + {ifelse(`$3',,,`$3':) line to rsvec_(lp_xy(m4lpl,0)) chop m4lch chop 0 dnl ifinstr(dna_,I,` <- wid linethick*5.6bp__ ht linethick*7.2bp__ ')dnl ifinstr(dna_,O,` -> wid linethick*5.6bp__ ht linethick*7.2bp__ ') - ifelse(`$5',,,`lg_pintxt(`$5') dnl - at rsvec_(lp_xy(vscal_(1/(L_unit),1pt__,0))) dnl - ifgpic( - `ifelse(m4ld,n,`+svec_(lp_xy(4pt__/(L_unit),0)) rjust_ below_', - m4ld,w,`+svec_(lp_xy(vscal_(1/(L_unit),1pt__,3pt__))) \ - ljust_ above_', - m4ld,s,`+svec_(lp_xy(2pt__/(L_unit),0)) rjust_ above_', - `+svec_(lp_xy(0,-3pt__/(L_unit))) rjust_ above_') ', - `ifelse(m4ld,n,`rjust_ below_', m4ld,w,`ljust_ above_', - `rjust_ above_')')') dnl + ifelse(`$5',,,`move to last line.c; lg_pintxt(`$5') dnl + ifelse(m4ld,n,`rjust_', m4ld,w,`above_',m4ld,e,`above_',`rjust_')') } ') define(`lp_xy',`vrot_(`$1',`$2',m4lph,m4lpv)') @@ -746,16 +741,6 @@ define(`m4ifboolvar_', define(`m4stackdump',`ifdef(`$1',`ifelse($1,,`popdef(`$1')', `$2`'popdef(`$1')m4stackdump(`$1',`$2')')')')dnl -# ****Obsolete `Define positions In1, In2, ... equal to -# positions stacked in `arg2', prefixed by arg1. -# If arg3 is not null then In is replaced by arg3. -# eg H:And(x,y); stackpromote_(H,`AutoInNames',In_)' -#define(`stackpromote_',`define(`m4nct',0) -#`#' Promoting stack `$2': -#stackexec_(`$2',`m4R_',`ifelse($2,,,`define(`m4nct',incr(m4nct)) -#ifelse(`$3',,In,$3)`'m4nct: ifelse(`$1',,,$1.)$2')') -#stackexec_(`m4R_',`$2')') - define(`DrawIn',` # Draw and label input $1 PrevInput: PrevInput-ifdef(`m4LI',`(0,autoinputsep)', |