summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-05-09 03:01:47 +0000
committerNorbert Preining <norbert@preining.info>2022-05-09 03:01:47 +0000
commitfe29944c3d5256062708e9b1ae62dc378f9d9993 (patch)
tree2ff3c511d0cb27649150f24bcafec31af12d8faa /graphics
parentce1c001f7db86ff8f09c1203b965ed9f44531d7a (diff)
CTAN sync 202205090301
Diffstat (limited to 'graphics')
-rw-r--r--graphics/mcf2graph/CHANGELOG7
-rw-r--r--graphics/mcf2graph/README26
-rw-r--r--graphics/mcf2graph/mcf2graph.mp336
-rw-r--r--graphics/mcf2graph/mcf_exa_code.pdfbin79140 -> 78730 bytes
-rw-r--r--graphics/mcf2graph/mcf_exa_code.tex6
-rw-r--r--graphics/mcf2graph/mcf_exa_soc.mp6
-rw-r--r--graphics/mcf2graph/mcf_example.pdfbin431296 -> 434560 bytes
-rw-r--r--graphics/mcf2graph/mcf_example.tex4
-rw-r--r--graphics/mcf2graph/mcf_library.mcf29
-rw-r--r--graphics/mcf2graph/mcf_man_soc.mp6
-rw-r--r--graphics/mcf2graph/mcf_manual.pdfbin289251 -> 289201 bytes
-rw-r--r--graphics/mcf2graph/mcf_manual.tex54
-rw-r--r--graphics/mcf2graph/mcf_mplib_exa.pdfbin196130 -> 195721 bytes
-rw-r--r--graphics/mcf2graph/mcf_mplib_exa.tex4
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex21
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin17645 -> 17645 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin1520552 -> 1544857 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex146
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex154
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex315
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex4
22 files changed, 790 insertions, 332 deletions
diff --git a/graphics/mcf2graph/CHANGELOG b/graphics/mcf2graph/CHANGELOG
index aefa94b116..00015d74f5 100644
--- a/graphics/mcf2graph/CHANGELOG
+++ b/graphics/mcf2graph/CHANGELOG
@@ -1,6 +1,11 @@
*******************************************************************************
- Changelog of mcf2graph software package by Akira Yamaji 2022-03-27
+ Changelog of mcf2graph software package by Akira Yamaji 2022-05-08
*******************************************************************************
+[ver. 4.84 / 2022-05-08]
+ -fix bug in atom drawing
+ -improve report output
+ -update mcf_library.mcf
+
[ver. 4.83 / 2022-03-27]
-fix bug in bond check
-change fuction name
diff --git a/graphics/mcf2graph/README b/graphics/mcf2graph/README
index 61465c30aa..d14681dc17 100644
--- a/graphics/mcf2graph/README
+++ b/graphics/mcf2graph/README
@@ -1,7 +1,7 @@
********************************************************************************
mcf2graph : Convert Molecular Coding Format to graphics with MetaPost
Author : Akira Yamaji
- version : 4.83 2022-03-27
+ version : 4.84 2022-05-08
E-mail : mcf2graph@gmail.com
Located at : http://www.ctan.org/pkg/mcf2graph
********************************************************************************
@@ -34,21 +34,21 @@
3. How to use mcf2graph with MetaPost
Minimum requirement to use mcf2graph : mpost.exe,mpost.dll,mpost.mp,plain.mp
- ( 1) >mpost FILENAME => output eps(.mps) file
- ( 2) >mpost -s ahangle=1 FILENAME => output png file (600dpi)
- ( 3) >mpost -s ahangle=11 FILENAME => output png file (1200dpi)
- ( 4) >mpost -s ahangle=2 FILENAME => output svg file
- ( 5) >mpost -s ahangle=3 FILENAME => output eps(.eps) file
- ( 6) >mpost -s ahlength=1 FILENAME => output information-aux file(for tex)
- ( 7) >mpost -s ahlength=2 FILENAME => output information-aux file
+ ( 1) >mpost filename => output eps(.mps) file
+ ( 2) >mpost -s ahangle=1 filename => output png file (600dpi)
+ ( 3) >mpost -s ahangle=11 filename => output png file (1200dpi)
+ ( 4) >mpost -s ahangle=2 filename => output svg file
+ ( 5) >mpost -s ahangle=3 filename => output eps(.eps) file
+ ( 6) >mpost -s ahlength=1 filename => output information-aux file(for tex)
+ ( 7) >mpost -s ahlength=2 filename => output information-aux file
(for spread sheet)
- ( 8) >mpost -s ahlength=3 FILENAME => output library-aux file
- ( 9) >mpost -s ahlength=5 FILENAME => output mol file(V2000)
- (10) >mpost -s ahlength=6 FILENAME => output mol file(V3000)
- (11) >mpost -s ahlength=7 FILENAME => output report file
+ ( 8) >mpost -s ahlength=3 filename => output library-aux file
+ ( 9) >mpost -s ahlength=5 filename => output mol file(V2000)
+ (10) >mpost -s ahlength=6 filename => output mol file(V3000)
+ (11) >mpost -s ahlength=7 filename => output report file
4. License
- mcf2graph ver 4.83 Copyright (c) 2013-2022 Akira Yamaji
+ mcf2graph ver 4.84 Copyright (c) 2013-2022 Akira Yamaji
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/graphics/mcf2graph/mcf2graph.mp b/graphics/mcf2graph/mcf2graph.mp
index 10c14d4cec..75ae74cf07 100644
--- a/graphics/mcf2graph/mcf2graph.mp
+++ b/graphics/mcf2graph/mcf2graph.mp
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.83 Copyright (c) 2013-2022 Akira Yamaji
+% mcf2graph ver 4.84 Copyright (c) 2013-2022 Akira Yamaji
%
% Permission is hereby granted, free of charge, to any person obtaining a copy of this software
% and associated documentation files (the "Software"), to deal in the Software without restriction,
@@ -33,7 +33,7 @@
% Set output MOL file (V3000) : mpost -s ahlength=6 FILENAME
% Set output report : mpost -s ahlength=7 FILENAME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-message "* This is mcf2graph ver 4.83 2022.03.27";
+message "* This is mcf2graph ver 4.84 2022.05.08";
tracingstats:=1; prologues:=3; warningcheck:=0;
%-------------------------------------------------------------------------------------------------
numeric save_num[],parts_com[][],parts_par[][],parts_cnt[],tbl_atom[],tbl_group[][],tbl_atom_wt[],
@@ -157,23 +157,19 @@ def parameter_list=
lonepairspace,offset_atom,offset_wedge,max_blength,offset_hash_gap,offset_bond_gap,
thickness_frame,offset_thickness,numbering_start,numbering_end,defaultsize,defaultscale,
labeloffset,mangle,blength,fsize,fmargin,msize,mposition,defaultfont,atomfont,dottedline_gap,
- Me,Et,CH3,NH,NH2,NO,NO2,OH,CHO,COOH,CN,SH,!CH3,!NH2,!NO2,!OH,!CHO,!COOH,!CN,!SH
-enddef;
+ Me,Et,CH3,NH,NH2,NO,NO2,OH,CHO,COOH,CN,SH,!CH3,!NH2,!NO2,!OH,!CHO,!COOH,!CN,!SH enddef;
%--------------------------------------------------------------------------------------------------
def init_par(text t)=
nA:=nB:=nC:=0;
for list=t: if numeric list: save_num[incr nA]:=list;
ef pair list: save_pair[incr nB]:=list;
- ef string list: save_str[incr nC]:=list; fi
- endfor
-enddef;
+ ef string list: save_str[incr nC]:=list; fi endfor enddef;
%--------------------------------------------------------------------------------------------------
def store_par(text t)=
nA:=nB:=nC:=0;
for list=t: if numeric list: if save_num[incr nA]<>list: save_num[nA]:=list; fi
ef pair list: if save_pair[incr nB]<>list: save_pair[nB]:=list; fi
- ef string list: if save_str[incr nC]<>list: save_str[nC]:=list; fi fi
- endfor
+ ef string list: if save_str[incr nC]<>list: save_str[nC]:=list; fi fi endfor
enddef;
%--------------------------------------------------------------------------------------------------
def restore_par(text t)=
@@ -191,12 +187,12 @@ def beginfigm(text s)=
hideH,lineB,sB,eB,angB,angA,lenB,angX,numS,sumA,bond_num,wdM,htM,chargeA,addA,add_rot,
file_input,file_output,cal_FM,cal_MW,cal_MI,inf_Cat,inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,
inf_USE,inf_EXA,inf_EXB,inf_MW,mol_pic,sC,sI,sS,sT,sV,color_list,unit_cnt,f_end,semic_cnt,
- f_match,var_n,tag_a,var_a,at_semic,at_comma;
+ f_match,var_n,tag_a,var_a,at_char,arg_s;
numeric mc_indent[],hideH[],lineB[],sB[],eB[],angB[],angA[],lenB[],angX[],strA[],sumA[],
- bond_num[],wdM[],htM[],chargeA[],addA[],add_rot[],at_semic[],at_comma[];
+ bond_num[],wdM[],htM[],chargeA[],addA[],add_rot[],at_char[];
pair posA[],posM[][];
- string info_s[],mc[],tag_a[],var_a[],mc,filter_s,file_input,file_output,cal_FM,cal_MW,cal_MI,
- inf_Cat,inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB,inf_MW,
+ string info_s[],mc[],tag_a[],var_a[],arg_s[],mc,filter_s,file_input,file_output,cal_FM,cal_MW,
+ cal_MI,inf_Cat,inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB,inf_MW,
sC,sI,sS,sT,sV;
picture mol_pic[];
color color_list[];
@@ -209,7 +205,7 @@ def beginfigm(text s)=
mc:=temps:=cal_MW:=cal_MI:=cal_FM:=filter_s:=""; file_input:=default_library;
%------------------------------------------------------------------------------------------------
parts_num:=parts_usr_start; parts_int:=parts_int_start;
- fig_num:=fig_num+1; f_ext:=cntM:=mc_row:=info_cnt:=f_EOF:=0;
+ fig_num:=fig_num+1; f_ext:=cntM:=mc_row:=info_cnt:=f_EOF:=at_char[0]:=0;
%------------------------------------------------------------------------------------------------
for list=s:
at_colon:=scan_char(":",list,0,1);
@@ -254,7 +250,7 @@ def endfigm=
fi
%----------------------------------------------------------------------------------------
if scan_bit(sw_frame,Outside): draw_frame((0,0),fig_wd,fig_ht,thickness_frame);
- else: draw_corner((0,0),fig_wd,fig_ht,0.05);
+ else: draw_corner((0,0),fig_wd,fig_ht,0.01);
fi
if scan_bit(sw_frame,Inside):
draw_frame((margin_lr,margin_tb),fig_wd-2margin_lr,fig_ht-2margin_tb,thickness_frame);
@@ -320,11 +316,9 @@ def pickup_data_unit(expr t,v,f)=
endfor
fi
else:
- semic_cnt:=split_semic(sS); inf_num:=semic_cnt+1;
+ inf_num:=split_char(sS,";")+1;
for i=1 upto inf_num:
- if i<=semic_cnt: sI:=substring(at_semic[i-1],at_semic[i]-1) of sS;
- else: sI:=substring(at_semic[semic_cnt],length(sS)) of sS; fi
- nA:=scan_char(":",sI,0,1);
+ sI:=arg_s[i]; nA:=scan_char(":",sI,0,1);
tag_a[i]:=substring(0,nA-1) of sI; var_a[i]:=substring(nA,length(sI)) of sI;
if t=tag_a[i]: if v=var_a[i]: f_match:=1; fi fi
endfor
@@ -333,14 +327,6 @@ def pickup_data_unit(expr t,v,f)=
endfor
if f=1: closefrom file_input; fi
enddef;
-%--------------------------------------------------------------------------------------------------
-vardef scan_bit(expr n,b)= if b>=1: odd(floor(n/b)) else: odd(floor((frac n)/b)) fi enddef;
-vardef scan_char(expr c,s,d,n)=
- nN:=0;
- if d=0: for i=n upto length(s): if subc(i,s)=c: nN:=i; fi exitif nN>0; endfor
- ef d=1: for i=n upto length(s): if subc(i,s)<>c: nN:=i; fi exitif nN>0; endfor
- ef d=-1: for i=length(s) downto n: if subc(i,s)<>c: nN:=i; fi exitif nN>0; endfor fi nN
-enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vardef '(text t)= parts_num:=parts_num+1; read_mcf(parts_num)(t); parts_num enddef;
vardef read_id(text t)= parts_num:=parts_num+1;
@@ -357,11 +343,9 @@ tertiarydef a op_lth b = if known b:: (_tmp_env,b),a else:: _nop,a fi enddef;
tertiarydef a op_bqu b = if known b:: (_tmp_len,b),a else:: _nop,a fi enddef;
def rot_angle primary n = (_rot_ang,n) enddef; def cyc_atom primary n = (_cyc,n) enddef;
def jump_atom_abs primary a =
- if numeric a:: (_jp_atom,$a) ef pair a:: (_jp_atom,$1),<$0,angle(a)~0`length(a),<$0 fi
-enddef;
+ if numeric a:: (_jp_atom,$a) ef pair a:: (_jp_atom,$1),<$0,angle(a)~0`length(a),<$0 fi enddef;
def jump_atom primary a =
- if numeric a:: (_jp_atom,a) ef pair a:: <$0,angle(a)~0`length(a),<$0 fi
-enddef;
+ if numeric a:: (_jp_atom,a) ef pair a:: <$0,angle(a)~0`length(a),<$0 fi enddef;
def chg_length primary n = (_com,_len_s),(_chg_len,n) enddef;
def group_si secondary n = if known n:: (_group_si,n) else:: _nop fi enddef;
def group_dm secondary n = if known n:: (_group_dm,n) else:: _nop fi enddef;
@@ -433,8 +417,7 @@ enddef;
def fuse_ring(expr a,b) =
CP(_jp_bond,a) CP(_rot_ang,180) CP(_get_len,a) CP(_com,_len_s) CP(_chg_len,_ring_len)
for i==1 upto b-2:: CP(_mk_bond,360 DIV b) endfor
- CP(_com,_len_e) if a<=0:: CP(_cyc_eB,a-b+2) else:: CP(_cyc_eB,a) fi
-enddef;
+ CP(_com,_len_e) if a<=0:: CP(_cyc_eB,a-b+2) else:: CP(_cyc_eB,a) fi enddef;
%-------------------------------------------------------------------------------------------------
def fuse_ring_bonds(expr a,b,c) =
CP(_jp_bond,xpart(a)) CP(_rot_ang,180) CP(_com,_len_s)
@@ -452,8 +435,7 @@ def fuse_ring_size(expr a,b,c) =
ef b==7:: CP(_mk_bond,360 DIV 7-(c-8))
for i==1 upto 4:: CP(_mk_bond,360 DIV 7+((c-8) DIV 2.5)) endfor
ef b==8:: CP(_mk_bond,45-(c-8)) for i==1 upto 5:: CP(_mk_bond,45+((c-8) DIV 3)) endfor fi
- CP(_com,_len_e) if a<=0:: CP(_cyc_eB,a-b+2) else:: CP(_cyc_eB,a) fi
-enddef;
+ CP(_com,_len_e) if a<=0:: CP(_cyc_eB,a-b+2) else:: CP(_cyc_eB,a) fi enddef;
%=================================================================================================
vardef change_bond(expr a,b) =
if known b:: parts_int:=parts_int+1; nC:=0;
@@ -465,12 +447,9 @@ vardef change_bond(expr a,b) =
if frac parts_par[a][i]==0:: CA(_set_line,b,parts_par[a][i])
ef b==dl:: CA(_set_line,dr,floor parts_par[a][i])
ef b==dr:: CA(_set_line,dl,floor parts_par[a][i])
- else:: CA(_set_line,b,floor parts_par[a][i])
- fi
- fi
+ else:: CA(_set_line,b,floor parts_par[a][i]) fi fi
endfor
- else:: CP(_set_adr,a) CP(_set_line,b)
- fi
+ else:: CP(_set_adr,a) CP(_set_line,b) fi
elseif (b>=?3)and(b<=?8[15])::
if numeric a::
if a>=parts_int_start::
@@ -507,10 +486,7 @@ vardef change_bond(expr a,b) =
ef b==Ph1:: fuse_ring_bonds((parts_com[a][i],parts_par[a][i]),6,4)
CA(_set_line,dl,-1) CA(_set_line,dl,-3)
ef b==Ph2:: fuse_ring_bonds((parts_com[a][i],parts_par[a][i]),6,4)
- CA(_set_line,dl,-2) CA(_set_line,dl,-4)
- fi
- fi
- endfor
+ CA(_set_line,dl,-2) CA(_set_line,dl,-4) fi fi endfor
else::
if b==Ph1:: fuse_ring(a,6) CA(_set_line,dl,-2) CA(_set_line,dl,-4)
ef b==Ph2:: fuse_ring(a,6) CA(_set_line,dl,-1) CA(_set_line,dl,-3) CA(_set_line,dl,-5)
@@ -527,13 +503,9 @@ vardef change_bond(expr a,b) =
ef b==?6[2]:: fuse_ring_bonds(a,6,2)
ef b==?5[2]:: fuse_ring_bonds(a,5,2)
ef b==Ph1:: fuse_ring_bonds(a,6,4) CA(_set_line,dl,-1) CA(_set_line,dl,-3)
- ef b==Ph2:: fuse_ring_bonds(a,6,4) CA(_set_line,dl,-2) CA(_set_line,dl,-4)
- fi
- fi
- fi
+ ef b==Ph2:: fuse_ring_bonds(a,6,4) CA(_set_line,dl,-2) CA(_set_line,dl,-4) fi fi fi
elseif color b:: color_list[incr cntC]:=b; CA(_set_colorB,cntC,a) fi
- parts_cnt[parts_int]:=nC; parts_int
- fi
+ parts_cnt[parts_int]:=nC; parts_int fi
enddef;
%-------------------------------------------------------------------------------------------------
vardef change_atom(expr a,b)=
@@ -550,8 +522,7 @@ vardef change_atom(expr a,b)=
CP(_tmp_rot,-35) CA(_group_dm,O,a) CP(_com,_group_e)
ef b==SO:: CA(_chg_atom,S,a) CP(_com,_group_s) CA(_group_dm,O,a) CP(_com,_group_e)
ef b==n_:: CP(_com,_group_s) CP(_set_add,a_minus) CP(_chg_add,a) CP(_com,_group_e)
- ef b==p_:: CP(_com,_group_s) CP(_set_add,a_plus) CP(_chg_add,a) CP(_com,_group_e)
- fi
+ ef b==p_:: CP(_com,_group_s) CP(_set_add,a_plus) CP(_chg_add,a) CP(_com,_group_e) fi
ef pair b::
CP(_com,_group_s)
if a>=parts_emb_start::
@@ -566,20 +537,16 @@ vardef change_atom(expr a,b)=
else:: CA(xpart(b),ypart(b),a) fi
CP(_com,_group_e)
ef color b:: color_list[incr cntC]:=b; CA(_set_colorA,cntC,a) fi
- parts_cnt[parts_int]:=nC; parts_int
- fi
+ parts_cnt[parts_int]:=nC; parts_int fi
enddef;
%-------------------------------------------------------------------------------------------------
def com_par(expr c,p)= parts_com[parts_int][incr nC]:=c; parts_par[parts_int][nC]:=p; enddef;
def com_par_adr(expr c,p,a)=
if a>=parts_emb_start::
for i==1 upto parts_cnt[a]::
- if parts_com[a][i]==_numeric:: com_par(_set_adr,parts_par[a][i]) com_par(c,p)
- else:: com_par(parts_com[a][i],parts_par[a][i]) fi
- endfor
- else:: com_par(_set_adr,a) com_par(c,p)
- fi
-enddef;
+ if parts_com[a][i]==_numeric:: com_par(_set_adr,parts_par[a][i]) com_par(c,p)
+ else:: com_par(parts_com[a][i],parts_par[a][i]) fi endfor
+ else:: com_par(_set_adr,a) com_par(c,p) fi enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def ext_setup=
pickup pencircle scaled ext_defaultline;
@@ -601,13 +568,11 @@ def add_to_molecule(text t)=
lonepairdiam:=0.3aw; lonepairspace:=.7aw; circlediam:=.6aw; circlepen:=.2;
for i=1 upto cntA:
A[i]:=posA[i]; A[i]ang:=angX[i]; A[i]up:=dir(angX[i]);
- A[i]left:=dir(angX[i]+90); A[i]right:=dir(angX[i]-90); A[i]down:=dir(angX[i]+180);
- endfor
+ A[i]left:=dir(angX[i]+90); A[i]right:=dir(angX[i]-90); A[i]down:=dir(angX[i]+180); endfor
for i=1 upto cntB:
B[i]s:=posA[sB[i]]; B[i]e:=posA[eB[i]]; B[i]m:=0.5[B[i]s,B[i]e]; B[i]:=B[i]s--B[i]e;
B[i]ang:=angB[i]; B[i]up:=dir(angB[i]);
- B[i]down:=dir(angB[i]+180); B[i]left:=dir(angB[i]+90); B[i]right:=dir(angB[i]-90);
- endfor
+ B[i]down:=dir(angB[i]+180); B[i]left:=dir(angB[i]+90); B[i]right:=dir(angB[i]-90); endfor
t addto mol_pic[cntM] also currentpicture; clearit;
endgroup;
enddef;
@@ -624,24 +589,19 @@ def ext_to_fig(text t)=
endgroup;
enddef;
%-------------------------------------------------------------------------------------------------
-vardef circled_plus_add=
- nA:=circlediam; nB:=circlepen;
+vardef circled_plus_add= nA:=circlediam; nB:=circlepen;
image(draw fullcircle scaled nA wpcs nB;
- draw (-.5nA,0)--(.5nA,0) wpcs nB; draw (0,-.5nA)--(0,.5nA) wpcs nB;)
-enddef;
+ draw (-.5nA,0)--(.5nA,0) wpcs nB; draw (0,-.5nA)--(0,.5nA) wpcs nB;) enddef;
%-------------------------------------------------------------------------------------------------
-vardef circled_minus_add=
- nA:=circlediam; nB:=circlepen;
- image(draw fullcircle scaled nA wpcs nB; draw (-.5nA,0)--(.5nA,0) wpcs nB;)
-enddef;
+vardef circled_minus_add= nA:=circlediam; nB:=circlepen;
+ image(draw fullcircle scaled nA wpcs nB; draw (-.5nA,0)--(.5nA,0) wpcs nB;) enddef;
%-------------------------------------------------------------------------------------------------
vardef lone_pair_add expr n=
image(draw (0,0) wpcs lonepairdiam; draw ((0,lonepairspace) rotated n) wpcs lonepairdiam;)
enddef;
%=================================================================================================
def MCat(expr w,h)(text t)=
- save_mposition:=mposition; mposition:=(w,h); MC(t) mposition:=save_mposition;
-enddef;
+ save_mposition:=mposition; mposition:=(w,h); MC(t) mposition:=save_mposition; enddef;
%-------------------------------------------------------------------------------------------------
def MC(text t)=
begingroup
@@ -681,8 +641,7 @@ def MC(text t)=
else: factor:=((fig_ht-2margin_tb)*ypart(msize))/mol_ht; fi
else:
if xpart(msize)>1: factor:=xpart(msize)/mol_wd;
- else: factor:=((fig_wd-2margin_lr)*xpart(msize))/mol_wd; fi
- fi
+ else: factor:=((fig_wd-2margin_lr)*xpart(msize))/mol_wd; fi fi
exitif (factor>=1-eps)and(factor<=1+eps); blen:=blen*factor; proc_size_setup;
endfor
if blen>max_blength: blen:=max_blength; proc_size_setup; proc_skeleton(0); proc_scaling; fi
@@ -692,9 +651,7 @@ def MC(text t)=
if addA[i]<>0:
tempc:=char(addA[i]);
if tempc="+": chargeA[i]:=1; ef tempc="-": chargeA[i]:=-1; else: chargeA[i]:=0; fi
- else: chargeA[i]:=0;
- fi
- endfor
+ else: chargeA[i]:=0; fi endfor
%===============================================================================================
if scan_bit(sw_output,Fig):
%-draw atom-----------------------------------------------------------------------------------
@@ -702,10 +659,7 @@ def MC(text t)=
%-draw add to atom----------------------------------------------------------------------------
if (not scan_bit(sw_numbering,Atom))and(not scan_bit(sw_numbering,Bond)):
for i=1 upto cntA:
- if addA[i]<>0:
- nA:=angX[i]+add_rot[i]; nC:=nA mod 90;
- if strA[i]=0: nB:=.5atom_wd; else: nB:=atom_wd; fi
- draw_char(char(addA[i]),sfrt(posA[i],nB,nA)); fi
+ if addA[i]<>0: draw_char(char(addA[i]),sfrt(posA[i],atom_wd,angX[i]+add_rot[i])); fi
endfor
fi
%-draw bond-----------------------------------------------------------------------------------
@@ -772,9 +726,8 @@ def add_group=
enddef;
%-------------------------------------------------------------------------------------------------
def store_group(expr a,b)=
- group_com[group_num][incr group_cnt[group_num]]:=a;
- group_par[group_num][group_cnt[group_num]]:=b;
-enddef;
+ group_com[group_num][incr group_cnt[group_num]]:=a;
+ group_par[group_num][group_cnt[group_num]]:=b; enddef;
%=================================================================================================
def read_group(expr a)(expr n)=
save_group_cnt:=group_num; save_cntD:=parts_cnt[a];
@@ -785,25 +738,21 @@ def read_group(expr a)(expr n)=
endfor
endfor
proc_bond_atom(a)(save_cntD+1);
- if group_num>save_group_cnt: read_group(a)(save_group_cnt+1); fi
-enddef;
+ if group_num>save_group_cnt: read_group(a)(save_group_cnt+1); fi enddef;
%=================================================================================================
def draw_frame(expr p,x,y,n)=
- draw ((0,0)--(x,0)--(x,y)--(0,y)--cycle) shifted p withpen pensquare scaled n;
-enddef;
+ draw ((0,0)--(x,0)--(x,y)--(0,y)--cycle) shifted p withpen pensquare scaled n; enddef;
%-------------------------------------------------------------------------------------------------
def draw_corner(expr p,x,y,n)=
draw(0,0) shifted p wpcs n; draw(x,0) shifted p wpcs n;
- draw(x,y) shifted p wpcs n; draw(0,y) shifted p wpcs n;
-enddef;
+ draw(x,y) shifted p wpcs n; draw(0,y) shifted p wpcs n; enddef;
%-------------------------------------------------------------------------------------------------
def proc_size_setup=
atom_wd:= blen*ratio_atom_bond+offset_atom;
wedge_wd:= blen*ratio_wedge_bond+offset_wedge;
hash_gap:= blen*ratio_hashgap_bond+offset_hash_gap;
bondgap:= blen*ratio_bondgap_bond+offset_bond_gap;
- bond_pen_wd:= blen*ratio_thickness_bond+offset_thickness;
-enddef;
+ bond_pen_wd:= blen*ratio_thickness_bond+offset_thickness; enddef;
%-------------------------------------------------------------------------------------------------
def proc_scaling=
minX:=minY:=4095; maxX:=maxY:=-4095;
@@ -858,7 +807,7 @@ def proc_bond_atom(expr a)(expr n)=
ef nC=_chg_atom: strA[getA(adrT)]:=parts_par[nP][1];
ef nC=_chg_len: if nP=_ring_len: bondL:=ringL; else: bondL:=nP; fi
ef nC=_get_len: if nP=_tmp_len: if bondL=rate_cr: bondL:=lenT; fi
- ef nP=_ring_len:
+ ef nP=_ring_len:
if lenT<>rate_cr: bondL:=lenT; else: if bondL<0: bondL:=1; fi fi
else: ringL:=lenB[getB(nP)]; fi
ef nC=_tmp_len: lenT:=nP;
@@ -886,12 +835,10 @@ def add_atom(expr n)=
addA[cntA]:=addAT; addAT:=temp_strA:=add_rot[cntA]:=0;
if rotT<>0: add_rot[cntA]:=rotT; rotT:=0; fi
else: f_bra:=0; fi
- if n=0: eB[cntB]:=cntA+1; f_term:=0; else: eB[cntB]:=n; f_term:=1; fi
-enddef;
+ if n=0: eB[cntB]:=cntA+1; f_term:=0; else: eB[cntB]:=n; f_term:=1; fi enddef;
%-------------------------------------------------------------------------------------------------
def check_adrA(expr n)=
- if (n>iif(f_term=0,cntA+1,cntA))or(n<=0): errmessage("cntA=[ "&decimal(n)&" ]"); fi
-enddef;
+ if (n>iif(f_term=0,cntA+1,cntA))or(n<=0): errmessage("cntA=[ "&decimal(n)&" ]"); fi enddef;
def check_adrB(expr n)= if (n>cntB)or(n<=0): errmessage("cntB=[ "&decimal(n)&" ]"); fi enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def proc_skeleton(expr n)=
@@ -927,7 +874,7 @@ enddef;
def add_bond(expr n,f)=
if n=_arrange_ang: nA:=arrange_ang(angT mod 360); else: nA:=n; fi
if f_bra=0:
- adrT:=cntA:=cntA+1; posA[cntA]:=posBs; angA[cntA]:=angT;
+ adrT:=incr cntA; posA[cntA]:=posBs; angA[cntA]:=angT;
angX[cntA]:=(angT+nA/2+iif(nA>=0,-90,90)) mod 360;
else: f_bra:=0; fi
cntB:=cntB+1;
@@ -957,16 +904,13 @@ vardef getB(expr n)= if n>=0: markB+n ef n>=-999: cntB+n+1 else: n+4095 fi endde
%-------------------------------------------------------------------------------------------------
def termA=
if f_term=0:
- if f_bra=0:
- strA[incr cntA]:=temp_strA; addA[cntA]:=addAT; add_rot[cntA]:=rotT;
- addAT:=temp_strA:=rotT:=0;
+ if f_bra=0: strA[incr cntA]:=temp_strA; addA[cntA]:=addAT; add_rot[cntA]:=rotT;
+ addAT:=temp_strA:=rotT:=0;
else: f_bra:=0; fi
f_term:=1; fi
enddef;
%-------------------------------------------------------------------------------------------------
-def termB=
- if f_term=0: if f_bra=0: angX[incr cntA]:=angT mod 360; else:f_bra:=0; fi f_term:=1; fi
-enddef;
+def termB= if f_term=0: if f_bra=0: angX[incr cntA]:=angT; else:f_bra:=0; fi f_term:=1; fi enddef;
%-------------------------------------------------------------------------------------------------
vardef glu_atom(expr n)=
if strA[n]<>0: nE:=angT mod 90; nF:=0.5atom_wd; (iif(nE<45,sind nE,cosd nE)*nF)++nF else: 0 fi
@@ -977,17 +921,16 @@ def draw_atom(expr n)=
temps:=str_tbl[strA[n]]; slen:=length(temps); nC:=nS:=0; raise_pos:=(0,0); tpos:=posA[n];
if (angX[n]<=90)or(angX[n]>=270): sdir:=1; else: sdir:=-1; fi
for i=1 upto slen:
- if nC=0:
- tempc:=subc(i,temps);
+ if nC=0: tempc:=subc(i,temps);
if (sdir=-1)and(tempc="{"):
- nD:=i; nC:=0; for j=nD upto slen: nC:=nC+1; exitif subc(j,temps)="}"; endfor fi
- else: nC:=nC-1; tempc:=subc(nD+nC,temps); fi
+ nD:=i; nC:=0; for j=nD upto slen: nC:=nC+1; exitif subc(j+1,temps)="}"; endfor fi
+ else: nC:=nC-1; tempc:=subc(nD+nC,temps); fi
if tempc="_": raise_pos:=iif(raise_pos=(0,0),(0,-.5atom_wd),(0,0));
ef tempc="^": raise_pos:=iif(raise_pos=(0,0),(0, .5atom_wd),(0,0));
ef (tempc<>"{")and(tempc<>"}"):
nS:=nS+1; char_wd:=atom_wd*tbl_char_wd[ASCII(tempc)]; char_ht:=atom_wd;
if nS=1: if (sdir=-1)and(char_wd<atom_wd): tpos:=tpos+((atom_wd-char_wd)/2,0); fi
- else: tpos:=tpos+(.5char_wd*sdir,0); fi
+ else: tpos:=tpos+(.5char_wd*sdir,0); fi
tcol:=colorA[n]; f_col:=0;
if known tcol: if tcol<>0: drawoptions(withcolor color_list[tcol]); f_col:=1; fi fi
if atomfont="draw": draw_char(tempc,tpos+raise_pos); else: label(tempc,tpos+raise_pos); fi
@@ -1078,16 +1021,12 @@ def wz_put(expr a,b,c)=
for i=0 upto lenL/hash_gap:
nA:=hash_gap*i/lenL; nD:=(hash_gap*i+ratio_hash_black*hash_gap)/lenL;
if nD>((lenL-hash_gap)/lenL): nD:=1; fi
- fill nA[b,a]--nA[c,a]--nD[c,a]--nD[b,a]--cycle;
- endfor
-enddef;
+ fill nA[b,a]--nA[c,a]--nD[c,a]--nD[b,a]--cycle; endfor enddef;
%------------------------------------------------------------------------------------------------
def bz_put(expr a,b,c,d)=
- for i=0 upto lenL/hash_gap:
+ for i=0 upto lenL/hash_gap:
nA:=hash_gap*i/lenL; nD:=(hash_gap*i+ratio_hash_black*hash_gap)/lenL;
- fill nA[b,a]--nA[d,c]--nD[d,c]--nD[b,a]--cycle;
- endfor
-enddef;
+ fill nA[b,a]--nA[d,c]--nD[d,c]--nD[b,a]--cycle; endfor enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def char_size_set(expr w,h)(expr s)=
for j=1 upto length(s): nN:=ASCII(subc(j,s)); tbl_char_wd[nN]:=w; tbl_char_ht[nN]:=h; endfor
@@ -1148,9 +1087,8 @@ def draw_char(expr s,p)=
ef s="-": dwh Z_m--Z_o;
ef s="+": dwv Z_x--Z_s; dwh Z_m--Z_o;
ef s="A": dwvs(1.14)Z_b--Z_f--Z_e; dw .33[Z_b,Z_f]--.33[Z_e,Z_f];
- ef s="B": dw Z_r--Z_s{right}..(.9fH,.75aH)..{left}Z_y--Z_m--Z_y{right}..
- (.9fH,qH)..{left}Z_x--Z_c;
- dwv Z_b--Z_w;
+ ef s="B": dw Z_r--Z_s{right}..(.9fH,.75aH)..{left}Z_y--Z_m--Z_y{right}..(.9fH,qH)..
+ {left}Z_x--Z_c; dwv Z_b--Z_w;
ef s="D": dw Z_r--Z_s..Z_o..Z_x--Z_c; dwv Z_b--Z_w;
ef s="E": pickup pensquare scaled fP; dw Z_z--Z_c--Z_r--Z_n; dw Z_m--Z_o;
ef s="G": cdw sbp(.06,.97)circ_O; dwh bot Z_y-- bot Z_v;
@@ -1211,8 +1149,7 @@ def warning_bond(expr a)=
warning("A"&decimal(a)&" ( "&fsl(8)(str_tbl[strA[a]])&") has"&fdr(2)(bond_cntA)&" bonds"); fi
enddef;
%-------------------------------------------------------------------------------------------------
-vardef erase_brace(expr s)=
- sS:="";
+vardef erase_brace(expr s)= sS:="";
if (length(s)>=4)and(s<>"COOH"):
for i=1 upto length(s):
sC:=subc(i,s);
@@ -1221,17 +1158,15 @@ vardef erase_brace(expr s)=
else: s fi
enddef;
%-------------------------------------------------------------------------------------------------
-vardef erase_space(expr t)=
- sS:=""; for i=1 upto length(t): sC:=subc(i,t); if sC=" ": sS:=sS&"_"; else: sS:=sS&sC; fi endfor
- sS
+vardef erase_space(expr t)= sS:="";
+ for i=1 upto length(t): sC:=subc(i,t); if sC=" ": sS:=sS&"_"; else: sS:=sS&sC; fi endfor sS
enddef;
%=================================================================================================
def proc_calc(expr n)=
num_MW:=num_MI:=tbl_atom_max:=warning_cnt:=hideH_cnt:=0; nE:=parts_emb_start;
for i=1 upto tbl_atom_end: sumA[i]:=0; endfor
for i=1 upto cntA:
- knownA:=bond_cntA:=0;
- nS:=strA[i];
+ knownA:=bond_cntA:=0; nS:=strA[i];
for j=1 upto cntB:
bond_num[j]:=bond_type(lineB[j]);
if (sB[j]=i)or(eB[j]=i): bond_cntA:=bond_cntA+bond_num[j]; fi
@@ -1266,8 +1201,7 @@ def proc_calc(expr n)=
knownA:=1; fi
exitif knownA=1;
endfor
- if knownA=0: warning(" Unknown Str("&str_tbl[strA[i]]&") is used "&decimal(i)); fi
- endfor
+ if knownA=0: warning(" Unknown Str("&str_tbl[strA[i]]&") is used "&decimal(i)); fi endfor
%-------------------------------------------------------------------------------------
sumA[2]:=sumA[2]+hideH_cnt;
if (tbl_atom_max=1)and(sumA[2]>0): tbl_atom_max:=2; fi
@@ -1312,35 +1246,35 @@ def proc_report_out(expr f)=
message "["&decimal(fig_num)&"]:"&inf_EN;
if f=1: file_output:="temp-report.aux"; else: file_output:=jobname&"-report.txt"; fi
printf "===========================================================================";
- printf " No."&fdr(4)(fig_num)&" / Name = "& inf_EN&" / file = "& file_input;
+ printf " No["&decimal(fig_num)&"],Name<"& inf_EN&">,Category<"&inf_Cat&">,File<"&file_input&">";
if mc_row>=1:
printf "---------------------------------------------------------------------------";
for i=1 upto mc_row: printf (substring(0,mc_indent[i]) of blanks)&mc[i]; endfor
printf "---------------------------------------------------------------------------";
- printf " row="&fdr(3)(mc_row)&" , length="&fdr(4)(length(mc))&
- " , commands="&fdr(3)(cnt_cmm);
- printf " {}=X["&decimal(cnt_chgB)&"],{}:X["&decimal(cnt_chgA)&
- "],'()["&decimal(cnt_inline_def)&"],@["&decimal(cnt_at)&
- "],&["&decimal(cnt_and)&"],<["&decimal(cnt_gtn)&"],=["&decimal(cnt_equ)&
+ printf " Row["&decimal(mc_row)&"],Length["&decimal(length(mc))&"],Commands["&decimal(cnt_cmm)&
+ "],&Code["&decimal(parts_cnt[0])&"],Warning["&decimal(warning_cnt)&"]";
+ printf "---------------------------------------------------------------------------";
+ printf " =["&decimal(cnt_equ)&"]({}=["&decimal(cnt_chgB)&"]), :["&decimal(cnt_cln)&
+ "]({}:["&decimal(cnt_chgA)&"]), '()["&decimal(cnt_inline_def)&"]";
+ printf " @["&decimal(cnt_at)&"],&["&decimal(cnt_and)&"],<["&decimal(cnt_gtn)&
+ "],~["&decimal(cnt_tld)&"],^["&decimal(cnt_hat)&"],`["&decimal(cnt_bqt)&
+ "],>["&decimal(cnt_ltn)&
"],|["&decimal(cnt_bar-cnt_bars)&"],||["&decimal(cnt_bars)&
- "],#["&decimal(cnt_hsh-cnt_hshs)&"],##["&decimal(cnt_hshs)&"]";
- fi
+ "],#["&decimal(cnt_hsh-cnt_hshs)&"],##["&decimal(cnt_hshs)&"]"; fi
printf "---------------------------------------------------------------------------";
- printf " Warnings = "&fdr(3)(warning_cnt)&" / Code= "&decimal(parts_cnt[0]);
- printf " Width * Height = " & fdr(10)(mol_wd)&" * "&fdr(10)(mol_ht);
- printf " Shift width * height = "& fdr(10)(minX)&" * "&fdr(10)(minY);
- printf " Bond length = "&fdr(3)(blen)&" Atom size = "&fdr(3)(atom_wd);
- printf " Atom count="&fdr(3)(cntA)&" Bond count="&fdr(3)(cntB)&
- " Ring count="&fdr(3)(cntB-cntA+1)&" Hide H count="&fdr(3)(hideH_cnt);
+ printf " Width["&decimal(mol_wd)&"],Height["&decimal(mol_ht)&"],"&
+ " Shift x["& decimal(minX)&"],Shift y["&decimal(minY)&"]";
+ printf " Bond length["&decimal(blen)&"],Atom size["&decimal(atom_wd)&"]";
printf "---------------------------------------------------------------------------";
+ printf " Atom["&decimal(cntA)&"],Bond["&decimal(cntB)&
+ "],Ring["&decimal(cntB-cntA+1)&"],Hide H["&decimal(hideH_cnt)&"]";
printf "< NO. ><atom(s) >( x axis , y axis )<bond><hideH><chg>";
for i=1 upto cntA:
printf " A"&fdl(6)(i)&fsl(8)(erase_brace(str_tbl[strA[i]]))&
" ("&fdr(10)(round(xpart(posA[i])/blen))&" , "&
fdr(10)(round(ypart(posA[i])/blen))&" ) "&fdr(4)(Bcnt[i])&
iif(hideH[i]>0,fdr(6)(hideH[i])," ")
- if chargeA[i]<>0: &fdr(4)(chargeA[i]) fi;
- endfor
+ if chargeA[i]<>0: &fdr(4)(chargeA[i]) fi; endfor
printf "---------------------------------------------------------------------------";
printf "< NO. >< bond (sdt)><angle +( +- )><length ( pt )>";
for i=1 upto cntB:
@@ -1348,8 +1282,7 @@ def proc_report_out(expr f)=
nB:=angB[i]; if nB>180: nB:=nB-360; fi
printf " B"&fdl(4)(i)&fdr(3)(sB[i])&" -> "&fdr(3)(eB[i])&
" ("&fdr(3)(bond_num[i])&")"&fdr(8)(round(angB[i]))&
- " ("&fdr(6)(round(nB))&")"&fdr(8)(nC)&" ("&fdr(8)(round(nC*blen))&")";
- endfor
+ " ("&fdr(6)(round(nB))&")"&fdr(8)(nC)&" ("&fdr(8)(round(nC*blen))&")"; endfor
printf "---------------------------------------------------------------------------";
printf "<atom>( atom wt )[ mi wt ] < cnt > < sum wt >[ sum mi wt ]";
for i=1 upto tbl_atom_max:
@@ -1403,32 +1336,29 @@ def proc_mol_out(expr n)=
" "&decimal(sB[i])&" "&decimal(eB[i])
if bond_stereo(lineB[i])<>0: &" CFG="&decimal(bond_config(lineB[i])) fi; fi
endfor
- printf "M V30 END BOND"; printf "M V30 END CTAB"; printf "M END";
- fi
+ printf "M V30 END BOND"; printf "M V30 END CTAB"; printf "M END"; fi
enddef;
%=================================================================================================
def proc_mc_out(expr f)=
message "["&decimal(fig_num)&"]:"&inf_EN;
file_output:="temp-mc.aux";
if mc_length<100:
- nN:=split_comma(mc); nL:=length(mc); nA:=0;
+ nN:=scan_chars(mc,","); nL:=length(mc); nA:=0;
forever:
for i=nN downto 1:
- if at_comma[i]<=nA+mc_length:
- printf substring(nA,at_comma[i]) of mc; nA:=at_comma[i]; exitif true; fi
+ if at_char[i]<=nA+mc_length:
+ printf substring(nA,at_char[i]) of mc; nA:=at_char[i]; exitif true; fi
endfor
if nL-nA<=mc_length: printf substring(nA,nL) of mc; exitif true; fi
endfor
else:
- for i=1 upto mc_row: printf (substring(0,mc_indent[i]) of blanks)&mc[i]; endfor
- fi
+ for i=1 upto mc_row: printf (substring(0,mc_indent[i]) of blanks)&mc[i]; endfor fi
printf EOF;
enddef;
%=================================================================================================
vardef fit_zero(expr n)= if n<=9: "00" ef n<=99: "0" else: "" fi &decimal(n) enddef;
vardef bond_type(expr n)=
- if (n>=dl)and(n<=dm_):2 ef n=tm:3 ef (n=0)or(n=vf)or(n=vb): 0 else: 1 fi
-enddef;
+ if (n>=dl)and(n<=dm_):2 ef n=tm:3 ef (n=0)or(n=vf)or(n=vb): 0 else: 1 fi enddef;
vardef bond_charge(expr n)= if n=2: 1 ef n=1: 3 ef n=-1: 5 ef n=-2: 6 else: 0 fi enddef;
vardef bond_stereo(expr n)=
if (n=wf)or(n=zb)or(n=bd): 1 ef (n=zf)or(n=wb)or(n=dt): 6 ef n=wv: 4 else: 0 fi enddef;
@@ -1439,16 +1369,13 @@ vardef STa(expr s,WT,MI)=
str_cnt:=str_cnt+1; tbl_cnt:=tbl_cnt+1; parts_num:=parts_num+1;
parts_com[parts_num][1]:=_set_atom; parts_par[parts_num][1]:=str_cnt; parts_cnt[parts_num]:=1;
str_tbl[str_cnt]:=tbl_atom_str[tbl_cnt]:=s; tbl_atom[tbl_cnt]:=0;
- tbl_atom_wt[tbl_cnt]:=WT; tbl_atom_mi[tbl_cnt]:=MI;
- parts_num
-enddef;
+ tbl_atom_wt[tbl_cnt]:=WT; tbl_atom_mi[tbl_cnt]:=MI; parts_num enddef;
%-------------------------------------------------------------------------------------------------
vardef STb(expr s)(text t)=
str_cnt:=str_cnt+1; tbl_cnt:=tbl_cnt+1; parts_num:=parts_num+1;
parts_com[parts_num][1]:=_set_atom; parts_par[parts_num][1]:=str_cnt; parts_cnt[parts_num]:=1;
str_tbl[str_cnt]:=tbl_atom_str[tbl_cnt]:=s; tbl_atom[tbl_cnt]:=0;
- for list=t: tbl_group[tbl_cnt][incr tbl_atom[tbl_cnt]]:=list-parts_emb_start; endfor
- parts_num
+ for list=t: tbl_group[tbl_cnt][incr tbl_atom[tbl_cnt]]:=list-parts_emb_start; endfor parts_num
enddef;
%=================================================================================================
parts_int:=parts_emi_start; parts_num:=parts_emb_start;
@@ -1477,9 +1404,9 @@ W:= STa("W", 183.85, 181.948225); Zn:=STa("{Zn}",65.409, 63.929142
tbl_atom_end:=tbl_cnt;
%-------------------------------------------------------------------------------------------------
CH3:=STb("C{H_3_}")(C,H,H,H); CH2:=STb("C{H_3_}")(C,H,H); CN:=STb("CN")(C,N); OH:=STb("OH")(O,H);
-COOH:=STb("COOH")(C,O,O,H); SH:= STb("SH")(S,H); CHO:=STb("CHO")(C,H,O);
+COOH:=STb("COOH")(C,O,O,H); COONa:=STb("COO{Na}")(C,O,O,Na); CHO:=STb("CHO")(C,H,O);
NO:=STb("NO")(N,O); NO2:=STb("N{O_2_}")(N,O,O); NH2:=STb("N{H_2_}")(N,H,H);
-SO2H:=STb("S{O_2_}H")(S,O,O,H); SO3H:=STb("S{O_3_}H")(S,O,O,O,H);
+SH:= STb("SH")(S,H); SO2H:=STb("S{O_2_}H")(S,O,O,H); SO3H:=STb("S{O_3_}H")(S,O,O,O,H);
ONa:=STb("O{Na}")(O,Na); SO3Na:=STb("S{O_3_}{Na}")(S,O,O,O,Na);
%-------------------------------------------------------------------------------------------------
tbl_group_end:=tbl_cnt; parts_atom_end:=parts_num;
@@ -1492,8 +1419,7 @@ for i=5,6,7,8: for j=11 upto 15: ?[i][j]:='(); endfor endfor
%-------------------------------------------------------------------------------------------------
!:=!1:='((_mk_bond,_arrange_ang)); !!:='(!~db); !!!:='(!~tm);
for i==2 upto 20:
- ![i]:='((_com,_len_ss),(_get_len,_tmp_len),! for j==2 upto i::,! endfor ,(_com,_len_ee));
-endfor
+ ![i]:='((_com,_len_ss),(_get_len,_tmp_len),! for j==2 upto i::,! endfor ,(_com,_len_ee)); endfor
Me:='(); Et:='(!); iPr:=?!:='(/_,!); ?!2:='(/_,!2); tBu:=??!:='(/_,/_^60,60);
!?:='(!,/_); !?!:='(!,/_,!); n_:='((_set_add,a_minus)); p_:='((_set_add,a_plus));
zero_wf:='(0~wf); zero_zf:='(0~zf); zero_dm:='(0~dm); zero_wv:='(0~wv);
@@ -1541,8 +1467,7 @@ init_par(parameter_list);
def expand_set=
CH3:=xCH3; NH:=xNH; NH2:=xNH2; NO:=xNO; NO2:=xNO2; OH:=xOH; CHO:=xCHO; COOH:=xCOOH; CN:=xCN;
SH:=xSH; SO2H:=xSO2H; SO3H:=xSO3H; !SH:=!xSH;
- !CH3:=!xCH3; !OH:=!xOH; !NH2:=!xNH2; !CHO:=!xCHO; !COOH:=!xCOOH; !CN:=!xCN; !NO2:=!xNO2;
-enddef;
+ !CH3:=!xCH3; !OH:=!xOH; !NH2:=!xNH2; !CHO:=!xCHO; !COOH:=!xCOOH; !CN:=!xCN; !NO2:=!xNO2; enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vardef mc_check(expr s)=
save mc_char,err_cnt,char_cnt,f_depth,cnt_prn_s,cnt_prn_e,cnt_brc_s,cnt_brc_e,cnt_brk_s,
@@ -1556,13 +1481,12 @@ vardef mc_check(expr s)=
%---------------------------------------------------------------------------------------------
if mc_row>=1:
for i=1 upto length(s):
- tempc:=subc(i,s); if tempc<>" ": mc_char[incr char_cnt]:=ASCII(tempc); fi
- endfor
+ tempc:=subc(i,s); if tempc<>" ": mc_char[incr char_cnt]:=ASCII(tempc); fi endfor
mc_char[0]:=mc_char[char_cnt+1]:=mc_char[char_cnt+2]:=a_cmm;
%-- argument missing chkeck --------------------------------------------------------------
cnt_prn_s:=cnt_prn_e:=cnt_brc_s:=cnt_brc_e:=cnt_brk_s:=cnt_brk_e:=cnt_inline_def:=0;
- cnt_at:=cnt_cmm:=cnt_and:=cnt_gtn:=cnt_equ:=cnt_cln:=cnt_bar:=cnt_bars:=0;
- cnt_hsh:=cnt_hshs:=f_depth:=nA:=0;
+ cnt_at:=cnt_cmm:=cnt_and:=cnt_gtn:=cnt_equ:=cnt_cln:=cnt_bar:=cnt_bars:=cnt_tld:=cnt_hat:=0;
+ cnt_bqt:=cnt_ltn:=cnt_hsh:=cnt_hshs:=f_depth:=nA:=0;
forever:
nA:=nA+1; nB:=mc_char[nA-1]; nC:=mc_char[nA]; nD:=mc_char[nA+1];
if nC=a_cmm: if f_depth=0: cmm_adr[incr cnt_cmm]:=nA; fi
@@ -1587,10 +1511,14 @@ vardef mc_check(expr s)=
ef nC=a_and: cnt_and:=cnt_and+1;
if nD= a_cmm: proc_err(7,nA) fi if nB<>a_cmm: proc_err(8,nA) fi % a & x
ef nC=a_gtn: cnt_gtn:=cnt_gtn+1;
- ef nC=a_ltn: if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x > x
- ef nC=a_tld: if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x ~ x
- ef nC=a_hat: if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x ^ x
- ef nC=a_bqt: if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x ` x
+ ef nC=a_ltn: cnt_ltn:=cnt_ltn+1;
+ if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x > x
+ ef nC=a_tld: cnt_tld:=cnt_tld+1;
+ if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x ~ x
+ ef nC=a_hat: cnt_hat:=cnt_hat+1;
+ if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x ^ x
+ ef nC=a_bqt: cnt_bqt:=cnt_bqt+1;
+ if nD= a_cmm: proc_err(7,nA) fi if nB= a_cmm: proc_err(7,nA) fi % x ` x
ef nC=a_bar: cnt_bar:=cnt_bar+1; % |+||
if nD= a_bar: cnt_bars:=cnt_bars+1; if mc_char[nA+2]=a_bar: nA:=nA+1; % ||
ef mc_char[nA+2]<>a_cmm: proc_err(8,nA) fi % | a
@@ -1611,8 +1539,7 @@ vardef mc_check(expr s)=
if cnt_prn_s>cnt_prn_e: proc_err(1,0) ef cnt_prn_s<cnt_prn_e: proc_err(2,0) fi
if cnt_brc_s>cnt_brc_e: proc_err(3,0) ef cnt_brc_s<cnt_brc_e: proc_err(4,0) fi
if cnt_brk_s>cnt_brk_e: proc_err(5,0) ef cnt_brk_s<cnt_brk_e: proc_err(6,0) fi
- else: proc_err(0,0)
- fi
+ else: proc_err(0,0) fi
%---------------------------------------------------------------------------------------------
for i=1 upto err_cnt:
message "*"&fdr(3)(i)&" "&err_type[err_code[i]]&fdr(4)(err_adr[i])&" '"&err_str[i]&"'";
@@ -1622,16 +1549,15 @@ vardef mc_check(expr s)=
enddef;
%-------------------------------------------------------------------------------------------------
def proc_err(expr e,n)= err_adr[incr err_cnt]:=n; err_code[err_cnt]:=e;
- if e<=6: err_str[err_cnt]:=" "; else: err_str[err_cnt]:=substring(n-3,n+2) of mc; fi
-enddef;
+ if e<=6: err_str[err_cnt]:=" "; else: err_str[err_cnt]:=substring(n-3,n+2) of mc; fi enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def mc_query(text s)=
begingroup
save f_mcf,f_line,unit_row,unit_cnt,line_s,row_cnt,semic_cnt,info_cnt,order,min_n,key_cnt,
info_s,sign_at,sign_n,filter_n,filter_tag,filter_var,filter_sign,filter_cnt,filter_p,
- at_semic,at_colon,at_equal,at_less,at_greater,at_n,sort_all,key_s,sort_s;
+ at_char,at_colon,at_equal,at_less,at_greater,at_n,sort_all,key_s,sort_s;
string line_s[][],sort_s[],sort_all[],key_s[],filter_tag[],filter_var[],info_s[];
- numeric row_cnt[],order[],order_tbl[],filter_sign[],filter_p[],at_semic[];
+ numeric row_cnt[],order[],order_tbl[],filter_sign[],filter_p[],at_char[];
unit_row:=f_mcf:=mc_row:=info_cnt:=key_cnt:=filter_cnt:=0; unit_cnt:=1;
file_input:=default_library; file_output:=default_temp_file;
%-----------------------------------------------------------------------------------------------
@@ -1655,8 +1581,7 @@ def mc_query(text s)=
else:
filter_tag[incr filter_cnt]:=sT; filter_sign[filter_cnt]:=sign_n;
if (sign_n>=3)and(is_num(sV)=1): filter_var[filter_cnt]:=fix_num(sV);
- else: filter_var[filter_cnt]:=sV; fi
- fi
+ else: filter_var[filter_cnt]:=sV; fi fi
endfor
%-----------------------------------------------------------------------------------------------
forever:
@@ -1682,28 +1607,19 @@ def mc_query(text s)=
ef filter_sign[j]=3: if not(temps< filter_var[j]): filter_n:=0; fi
ef filter_sign[j]=4: if not(temps> filter_var[j]): filter_n:=0; fi
ef filter_sign[j]=5: if not(temps<=filter_var[j]): filter_n:=0; fi
- ef filter_sign[j]=6: if not(temps>=filter_var[j]): filter_n:=0; fi fi
- fi
- endfor
+ ef filter_sign[j]=6: if not(temps>=filter_var[j]): filter_n:=0; fi fi fi endfor
endfor
for i=1 upto filter_cnt: if filter_p[i]=0: filter_n:=0; fi endfor
sort_all[unit_cnt]:="";
for j=1 upto key_cnt:
if j=key_cnt: sort_all[unit_cnt]:=sort_all[unit_cnt]&sort_s[j];
- else: sort_all[unit_cnt]:=fix_str(15,sort_s[1]); fi
- endfor
+ else: sort_all[unit_cnt]:=fix_str(15,sort_s[1]); fi endfor
info_cnt:=0; if filter_n=1: unit_cnt:=unit_cnt+1; fi
ef subc(1,temps)="+": f_mcf:=1; mc_row:=1;
ef subc(1,temps)<>"%":
if f_mcf=1: mc_row:=mc_row+1;
else:
- semic_cnt:=split_semic(temps);
- for i=1 upto semic_cnt+1:
- info_cnt:=info_cnt+1;
- if i<=semic_cnt: info_s[info_cnt]:=substring(at_semic[i-1],at_semic[i]-1) of temps;
- else: info_s[info_cnt]:=substring(at_semic[semic_cnt],length(temps)) of temps; fi
- endfor
- fi
+ info_cnt:=split_char(temps,";")+1; for i=1 upto info_cnt: info_s[i]:=arg_s[i]; endfor fi
fi
fi
endfor
@@ -1720,33 +1636,37 @@ def mc_query(text s)=
for i=1 upto unit_cnt:
for j=1 upto row_cnt[order_tbl[i]]: printf line_s[order_tbl[i]][j]; endfor
endfor
- else: for i=1 upto unit_cnt: for j=1 upto row_cnt[i]: printf line_s[i][j]; endfor endfor
- fi
+ else: for i=1 upto unit_cnt: for j=1 upto row_cnt[i]: printf line_s[i][j]; endfor endfor fi
closefrom file_input; closefrom file_output;
endgroup;
enddef;
%=============================================================================================
vardef fix_str(expr n,s)=
if length(s)<n: sS:=s&substring(0,n-length(s)) of blanks;
- ef length(s)>n: sS:=substring(0,n) of s; fi sS
-enddef;
+ ef length(s)>n: sS:=substring(0,n) of s; fi sS enddef;
%-------------------------------------------------------------------------------------------------
vardef fix_num(expr s)=
sS:=s; nN:=scan_char(".",sS,0,1);
if nN=0: sS:=fsr(4)(sS); ef nN=1: sS:=" 0"&sS;
- ef nN=2: sS:=" "&sS; ef nN=3: sS:=" "&sS; ef nN=4: sS:=" "&sS; fi sS
-enddef;
+ ef nN=2: sS:=" "&sS; ef nN=3: sS:=" "&sS; ef nN=4: sS:=" "&sS; fi sS enddef;
%-------------------------------------------------------------------------------------------------
vardef is_num(expr s)=
for i=1 upto length(s):
if ((subc(i,s)>="0")and(subc(i,s)<="9"))or(subc(i,s)="."): nN:=1; else: nN:=0; fi endfor nN
enddef;
-%-------------------------------------------------------------------------------------------------
-vardef split_semic(expr s)=
- nN:=at_semic[0]:=0; for i=1 upto length(s): if subc(i,s)=";": at_semic[incr nN]:=i; fi endfor nN
+%--------------------------------------------------------------------------------------------------
+vardef scan_bit(expr n,b)= if b>=1: odd(floor(n/b)) else: odd(floor((frac n)/b)) fi enddef;
+%--------------------------------------------------------------------------------------------------
+vardef scan_char(expr c,s,d,n)=
+ nN:=0; if d=0: for i=n upto length(s): if subc(i,s)=c: nN:=i; fi exitif nN>0; endfor
+ ef d=1: for i=n upto length(s): if subc(i,s)<>c: nN:=i; fi exitif nN>0; endfor
+ ef d=-1: for i=length(s) downto n: if subc(i,s)<>c: nN:=i; fi exitif nN>0; endfor fi nN
enddef;
%-------------------------------------------------------------------------------------------------
-vardef split_comma(expr s)=
- nN:=at_comma[0]:=0; for i=1 upto length(s): if subc(i,s)=",": at_comma[incr nN]:=i; fi endfor nN
-enddef;
+vardef scan_chars(expr s,c)=
+ nN:=0; for i=1 upto length(s): if subc(i,s)=c: at_char[incr nN]:=i; fi endfor nN enddef;
+%-------------------------------------------------------------------------------------------------
+vardef split_char(expr s,c)=
+ nN:=scan_chars(s,c); at_char[nN+1]:=length(s)+1;
+ for i=1 upto nN+1: arg_s[i]:=substring(at_char[i-1],at_char[i]-1) of s; endfor nN enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/graphics/mcf2graph/mcf_exa_code.pdf b/graphics/mcf2graph/mcf_exa_code.pdf
index 59e94dd93e..51743be2c8 100644
--- a/graphics/mcf2graph/mcf_exa_code.pdf
+++ b/graphics/mcf2graph/mcf_exa_code.pdf
Binary files differ
diff --git a/graphics/mcf2graph/mcf_exa_code.tex b/graphics/mcf2graph/mcf_exa_code.tex
index b7d3807fe6..1be25c7aba 100644
--- a/graphics/mcf2graph/mcf_exa_code.tex
+++ b/graphics/mcf2graph/mcf_exa_code.tex
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Print out mcf data list by A.Yamaji 2022.03.27
+% Print out mcf data list by A.Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% ** mcf2graph.mf must be version 4.83
+% ** mcf2graph.mf must be version 4.84
% ** use mcf_library.mcf
% ** typeset by LuaLaTeX(luamplib)
\documentclass{article}
@@ -17,6 +17,7 @@
outputformat:="eps";
sw_output:=Fig+Calc;
fsize:=(35mm,34mm);
+ fmargin:=(1mm,1mm);
max_blength:=4mm;
row_h:=3.8mm;
header_h:=3.8mm;
@@ -110,7 +111,6 @@
VerbatimTeX("\gdef\EOF{"&decimal(f_EOF)&"}");
\end{mplibcode}\vspace{-1.2pt}\\
%------------------------------------------------------------------------
-%%%%%%%\ifnum\fig@num=10 \CONT@false \fi%
\ifx\EOF\one \CONT@false \fi%
\message{[\the\fig@num:\EN]}%
\ifCONT@ \repeat%
diff --git a/graphics/mcf2graph/mcf_exa_soc.mp b/graphics/mcf2graph/mcf_exa_soc.mp
index b4144fd0ce..0c4b39380d 100644
--- a/graphics/mcf2graph/mcf_exa_soc.mp
+++ b/graphics/mcf2graph/mcf_exa_soc.mp
@@ -1,8 +1,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Molecular Coding Format by Akira Yamaji 2022.03.27
+% Molecular Coding Format by Akira Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-input mcf2graph; %%% it must be version 4.83
-message "* mcf_exa_soc 2022.03.27";
+input mcf2graph; %%% it must be version 4.84
+message "* mcf_exa_soc 2022.05.08";
message "";
%------------------------------------------------------------------------------
%%%%sw_frame:=Outside;
diff --git a/graphics/mcf2graph/mcf_example.pdf b/graphics/mcf2graph/mcf_example.pdf
index f14cc81259..9afd61cf8e 100644
--- a/graphics/mcf2graph/mcf_example.pdf
+++ b/graphics/mcf2graph/mcf_example.pdf
Binary files differ
diff --git a/graphics/mcf2graph/mcf_example.tex b/graphics/mcf2graph/mcf_example.tex
index c356799a8f..fee9b0ba5d 100644
--- a/graphics/mcf2graph/mcf_example.tex
+++ b/graphics/mcf2graph/mcf_example.tex
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Example of MCF Typeset with LuaLaTeX(luamplib) by A.Yamaji 2022.03.27
+% Example of MCF Typeset with LuaLaTeX(luamplib) by A.Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% ** mcf2graph.mf must be version 4.83
+% ** mcf2graph.mf must be version 4.84
% ** use mcf_library.mcf
% ** typeset by LuaLaTeX(luamplib)
\documentclass{article}
diff --git a/graphics/mcf2graph/mcf_library.mcf b/graphics/mcf2graph/mcf_library.mcf
index 2ea49f3b41..b23c8c6611 100644
--- a/graphics/mcf2graph/mcf_library.mcf
+++ b/graphics/mcf2graph/mcf_library.mcf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% molecular library file mcf_library.mcf by Akira Yamaji 2022.03.27
+% molecular library file mcf_library.mcf by Akira Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tag1:var1;tag2:var2;tag3:var3 .....
% first character of line "%" comment out
@@ -9,7 +9,7 @@
% Cat = Category
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
-% molecular data for mcf_example.tex EXA=1(155)
+% molecular data for mcf_example.tex EXA=1(155) EXA=2(7)
%-=============================================================================
Cat:biological;EN:Adenine;MW:135.13;EXA:1
+
@@ -384,6 +384,14 @@ Cat:biological;EN:Chlorophyll a;MW:893.509;EXA:1
@2,*\^-6,!2,//O,!,O,!2,!!,|,!13,{1,5,9,13}:/_
+------------------------------------------------------------------------------
%==============================================================================
+Cat:biological;EN:Apigenin;MW:270.24;EXA:-
++
+<30,Ph,3=?6,9=dl,10:O,7://O,@9,\,Ph,{2,6,14}:/OH
++------------------------------------------------------------------------------
+Cat:biological;EN:Luteolin;MW:286.24;EXA:-
++
+<30,Ph,3=?6,9=dl,10:O,7://O,@9,\,Ph,{2,6,14,15}:/OH
++------------------------------------------------------------------------------
Cat:biological;EN:Flavone;MW:222.24;EXA:1
+
<30,Ph,3=?6,9=dl,10:O,7://O,9:/Ph,
@@ -701,6 +709,15 @@ Cat:synthetic;EN:Melamine;MW:126.12;EXA:1
<30,Ph,{2,4,6}:N,{1,3,5}:/NH2
+------------------------------------------------------------------------------
%==============================================================================
+Cat:synthetic;EN:Tartrazine;MW:534.3;EXA:1
++
+<30,Ph,1:/SO3Na,@4,\,N,!!,N,!,<-12,?5,{-2,-5}=dl,{-2,-3}:N,-1:/COONa,-4:/OH,
+ @-3,-12,Ph,-3:/SO3Na
++------------------------------------------------------------------------------
+Cat:synthetic;EN:Erythrosine;MW:835.9;EXA:1
++
+<30,Ph,{3,9}=?6,{8,13,16}=dl,10:O,-2://O,{1,5,12,14}:/I,@7,\,Ph,-1:/COOH,6:/OH
++------------------------------------------------------------------------------
Cat:synthetic;EN:Sudan red 1;MW:248.28;EXA:1
+
<30,Ph,1=Ph,4:/OH,@3,\,N,!!,N,!,Ph
@@ -965,7 +982,7 @@ Cat:pesticide;EN:Acrinathrin;MW:541.45;EXA:1
<-30,?3,{2^-35,2'^35}:*/_,
@1,\,!~dl,!,//O,!,O,!,/CF3,!,CF3,@3,\,//O,!,O,!,/CN,!,Ph,-4:/OPh>rl
+------------------------------------------------------------------------------
-Cat:pesticide;EN:Azaconazole;MW:300.139;EXA:1
+Cat:pesticide;EN:Azaconazole;MW:300.139;EXA:-
+
<30,Ph,{4,6}:/Cl,@3,\,!2,?5,{-2,-4}=dl,{-2,-4,-5}:N,@7,?5,{-1,-4}:O
+------------------------------------------------------------------------------
@@ -2019,7 +2036,7 @@ Cat:antibacterial;EN:Sulfatiazole;MW:255.31;EXA:-
+
<30,Ph,1:/NH2,@4,\,SOO,!,NH,!,|,?5,{1,3}=dl,2:N,5:S
+------------------------------------------------------------------------------
-Cat:antibacterial;EN:Chlopidol;MW:192.039;EXA:1
+Cat:antibacterial;EN:Chlopidol;MW:192.039;EXA:-
+
<30,Ph,{1,3}:/_,2:N,{4,6}:/Cl,5:/OH
+------------------------------------------------------------------------------
@@ -2225,7 +2242,7 @@ Cat:biological;EN:Maitotoxin;MW:3425.86;EXA:2
{6,46,50,53,60,67,74}:*/H^-60,
{9,18,85,93,112,139,143,147}:*/_^60`1,{80,88,97,108',115,120,124}:/*_^-60`1,
@$6,\,|,!11,60~dr,-60,60,OH,{2',7,10}:*/OH,{1,3,8'}:*/_,11://_,12:/_,
- @6,\,O,30,SOO,30,ONa,
- @$36,-45~zf,O,30,SOO,30,ONa,
+ @6,\,O,30,SO3Na,
+ @$36,-45~zf,O,30,SO3Na,
@$150,\,|,!7,{1,2}:/*OH,4:*/_,5:/*_,7=dl
+------------------------------------------------------------------------------
diff --git a/graphics/mcf2graph/mcf_man_soc.mp b/graphics/mcf2graph/mcf_man_soc.mp
index 62d042bbf7..f3344cff25 100644
--- a/graphics/mcf2graph/mcf_man_soc.mp
+++ b/graphics/mcf2graph/mcf_man_soc.mp
@@ -1,9 +1,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% MCF file for mcf_manual.tex by Akira.Yamaji 2022.03.27
+% MCF file for mcf_manual.tex by Akira.Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-input mcf2graph; %% it must be version 4.83
+input mcf2graph; %% it must be version 4.84
% ** use library file 'mcf_library.mcf'
-message "mcf_man_soc 2022.03.27"; message "";
+message "mcf_man_soc 2022.05.08"; message "";
%------------------------------------------------------------------------
sw_mframe:=0;
sw_expand:=0;
diff --git a/graphics/mcf2graph/mcf_manual.pdf b/graphics/mcf2graph/mcf_manual.pdf
index 605c3a0c24..46fad77072 100644
--- a/graphics/mcf2graph/mcf_manual.pdf
+++ b/graphics/mcf2graph/mcf_manual.pdf
Binary files differ
diff --git a/graphics/mcf2graph/mcf_manual.tex b/graphics/mcf2graph/mcf_manual.tex
index 71ac080b10..e3aac3ed4b 100644
--- a/graphics/mcf2graph/mcf_manual.tex
+++ b/graphics/mcf2graph/mcf_manual.tex
@@ -1,7 +1,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Molecular Coding Format manual by Akira Yamaji 2022.03.27
+% Molecular Coding Format manual by Akira Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
+%%%\usepackage{graphicx}
+%%%\usepackage{hyperref}
\usepackage[pdftex]{graphicx}
\usepackage[pdftex]{hyperref}
%%%\usepackage[dvipdfmx]{graphicx}
@@ -1817,40 +1819,40 @@ file name = 'temp-mc.aux'
\paragraph{(Output)}
\begin{verbatim}
===========================================================================
- No. 3 / Name = Cytosine
+ No[3],Name<Cytosine>,Category<biological>,File<mcf_library.mcf>
---------------------------------------------------------------------------
- <30,?6,{4,6}=dl,4:N,3://O,2:NH,5:/NH2
+<30,?6,{4,6}=dl,4:N,3://O,2:NH,5:/NH2
+---------------------------------------------------------------------------
+ Row[1],Length[37],Commands[7],&Code[59],Warning[0]
---------------------------------------------------------------------------
- row= 1 / length= 37 / commands= 7
- {}=X = 1 / {}:X = 0 / '() = 0 / @ = 0 / & = 0 / < = 1
+ =[1]({}=[1]), :[4]({}:[0]), '()[0]
+ @[0],&[0],<[1],~[0],^[0],`[0],>[0],|[0],||[0],#[0],##[0]
---------------------------------------------------------------------------
- Warnings = 0 / Code= 60
- Width * Height = 34.68852 * 47.4036
- Shift width * height = 0 * -14.46167
- Bond length = 12.75589 Atom size = 5.38914
- Atom count= 9 Bond count= 9 Ring count= 1 Hide H count= 2
+ Width[30.92432],Height[42.36536], Shift x[0],Shift y[-12.99213]
+ Bond length[11.33856],Atom size[4.8819]
---------------------------------------------------------------------------
+ Atom[9],Bond[9],Ring[1],Hide H[2]
< NO. ><atom(s) >( x axis , y axis )<bond><hideH><chg>
A1 C ( 0 , 0 ) 3 1
- A2 N ( 0.866 , -0.5 ) 3
- A3 C ( 1.732 , 0 ) 4
- A4 N ( 1.732 , 1 ) 3
- A5 C ( 0.866 , 1.5 ) 4
+ A2 N ( 1 , 0 ) 3
+ A3 C ( 2 , 0 ) 4
+ A4 N ( 2 , 1 ) 3
+ A5 C ( 1 , 2 ) 4
A6 C ( 0 , 1 ) 3 1
- A7 O ( 2.508 , -0.448 ) 2
- A8 H ( 0.866 , -0.922 ) 1
- A9 NH2 ( 0.866 , 2.371 ) 1
+ A7 O ( 3 , 0 ) 2
+ A8 H ( 1 , -1 ) 1
+ A9 NH2 ( 1 , 2 ) 1
---------------------------------------------------------------------------
< NO. >< bond (sdt)><angle +( +- )><length ( pt )>
- B1 1 -> 2 ( 1) 330 ( -30) 1 ( 12.76)
- B2 2 -> 3 ( 1) 30 ( 30) 1 ( 12.76)
- B3 3 -> 4 ( 1) 90 ( 90) 1 ( 12.76)
- B4 4 -> 5 ( 2) 150 ( 150) 1 ( 12.76)
- B5 5 -> 6 ( 1) 210 ( -150) 1 ( 12.76)
- B6 6 -> 1 ( 2) 270 ( -90) 1 ( 12.76)
- B7 3 -> 7 ( 2) 330 ( -30) 0.66 ( 8.42)
- B8 2 -> 8 ( 1) 270 ( -90) 0.36 ( 4.59)
- B9 5 -> 9 ( 1) 90 ( 90) 0.66 ( 8.42)
+ B1 1 -> 2 ( 1) 330 ( -30) 1 ( 11)
+ B2 2 -> 3 ( 1) 30 ( 30) 1 ( 11)
+ B3 3 -> 4 ( 1) 90 ( 90) 1 ( 11)
+ B4 4 -> 5 ( 2) 150 ( 150) 1 ( 11)
+ B5 5 -> 6 ( 1) 210 ( -150) 1 ( 11)
+ B6 6 -> 1 ( 2) 270 ( -90) 1 ( 11)
+ B7 3 -> 7 ( 2) 330 ( -30) 0.66 ( 7)
+ B8 2 -> 8 ( 1) 270 ( -90) 0.36 ( 4)
+ B9 5 -> 9 ( 1) 90 ( 90) 0.66 ( 7)
---------------------------------------------------------------------------
<atom>( atom wt )[ mi wt ] < cnt > < sum wt >[ sum mi wt ]
C ( 12.0107)[ 12] * 4 48.04279[ 48]
diff --git a/graphics/mcf2graph/mcf_mplib_exa.pdf b/graphics/mcf2graph/mcf_mplib_exa.pdf
index ed678e74bd..861f6a1596 100644
--- a/graphics/mcf2graph/mcf_mplib_exa.pdf
+++ b/graphics/mcf2graph/mcf_mplib_exa.pdf
Binary files differ
diff --git a/graphics/mcf2graph/mcf_mplib_exa.tex b/graphics/mcf2graph/mcf_mplib_exa.tex
index 666885b91d..1d37cc0492 100644
--- a/graphics/mcf2graph/mcf_mplib_exa.tex
+++ b/graphics/mcf2graph/mcf_mplib_exa.tex
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2022.03.27
+% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2022.05.08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% ** mcf2graph.mp must be version 4.83
+% ** mcf2graph.mp must be version 4.84
% ** use mcf_library.mcf
\documentclass{article}
%------------------------------------------------------------------------------
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index 283d1ca4f1..ded454a028 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,27 @@ full list of changes.
\begin{itemize}
\item
+ Version 1.5.2 (2022-05-08)
+
+ Adding a couple of new component and a nice feature to transistors and
+ tubes.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added TVS diodes (transorb), suggested by
+ \href{https://tex.stackexchange.com/q/642219/38080}{Anisio Rogerio
+ Braga}
+ \item
+ Added proximity switches, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/631}{Anisio
+ Rogerio Braga}
+ \item
+ Added partially drawn tube and transistor borders, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/602}{Jether
+ Fernandes Reis}
+ \end{itemize}
+\item
Version 1.5.1 (2022-04-26)
Bug fix release.
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index f4602c8d5d..8fac207e51 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
index 4d8265968e..b03c2d5f54 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index 04431723a1..74d74b4dcd 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -2339,6 +2339,8 @@ The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptyd
\circuitdescbip*[emptylaserdiode]{empty laser diode}{Empty laser diode\footnotemark}{lasD}
\footnotetext{Added by André Alves in \texttt{v1.4.4}}
\circuitdescbip*[emptyvarcap]{empty varcap}{Empty varcap}{VCo}
+ \circuitdescbip*[emptytvsdiode]{empty TVS diode}{Empty TVS diode, transorb\footnotemark}{tvsDo}
+ \footnotetext{Transobs were suggested by \href{Anisio Braga}{https://tex.stackexchange.com/q/642219/38080}}
\circuitdescbip*[emptybidirectionaldiode]{empty bidirectionaldiode}{Empty bidirectionaldiode}{biDo}
\circuitdescbip[fulldiode] {full diode}{Full diode}{D*}
\circuitdescbip[fullsdiode]{full Schottky diode}{Full Schottky diode}{sD*}
@@ -2349,6 +2351,7 @@ The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptyd
\circuitdescbip[fulllediode]{full led}{Full led}{leD*}
\circuitdescbip[fulllaserdiode]{full laser diode}{Full laser diode}{lasD*}
\circuitdescbip[fullvarcap]{full varcap}{Full varcap}{VC*}
+ \circuitdescbip[fulltvsdiode]{full TVS diode}{Full TVS diode, transorb}{tvsD*}
\circuitdescbip[fullbidirectionaldiode]{full bidirectionaldiode}{Full bidirectionaldiode}{biD*}
\end{groupdesc}
@@ -3977,6 +3980,8 @@ The position of the circle on collector and emitter by default is the one shown
relative thickness & 1.0 & multiply the class thickness \\
color & default & stroke color: \texttt{default} is the same as the component \\
dash & none & dash pattern: none means unbroken line\footnotemark \\
+ partial borders & none & draw only part of the circle border: none means draw all \\
+ partial border dash & \{\{2pt\}\{2pt\}\} & dash pattern used in partial borders \\
\bottomrule
\end{tabular}
\footnotetext{Follows the syntax of the pattern sequence \texttt{\textbackslash pgfsetdash} --- see \TikZ{} manual for details; phase is always zero. Basically you pass pairs of dash-length -- blank-length dimensions, see the examples.}
@@ -4007,6 +4012,48 @@ Finally, using the class style you can do quite interesting things.
\end{circuitikz}
\end{LTXexample}
+\paragraph{Partially drawn circle borders}
+
+In some circuits, transistor are drawn with partial or dashed border (to convey the meaning of several active components encased in the same physical package, or to signify thermal contact). To achieve this effect, you can use the \texttt{transistor circle/partial border}\footnote{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/602}{Jether Fernandes Reis} for tubes, implemented by Romano in \texttt{v1.5.2}.} key (default \texttt{none}). This key can be set to \texttt{none}, or must be a sequence of \textbf{exactly} 4 numbers, that can have value \texttt{0}, \texttt{1}, or \texttt{2}. Each number define the style of a part of the border to be not drawn, solid or dashed respectively.
+
+The part of the border are numbered from 1 to 4 as shown below:
+\begin{quote}
+\begin{circuitikz}[circuitikz/transistors/fill=cyan!20,
+ circuitikz/transistor circle/partial borders=1212]
+ \draw (0,0) node[npn, tr circle](T){};
+ \draw[red, font=\ttfamily\small\bfseries]
+ ([shift={(.3,-.2)}]T.north east) node{1}
+ ([shift={(.3,.2)}]T.south east) node{2}
+ ([shift={(.2,.2)}]T.south west) node{3}
+ ([shift={(.2,-.2)}]T.north west) node{4}
+ ;
+ \end{circuitikz}
+\end{quote}
+The dashed line pattern can be changed by setting the key \texttt{transistor circle/partial border dash} (default \verb|{{2pt}{2pt}}|). Be careful with the extra set of braces here.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+ \ctikzset{transistors/thickness=4, transistors/fill=cyan!30,
+ transistor circle/relative thickness=0.25,
+ transistor circle/partial borders=2211}
+ \draw (0,0) node[npn, tr circle](Q1){};
+ \ctikzset{transistor circle/dash={{2pt}{2pt}}}
+ \draw (1.5,0) node[npn, tr circle, xscale=-1](Q2){};
+\end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+ \ctikzset{transistors/thickness=4, transistors/fill=cyan!30,
+ transistor circle/relative thickness=0.25,
+ transistor circle/partial borders=0011}
+ \draw (0,0) node[npn, tr circle](Q1){};
+ \ctikzset{transistor circle/dash={{2pt}{2pt}}}
+ \draw (1.5,0) node[npn, tr circle, xscale=-1](Q2){};
+ \draw[dashed] (Q1.circle top) -- (Q2.circle top);
+ \draw[dashed] (Q1.circle bottom) -- (Q2.circle bottom);
+\end{circuitikz}
+\end{LTXexample}
\subsubsection{Transistors anchors}
@@ -4094,6 +4141,12 @@ Additionally, you can access the position for the flyback diodes and possibly sn
\showanchors{pnp}{}(body C in/-45/0.4, body E in/45/0.4, body C out/0/0.4, body E out/0/0.4)
\end{quote}
+Transistor circles also have several anchors on them:
+\begin{quote}
+\showanchors{npn, tr circle}{}(circle center/-135/0.6, circle top/90/0.3, circle left/180/0.2, circle right/0/0.2, circle bottom/-90/0.3, circle C/45/0.2, circle E/-45/0.2)
+\showanchors{pigfete, bodydiode, tr circle}{}(circle center/-135/0.6, circle top/90/0.3, circle left/180/0.2, circle right/0/0.2, circle bottom/-90/0.3, circle C/-45/0.2, circle E/45/0.2)
+\end{quote}
+
The multi-terminal transistors have all the geographical anchors; note though that the \texttt{center} anchor is not the geometrical center of the component, but the logical one (at the same height than the base).
The additional anchors \texttt{vcenter} (vertical geometric center of the collector--emitter zone) and \texttt{gcenter} (graphical center) are provided, as shown in the following picture. They have no bodydiode anchors nor \texttt{inner \emph{up/down}} ones.
@@ -4301,7 +4354,7 @@ Example triode amplifier:
\end{circuitikz}
\end{lstlisting}
-\begin{circuitikz}
+\begin{circuitikz}[scale=0.7, transform shape]
\draw (0,0) node (start) {}
to[sV=$V_i$] ++(0,2+\ctikzvalof{tubes/height})
to[C=$C_i$] ++(2,0) coordinate(Rg)
@@ -4321,6 +4374,72 @@ Example triode amplifier:
\draw (Tri.east) node[right] {12AX7};
\end{circuitikz}
+\subsubsection{Tubes anchors}
+
+Apart from the geographic anchors, which take into account the leads of the components, you have several anchors on the border:
+\begin{quote}
+\geolrcoord{pentode, scale=0.8}
+\geolrcoord{triode, circuitikz/tubes/width=1.4, circuitikz/tubes/height=1, scale=0.8}
+\geolrcoord{triode, circuitikz/tubes/width=1, circuitikz/tubes/height=1, scale=0.8}
+
+\showanchors{pentode, circuitikz/tubes/height=1.8}{}(%
+tube top/90/0.3, tube left/180/0.2, tube right/0/0.2, tube bottom/-90/0.3,
+tube top right/30/0.2, tube top left/150/0.4, tube bottom right/-45/0.4, tube bottom left/-150/0.2,
+tube top center/75/0.5, tube bottom center/-105/0.5)
+\showanchors{pentode,circuitikz/tubes/width=2.6, circuitikz/tubes/tube radius=0.3}{}(%
+tube top/90/0.5, tube left/160/0.5, tube right/0/0.2, tube bottom/-90/0.6,
+tube top right/70/0.4, tube top left/150/0.4, tube bottom right/-45/0.4, tube bottom left/-120/0.4,
+tube right center/30/0.4, tube left center/-120/0.4)
+\end{quote}
+
+\subsubsection{Partially drawn tube borders}\label{sec:partial-tube-borders}
+
+In some circuits, tubes are drawn with partial or dashed border (to convey the meaning of several active components encased in the same physical tube). To achieve this effect, you can use the \texttt{tubes/partial border}\footnote{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/602}{Jether Fernandes Reis}, implemented by Romano in \texttt{v1.5.2}.} key (default \texttt{none}). This key can be set to \texttt{none}, or must be a sequence of \textbf{exactly} 6 numbers, that can have value \texttt{0}, \texttt{1}, or \texttt{2}. Each number define the style of a part of the border to be not drawn, solid or dashed respectively.
+
+The part of the border are numbered from 1 to 6 as shown below:
+\begin{quote}
+\begin{circuitikz}[circuitikz/tubes/fill=cyan!20,
+ circuitikz/tubes/partial borders=121212]
+ \draw (0,0) node[pentode,anchor=control](V){};
+ \draw (4,0) node[pentode,anchor=control,
+ circuitikz/tubes/width=1.4,
+ circuitikz/tubes/height=1](H){};
+ \draw[red, font=\ttfamily\small\bfseries]
+ ([shift={(-.2,-.2)}]V.ne) node{1}
+ ([shift={(.1,0)}]V.e) node{2}
+ ([shift={(-.2,.2)}]V.se) node{3}
+ ([shift={(.2,.2)}]V.sw) node{4}
+ ([shift={(-.1,0)}]V.w) node{5}
+ ([shift={(.2,-.2)}]V.nw) node{6}
+ ([shift={(.2,-.2)}]H.nw) node{1}
+ ([shift={(0,.1)}]H.n) node{2}
+ ([shift={(-.2,-.2)}]H.ne) node{3}
+ ([shift={(-.2,.2)}]H.se) node{4}
+ ([shift={(0,-.1)}]H.s) node{5}
+ ([shift={(.2,.2)}]H.sw) node{6}
+ ;
+ \end{circuitikz}
+\end{quote}
+(notice that the straight parts, if they exist, are numbered \texttt{2} and \texttt{5} in both tubes, vertical or horizontal).
+
+The dashed line pattern can be changed by setting the key \texttt{tubes/partial border dash} (default \verb|{{2pt}{2pt}}|).\footnote{Follows the syntax of the pattern sequence \texttt{\textbackslash pgfsetdash} --- see \TikZ{} manual for details; phase is always zero. Basically you pass pairs of dash-length -- blank-length dimensions, see the examples.} Be careful with the extra set of braces here.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[circuitikz/tubes/fill=cyan!20,
+ circuitikz/tubes/partial borders=012012]
+ \draw (0,0) node[pentode]{};
+ \draw (2,0) node[pentode,
+ circuitikz/tubes/width=1.4,
+ circuitikz/tubes/height=1]{};
+ \draw (1,-2) node[triode,
+ circuitikz/tubes/height=1,
+ circuitikz/tubes/partial border dash=%
+ {{3pt}{1pt}{1pt}{1pt}}]{};
+\end{circuitikz}
+\end{LTXexample}
+
+
+
\subsubsection{Other tubes-like components}
The \texttt{magnetron} and \texttt{dynode} shapes will also scale with \texttt{tubes/scale}.
@@ -5199,6 +5318,31 @@ Finally, the switches are normally drawn using the \texttt{ocirc} shape, but you
\end{circuitikz}
\end{LTXexample}
+\subsubsection{Proximity switches}
+
+\begin{groupdesc}
+ \circuitdesc*{proximeter}{proximeter}{text}(hlines nw/135/0.4, hlines ne/45/0.4, hlines sw/-135/0.4, hlines se/-45/0.4, center/-90/0.4)
+ \circuitdescbip*{inline proximeter}<proximeter>{proximeter switch, inline}{}(left/135/0.4, right/45/0.4)
+\end{groupdesc}
+
+The \texttt{proximeter} shape\footnote{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/631}{Anisio Rogerio Braga}, implemented in \texttt{v1.5.2}; see also \href{https://knowledge.autodesk.com/support/autocad-electrical/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-Electrical/files/GUID-1B18023D-241C-4E50-822A-94F873FC258B-htm.html}{here}.} can be used as a dipole with the \texttt{inline proximeter} variant.
+
+It has been assigned to the \texttt{switches} class; you can adjust the (relative) thickness of the inside horizontal lines with the key \texttt{proximeter/hlines thickness} (default \texttt{0.5}) and their vertical position with \texttt{proximeter/hlines position} (default \texttt{0.3}). You can also change the default size of \emph{all} proximeter symbols by changing \texttt{proximeter/width} (only safe at picture level; better set in the preamble if you need to change it. The default value is \texttt{0.3}).
+
+Notice in the following example that, as ever for node-type shape, the text is not included in the bounding box:
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}
+ \tikzset{small up proxi/.style={proximeter, solid,
+ circuitikz/switches/scale=0.707,
+ circuitikz/proximeter/hlines thickness=1,
+ circuitikz/proximeter/hlines position=0.1}}
+ \draw (0,0) to[inline proximeter, l=P1] ++(2,0)
+ to[ccgsw, name=P2] ++(2,0);
+ \draw[dashed] (P2.mid) -- ++(0,0.5)
+ node[small up proxi, above](P2p){Fe}
+ (P2p.north) ++ (0,0.5); % extend bounding box
+\end{tikzpicture}
+\end{LTXexample}
\subsubsection{Rotary switches}
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index 73ef108579..cfd7d63e70 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -16,8 +16,8 @@
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
-\def\pgfcircversion{1.5.1}
-\def\pgfcircversiondate{2022/02/26}
+\def\pgfcircversion{1.5.2}
+\def\pgfcircversiondate{2022/05/08}
\DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 94212962fb..d09e907a8d 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -3239,6 +3239,9 @@
\ctikzset{bipoles/diode/height/.initial=.50}
\ctikzset{bipoles/diode/width/.initial=.40}
+% for horizontally-double-sided diodes, like tvs diodes (transorb)
+\ctikzset{bipoles/ddiode/width/.initial=.80}% must be 2*diode width
+% for vertically taller diodes
\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
@@ -3803,6 +3806,65 @@
\pgfusepath{draw}
}
+%% Transorbs
+%% Empty zigzag TVS diode (transorb)
+\pgfcircdeclarebipolescaled{diodes}
+{% fix the anchor border
+ \pgfcirc@border@extend@updown{1.3}{1.3}
+}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytvsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/ddiode/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgfscope
+ \pgftransformxscale{0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfscope
+ \pgftransformxscale{-0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{1.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{1.3\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Black zigzag TVS diode (transorb)
+\pgfcircdeclarebipolescaled{diodes}
+{% fix the anchor border
+ \pgfcirc@border@extend@updown{1.3}{1.3}
+}
+{\ctikzvalof{bipoles/diode/height}}
+{fulltvsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/ddiode/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxscale{0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@fulldiode@triangle@shift
+ \endpgfscope
+ \pgfscope
+ \pgftransformxscale{-0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@fulldiode@triangle@shift
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{1.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{1.3\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
%% Empty bidirectionaldiode
\pgfcircdeclarebipolescaled{diodes}
{}
@@ -4174,6 +4236,8 @@
\pgfcirc@style@to@style{#1 photodiode}{pD#2}
\pgfcirc@activate@bipole{l}{#1varcap}{#1varcap}{#1 varcap}
\pgfcirc@style@to@style{#1 varcap}{VC#2}
+ \pgfcirc@activate@bipole{l}{#1tvsdiode}{#1tvsdiode}{#1 TVS diode}
+ \pgfcirc@style@to@style{#1 TVS diode}{tvsD#2}
\pgfcirc@activate@bipole{l}{#1bidirectionaldiode}{#1bidirectionaldiode}{#1 bidirectionaldiode}
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2}
\pgfcirc@activate@bipole{l}{#1thyristor}{#1thyristor}{#1 thyristor}
@@ -4210,6 +4274,8 @@
\pgfcirc@style@to@style{#1 photodiode}{pD#2}
\pgfcirc@node@to@style{l}{emptyvarcap}{#1 varcap}{\circuitikzbasekey/bipole/is strokedsymbol=true}
\pgfcirc@style@to@style{#1 varcap}{VC#2}
+ \pgfcirc@node@to@style{l}{emptytvsdiode}{#1 TVS diode}{\circuitikzbasekey/bipole/is strokedsymbol=true}
+ \pgfcirc@style@to@style{#1 TVS diode}{tvsD#2}
\pgfcirc@node@to@style{l}{emptybidirectionaldiode}{#1 bidirectionaldiode}{\circuitikzbasekey/bipole/is strokedsymbol=true}
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2}
\pgfcirc@node@to@style{l}{emptythyristor}{#1 thyristor}{\circuitikzbasekey/bipole/is strokedsymbol=true}
@@ -4242,12 +4308,12 @@
\pgfcirc@style@to@style{led}{leD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro photodiode}{photodiode}
\pgfcirc@style@to@style{photodiode}{pD}
-
\pgfcirc@style@to@style{\pgfcircdiodestylemacro laser diode}{laser diode}
\pgfcirc@style@to@style{laser diode}{lasD}
-
\pgfcirc@style@to@style{\pgfcircdiodestylemacro varcap}{varcap}
\pgfcirc@style@to@style{varcap}{VC}
+\pgfcirc@style@to@style{\pgfcircdiodestylemacro TVS diode}{TVS diode}
+\pgfcirc@style@to@style{TVS diode}{tvsD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro bidirectionaldiode}{bidirectionaldiode}
\pgfcirc@style@to@style{bidirectionaldiode}{biD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro thyristor}{thyristor}
@@ -4966,6 +5032,90 @@
\pgfcirc@activate@bipole{l}{cuteopeningswitch}{cuteopeningswitch}{cute opening switch}
\pgfcirc@style@to@style{cute opening switch}{cogsw}% %>>>
+%% Proximity switch auxiliary shapes%<<<
+%% proximeter shape, for usage with switches
+\ctikzset{proximeter/width/.initial=0.3}
+\ctikzset{proximeter/hlines thickness/.initial=0.5}
+\ctikzset{proximeter/hlines position/.initial=0.3}
+\pgfdeclareshape{proximeter}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\hlinepos}{\edef\hlinepos{\ctikzvalof{proximeter/hlines position}}}
+ \savedanchor\northeast{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{proximeter/width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgf@x=\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ % geo anchors based on north-east
+ \pgfcirc@northeast@symmetric@geoanchors
+ \anchor{text}{%
+ \northeast
+ \pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax
+ \advance\pgf@y by .6\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{hlines ne}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y
+ }
+ \anchor{hlines nw}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x
+ }
+ \anchor{hlines se}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y
+ \pgf@y=-\pgf@y
+ }
+ \anchor{hlines sw}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \pgf@circ@draw@component{
+ \northeast\pgf@circ@res@temp=\pgf@y
+ \pgf@circ@setcolor
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@temp}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfsetlinewidth{\ctikzvalof{proximeter/hlines thickness}*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@up}{\hlinepos*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@circ@res@right}{\pgf@circ@res@temp-\pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ }
+
+}
+\pgfcirc@node@to@path{proximeter}{inline proximeter}{}
+% %>>>
+
%%%%%%%%%%%%%%%%%
%% Instruments
%%%%%%%%%%%%%%%%%
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
index 711276dd77..596171c5ad 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
@@ -3370,11 +3370,64 @@
\newif\ifpgf@circ@trcircle\pgf@circ@trcirclefalse
\ctikzset{tr circle/.is if=pgf@circ@trcircle}
\tikzset{tr circle/.is if=pgf@circ@trcircle}
+% partial borders styles
+% this can be "none" or 4 numbers saying the style for each part:
+% 0 --- nothing, 1 --- solid, 2 --- dashed
+\ctikzset{transistor circle/partial borders/.initial=none} % Value none for normal borders
+\ctikzset{transistor circle/partial border dash/.initial={{2pt}{2pt}}}
%%>>>
%% definitions of transistor shapes%<<<
%
+% draw partial transistor outline
+%
+\def\pgf@circ@trcircle@split#1#2#3#4\relax{%split the six numbers
+ \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}%
+}
+\def\pgf@circ@trcircle@setdash{%
+ \edef\@@dash{\ctikzvalof{transistor circle/partial border dash}}%
+ % \typeout{DASH:\@@dash}%
+ \expandafter\pgfsetdash\expandafter{\@@dash}{0pt}%
+}
+% this is the same as the tubes' one, but let's keep it separated
+\def\pgf@circ@trcircle@draw@style#1{%
+ \ifcase#1
+ \pgfusepath{discard}% case 0, will discard the path
+ \or
+ \pgfsetdash{}{0pt}\pgfusepath{draw}% case 1, solid
+ \or
+ \pgf@circ@trcircle@setdash\pgfusepath{draw}% case 2, dashed
+ \else
+ \pgfutil@packagewarning{circuitikz}{Transistor circle draw style not known!}%
+ \pgfusepath{draw}%
+ \fi
+}
+%
% add a circle to the transistor:
+\def\pgf@circ@trcircle@draw@partial#1{%
+ \expandafter\pgf@circ@trcircle@split#1\relax
+ \typeout{PARTIAL: \@@a:\@@b:\@@c:\@@d}
+ \pgfscope % right side upper arc
+ \pgfpathmoveto{\pgfpoint{\circleleft+\circleradius}{\circleradius}}
+ \pgfpatharc{90}{0}{\circleradius}
+ \pgf@circ@trcircle@draw@style{\@@a}
+ \endpgfscope
+ \pgfscope % right side lower arc
+ \pgfpathmoveto{\pgfpoint{\circleleft+2*\circleradius}{0pt}}
+ \pgfpatharc{0}{-90}{\circleradius}
+ \pgf@circ@trcircle@draw@style{\@@b}
+ \endpgfscope
+ \pgfscope % left side lower arc
+ \pgfpathmoveto{\pgfpoint{\circleleft+\circleradius}{-\circleradius}}
+ \pgfpatharc{-90}{-180}{\circleradius}
+ \pgf@circ@trcircle@draw@style{\@@c}
+ \endpgfscope
+ \pgfscope % left side upper arc
+ \pgfpathmoveto{\pgfpoint{\circleleft}{0pt}}
+ \pgfpatharc{-180}{-270}{\circleradius}
+ \pgf@circ@trcircle@draw@style{\@@d}
+ \endpgfscope
+}
%
\def\pgfcirc@transistorcircle{
\ifpgf@circ@trcircle
@@ -3394,7 +3447,15 @@
% \pgfmathsetlength{\pgf@circ@res@temp}{((#2+\extrabodydiodelen)-(#1)+(#3)*(#3)/((#2+\extrabodydiodelen)-(#1)))/2}
% \pgfpathcircle{\pgfpoint{#1+\pgf@circ@res@temp}{0pt}}{\pgf@circ@res@temp}
\pgfpathcircle{\pgfpoint{\circleleft+\circleradius}{0pt}}{\circleradius}
- \pgf@circ@draworfill
+ \edef\@@partial{\ctikzvalof{transistor circle/partial borders}}
+ \ifx\@@partial\pgf@nonetext
+ % Circle fill and draw if it's not partial... for speed
+ \pgf@circ@draworfill
+ \else
+ % otherwise, just fill and do the partial fill
+ \pgf@circ@maybefill
+ \pgf@circ@trcircle@draw@partial{\@@partial}
+ \fi
\endpgfscope
\fi
}
@@ -3539,6 +3600,19 @@
\anchor{circle center}{
\pgf@y=0pt\pgf@x=\circleleft\advance\pgf@x by\circleradius
}
+ \anchor{circle top}{
+ \pgf@y=\circleradius\pgf@x=\circleleft\advance\pgf@x by\circleradius
+ }
+ \anchor{circle bottom}{
+ \pgf@y=-\circleradius\pgf@x=\circleleft\advance\pgf@x by\circleradius
+ }
+ \anchor{circle left}{
+ \pgf@y=0pt\pgf@x=\circleleft
+ }
+ \anchor{circle right}{
+ \pgf@y=0pt\pgf@x=\circleleft
+ \advance\pgf@x by \circleradius\advance\pgf@x by \circleradius
+ }
\savedanchor{\centergap}{% this is the center position between gate and base
% get "left"
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
@@ -7965,6 +8039,11 @@
\ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
\ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
\ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
+% partial borders styles
+% this can be "none" or 6 numbers saying the style for each part:
+% 0 --- nothing, 1 --- solid, 2 --- dashed
+\ctikzset{tubes/partial borders/.initial=none} % Value none for normal borders
+\ctikzset{tubes/partial border dash/.initial={{2pt}{2pt}}}
\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
@@ -8138,27 +8217,135 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Electronic tubes, submitted by J. op den Brouw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+%
+% draw partial tube outline
+%
+\def\pgf@circ@tubes@split#1#2#3#4#5#6\relax{%split the six numbers
+ \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}%
+}
+\def\pgf@circ@tubes@setdash{%
+ \edef\@@dash{\ctikzvalof{tubes/partial border dash}}%
+ % \typeout{DASH:\@@dash}%
+ \expandafter\pgfsetdash\expandafter{\@@dash}{0pt}%
+}
+% this is the same as the transistor circles' one, but let's keep it separated
+\def\pgf@circ@tubes@draw@style#1{%
+ \ifcase#1
+ \pgfusepath{discard}% case 0, will discard the path
+ \or
+ \pgfsetdash{}{0pt}\pgfusepath{draw}% case 1, solid
+ \or
+ \pgf@circ@tubes@setdash\pgfusepath{draw}% case 2, dashed
+ \else
+ \pgfutil@packagewarning{circuitikz}{Tube border draw style not known!}%
+ \pgfusepath{draw}%
+ \fi
+}
+\def\pgf@circ@tubes@draw@partial#1{%
+ \expandafter\pgf@circ@tubes@split#1\relax
+ % \typeout{PARTIAL: \@@a:\@@b:\@@c:\@@d:\@@e:\@@f}
+ \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
+ % horizontal tube
+ \pgfutil@tempdima=\pgf@circ@res@right
+ \advance\pgfutil@tempdima by -\pgf@circ@res@up
+ \pgfscope % left side upper arc
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90}{\pgf@circ@res@up}
+ \pgf@circ@tubes@draw@style{\@@a}
+ \endpgfscope
+ \pgfscope % upper horizontal part
+ \pgfpathmoveto{\pgfpoint{-\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgf@circ@tubes@draw@style{\@@b}
+ \endpgfscope
+ \pgfscope % right side upper arc
+ \pgfpathmoveto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{0}{\pgf@circ@res@up}
+ \pgf@circ@tubes@draw@style{\@@c}
+ \endpgfscope
+ \pgfscope % right side lower arc
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{0}{-90}{\pgf@circ@res@up}
+ \pgf@circ@tubes@draw@style{\@@d}
+ \endpgfscope
+ \pgfscope % lower horizontal part
+ \pgfpathmoveto{\pgfpoint{\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgf@circ@tubes@draw@style{\@@e}
+ \endpgfscope
+ \pgfscope % left side lower arc
+ \pgfpathmoveto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{180}{\pgf@circ@res@up}
+ \pgf@circ@tubes@draw@style{\@@f}
+ \endpgfscope
+ \else
+ % vertical tube
+ \pgfutil@tempdima=\pgf@circ@res@up
+ \advance\pgfutil@tempdima by -\pgf@circ@res@right
+ \pgfscope % left side upper arc
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{0}{\pgf@circ@res@right}
+ \pgf@circ@tubes@draw@style{\@@a}
+ \endpgfscope
+ \pgfscope % right vertical part
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgf@circ@tubes@draw@style{\@@b}
+ \endpgfscope
+ \pgfscope % right side lower arc
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgfpatharc{0}{-90}{\pgf@circ@res@right}
+ \pgf@circ@tubes@draw@style{\@@c}
+ \endpgfscope
+ \pgfscope % right side lower arc
+ \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@up}}
+ \pgfpatharc{-90}{-180}{\pgf@circ@res@right}
+ \pgf@circ@tubes@draw@style{\@@d}
+ \endpgfscope
+ \pgfscope % left vertical part
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgf@circ@tubes@draw@style{\@@e}
+ \endpgfscope
+ \pgfscope % left side upper arc
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpatharc{180}{90}{\pgf@circ@res@right}
+ \pgf@circ@tubes@draw@style{\@@f}
+ \endpgfscope
+ \fi
+}
% Draw tube outline
\def\pgf@circ@tubes@drawtube{%
- \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
- \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfutil@tempdima=\pgf@circ@res@right
- \advance\pgfutil@tempdima by -\pgf@circ@res@up
- \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
- \pgfpatharc{90}{-90}{\pgf@circ@res@up}
- \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
- \pgfpatharc{270}{90}{\pgf@circ@res@up}
- \else
- \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
- \pgfutil@tempdima=\pgf@circ@res@up
- \advance\pgfutil@tempdima by -\pgf@circ@res@right
- \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
- \pgfpatharc{180}{0}{\pgf@circ@res@right}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
- \pgfpatharc{180}{0}{-\pgf@circ@res@right}
- \fi
- \pgfpathclose
+ \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
+ % horizontal tube
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfutil@tempdima=\pgf@circ@res@right
+ \advance\pgfutil@tempdima by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{90}{\pgf@circ@res@up}
+ \else
+ % vertical tube
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
+ \pgfutil@tempdima=\pgf@circ@res@up
+ \advance\pgfutil@tempdima by -\pgf@circ@res@right
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{\pgf@circ@res@right}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{-\pgf@circ@res@right}
+ \fi
+ \pgfpathclose
+ \edef\@@partial{\ctikzvalof{tubes/partial borders}}
+ \ifx\@@partial\pgf@nonetext
+ % Tube fill and draw if it's not partial... for speed
+ \pgf@circ@draworfill
+ \else
+ % otherwise, just fill and do the partial fill
+ \pgf@circ@maybefill
+ \pgf@circ@tubes@draw@partial{\@@partial}
+ %
+ \fi
}
%% The diode (tube), triode, tetrode and pentode only differ in the
@@ -8169,9 +8356,6 @@
\pgfdeclareshape{#1}{
\savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \anchor{center}{
- \pgfpointorigin
- }
\savedanchor\northwest{%
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
\pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
@@ -8182,40 +8366,58 @@
\pgf@x=-\pgf@circ@res@right
\pgf@x=.5\pgf@x
}
- \anchor{north} {%
- \northwest
- \pgf@x=0pt
- }
- \anchor{east}{%
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=0pt
- }
- \anchor{south}{%
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{west}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{north west}{%
- \northwest
- }
- \anchor{north east}{%
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
+ \savedanchor\tubene{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@temp=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@temp
+ \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@other
+ \pgf@y=\pgf@circ@res@up
+ \pgf@x=\pgf@circ@res@right
}
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
+ \savedanchor\tubesquarene{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@temp=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@temp
+ \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@other
+ \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
+ % horizontal
+ \pgf@y=\pgf@circ@res@up
+ \pgf@x=\pgf@circ@res@right\advance\pgf@x by -\pgf@circ@res@up
+ \else
+ % vertical
+ \pgf@x=\pgf@circ@res@right
+ \pgf@y=\pgf@circ@res@up\advance\pgf@y by -\pgf@circ@res@right
+ \fi
}
+ \anchor{tube ne}{\tubene}
+ \anchor{tubesq ne}{\tubesquarene}
+ % tube shape anchors: geo
+ \anchor{tube top}{\tubene\pgf@x=0pt\relax}
+ \anchor{tube bottom}{\tubene\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{tube right}{\tubene\pgf@y=0pt\relax}
+ \anchor{tube left}{\tubene\pgf@y=0pt\pgf@x=-\pgf@x}
+ % tube shape straight part anchors
+ \anchor{tube top right}{\tubesquarene}
+ \anchor{tube bottom right}{\tubesquarene\pgf@y=-\pgf@y}
+ \anchor{tube top left}{\tubesquarene\pgf@x=-\pgf@x}
+ \anchor{tube bottom left}{\tubesquarene\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ % tube shape centers
+ \anchor{tube top center}{\tubesquarene\pgf@x=0pt\relax}
+ \anchor{tube bottom center}{\tubesquarene\pgf@y=-\pgf@y\pgf@x=0pt\relax}
+ \anchor{tube right center}{\tubesquarene\pgf@y=0pt\relax}
+ \anchor{tube left center}{\tubesquarene\pgf@x=-\pgf@x\pgf@y=0pt\relax}
+ % rest of anchors
+ \anchor{center}{\pgfpointorigin}
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
+ % text anchor
+ \anchor{text}{%
+ \northwest\pgf@x=-\pgf@x
+ \pgf@y=-.5\ht\pgfnodeparttextbox
+ }
+ % specific anchors
\anchor{anode} {%
\northwest
\pgf@x=0pt
@@ -8271,9 +8473,6 @@
\pgf@circ@res@up=0.5\pgf@circ@res@up
\pgf@circ@res@right=0.5\pgf@circ@res@right
- % Tube fill color (if any)
- \pgf@circ@draworfill
-
% Grid drawing
#3%
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index 261eeafcc5..7cf1d37aa0 100644
--- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
@@ -10,8 +10,8 @@
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
-\def\pgfcircversion{1.5.1}
-\def\pgfcircversiondate{2022/02/26}
+\def\pgfcircversion{1.5.2}
+\def\pgfcircversiondate{2022/05/08}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
\usemodule[tikz]