summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-18 22:12:30 +0000
committerKarl Berry <karl@freefriends.org>2015-09-18 22:12:30 +0000
commitb168e0be320a5860a6623ede7a4bef3347304543 (patch)
tree598e7bdd7123ac2505ad89a3417504abfc3b9b4d /Master/texmf-dist/metapost
parentc0ae3fe934cc749e817139aac978743bc439e52f (diff)
mcf2graph (18sep15)
git-svn-id: svn://tug.org/texlive/trunk@38400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf39
1 files changed, 17 insertions, 22 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index 114c0881621..d3e7e1b3b02 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 3.70 Copyright (c) 2013-2015 Akira Yamaji
+% mcf2graph ver 3.71 Copyright (c) 2013-2015 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,
@@ -37,7 +37,7 @@ pair posB[],posA[],pairT,Ls,Le,pairA;
numeric angB[],angA[],br_ang[],sB[],eB[],f_FON[],atom_w[],atom_h[],atom_d[],strA[],stkB[],
stkA[],stkL[],stkM[],strW[],lineB[],lenB[],ps_com[],ps_adr[],ps_len[],ps_rot[],
ps_env[],comMC[][],parMC[][],stock_p[],cntMC[],colorA[],colorB[],tblN[],tblB[][],
- wtA[],sumA[],CH[],NH[],NO[],SO[],CCl[],CF[],CBr[],??[],?[],|?[],![],!![],Ph[],ph[];
+ wtA[],sumA[],CH[],NH[],NO[],SO[],CCl[],CF[],CBr[],?[],![],Ph[];
path pA,pB,pC,pT;
string info[],tblA[],com_str[],calc_formula,mp_log_name,mol_name,mol_formula,calc_weight_str;
picture atom_font[],chem_structure,temp_picture;
@@ -69,7 +69,7 @@ else: f_MP:=0;
clearit; chem_structure:=currentpicture;
%-------------------------------------------------------------------------------------------------
let DIV= /; let MUL= *; let LT= <; let GT= >; let AND= &; let :: = : ; let == = =;
-??3:=??20:=?3:=?20:=Ph:=Ph1:=Ph2:=ph:=ph1:=ph2:=hz:=0; vt:=1;
+?3:=?20:=Ph:=Ph1:=Ph2:=hz:=0; vt:=1;
first_def_number:=500; user_def_number:=2500; ab_def_number:=3000; unit_e:=1/2048;
margin_left_right:=margin_top_bottom:=0.4mm; ratio_chain_ring:= 0.66; ratio_atom_bond:=0.36;
ratio_thickness_bond:=0.015; offset_atom#:=0.8pt#; max_bond_width:=0.25;
@@ -212,32 +212,31 @@ def ''(expr k)(text s)= begingroup
endgroup
enddef;
%-------------------------------------------------------------------------------------------------
-def !?(expr a)(expr b)(expr c) = PB(_jp_bond,a) PB(_get_len,a) PB(_push,c)
- PB(_chg_len,_ring_len) for i==1 upto b-2:: PB(_mk_bond,360 DIV b) endfor PB(_pop,c)
+def !?(expr a)(expr b) =
+ PB(_jp_bond,a) PB(_get_len,a) PB(_push,0)
+ PB(_chg_len,_ring_len) for i==1 upto b-2:: PB(_mk_bond,360 DIV b) endfor PB(_pop,0)
if a>=1:: PB(_cyc_eB,0) elseif a<=0:: PB(_cyc_eB,a-b+2) else:: PB(_cyc_eB,a) fi
enddef;
%-------------------------------------------------------------------------------------------------
-def !!?(expr a)(expr b)(expr c)(expr n) = PB(_jp_bond,xpart(a)) PB(_push,n)
+def !!?(expr a)(expr b)(expr c) =
+ PB(_jp_bond,xpart(a)) PB(_push,0)
if b==6:: PB(_chg_len,0) for i==1 upto c-1:: PB(_mk_bond,60) endfor
elseif b==5:: if c==2:: PB(_chg_len,1.25) PB(_mk_bond,80)
elseif c==3:: PB(_chg_len,1.1) PB(_mk_bond,78) PB(_mk_bond,72) fi
elseif b==4:: PB(_chg_len,1.225) PB(_mk_bond,105) fi
- PB(_pop,n) if ypart(a)<=0:: PB(_cyc_eB,ypart(a)-c+1) else:: PB(_cyc_eB,ypart(a)) fi
+ PB(_pop,0) if ypart(a)<=0:: PB(_cyc_eB,ypart(a)-c+1) else:: PB(_cyc_eB,ypart(a)) fi
enddef;
%-------------------------------------------------------------------------------------------------
def PB(expr b,c)= comMC[ab_num][incr cntBS]:=b; parMC[ab_num][cntBS]:=c; enddef;
-def $$(text t)(expr e) = begingroup save cntBS; cntBS:=0; ab_num:=ab_num+1;
+def $$(text t)(expr e) =
+ begingroup save cntBS; cntBS:=0; ab_num:=ab_num+1;
if known e:: if numeric e::
if (e>=si)and(e<=nl):: if e==dl:: for list==t:: PB(_dl,list) endfor
else:: for list==t:: PB(_set_adr,list) PB(_set_line,e) endfor fi
- elseif (e>=??3)and(e<=??20):: for list==t:: !?(list)(e-??3+3)(1) endfor
- elseif (e>=?3)and(e<=?20):: for list==t:: !?(list)(e-?3+3)(0) endfor
- elseif e==Ph1:: !?(t)(6)(1) PB(_dl,-2) PB(_dl,-4)
- elseif e==Ph2:: !?(t)(6)(1) PB(_dl,-1) PB(_dl,-3) PB(_dl,-5)
- elseif e==ph1:: !?(t)(6)(0) PB(_dl,-2) PB(_dl,-4)
- elseif e==ph2:: !?(t)(6)(0) PB(_dl,-1) PB(_dl,-3) PB(_dl,-5)
- elseif comMC[e][1]==_fuse::
- for list==t:: !!?(list)(parMC[e][1])(comMC[e][2])(parMC[e][2]) endfor fi
+ elseif (e>=?3)and(e<=?20):: for list==t:: !?(list)(e-?3+3) endfor
+ elseif e==Ph1:: !?(t)(6) PB(_dl,-2) PB(_dl,-4)
+ elseif e==Ph2:: !?(t)(6) PB(_dl,-1) PB(_dl,-3) PB(_dl,-5)
+ elseif comMC[e][1]==_fuse:: for list==t:: !!?(list)(parMC[e][1])(comMC[e][2]) endfor fi
elseif color e:: color_list[incr cntC]:=e;
for list==t:: PB(_set_adr,list) PB(_set_colorB,cntC) endfor fi fi
cntMC[ab_num]:=cntBS;
@@ -362,7 +361,7 @@ def proc_bond_atom(expr n)=
elseif com=_get_len: if par=0: if bondL=crR: bondL:=lenT; fi else: ringL:=lenB[getB(par)]; fi
elseif com=_tmp_len: lenT:=par;
elseif com=_set_line: lineB[getB(adrT)]:=par;
- elseif com=_dl: lineB[getB(par)]:=dl;
+ elseif com=_dl: lineB[getB(par)]:=dl;
elseif (com=_chg_line)or(com=_tmp_line): lineT:=par;
elseif com=_tmp_rot: rotT:=par;
elseif com=_cyc: f_end:=getA(par); add_atom;
@@ -554,14 +553,10 @@ lr:='(60 for i==1 upto 10:: ,-60,60 endfor); rl:='(-60,lr);
def ring expr n=^^((-180 DIV n)-90),(_chg_len,0),
for i==2 upto n:: ,(360 DIV n) endfor,(_cyc_sB,1-n) enddef;
for i=3 upto 20: ?[i]:='({{,ring i,}}); endfor
-for i=3 upto 20: ??[i]:='({,ring i,}); endfor
-Ph:=Ph1:='(??6,(_dl,-2),(_dl,-4),(_dl,-6)); Ph2:='(??6,(_dl,-1),(_dl,-3),(_dl,-5));
-ph:=ph1:='(?6, (_dl,-2),(_dl,-4),(_dl,-6)); ph2:='(?6, (_dl,-1),(_dl,-3),(_dl,-5));
+Ph:=Ph1:='(?6,(_dl,-2),(_dl,-4),(_dl,-6)); Ph2:='(?6,(_dl,-1),(_dl,-3),(_dl,-5));
!:='((_mk_bond,_arg_ang)); !0:='(^^180,180);
for i=1 upto 20: ![i]:='({{,(_get_len,0),! for j==2 upto i::,! endfor,}}); endfor
-for i=1 upto 20: !![i]:='({, (_get_len,0),! for j==2 upto i::,! endfor,}); endfor
Me:='(); Et:=!; Pr:='(!,!); Bu:='(!,!,!);
-for i=4,5,6: for j=2 upto i-2: ??[i][j]:='((_fuse,i),(j,1)); endfor endfor
for i=4,5,6: for j=2 upto i-2: ?[i][j]:='((_fuse,i),(j,0)); endfor endfor
%-------------------------------------------------------------------------------------------------
H :='("H");C:='("C");N:='("N");O:='("O");F:='("F");S:='("S");P:='("P");I:='("I");