summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf49
1 files changed, 29 insertions, 20 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index 3dd99c950c4..875b4e32b1a 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.30 Copyright (c) 2013-2018 Akira Yamaji
+% mcf2graph ver 4.31 Copyright (c) 2013-2018 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,
@@ -31,7 +31,7 @@
% Set to use plain.mp label,arrow : mpost -s ahlength=3 FILENAME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tracingstats:=1;
-message " This is mcf2graph ver 4.3 2018.01";
+message " This is mcf2graph ver 4.3 2018.04";
%-------------------------------------------------------------------------------------------------
newinternal nA,nB,nC,nD,nE,nF,char_num,str_cnt,sub_usr,sub_int,tbl_cnt;
numeric save_para[],comD[][],parD[][],cntD[],tbl_str_wd[],tbl_atom[],tbl_subst[][],tbl_atom_wt[],
@@ -115,7 +115,7 @@ sub_int_start:=3000; % 3000 => 4000 for internal sub structure (max 1000)
def def_com(expr n)(text tx)= nA:=n; forsuffixes list=tx:: list:=nA; nA:=nA+1; endfor enddef;
def_com(-4000)(_term,_jp_atom,_jp_atom_abs,_jp_bond,_cyc,_cyc_sB,_cyc_eB,_set_line,_chg_line,
_dl,_mb,_N,_O,_S,_tmp_line,_chg_len,_get_len,_ring_len,_tmp_len,_rot_ang,_adj_ang,_chg_env,
- _tmp_env,_set_colorA,_set_colorB,_postA,_postB,_postC,_postD,_postE,_postF,_postH,_stack_reset,
+ _tmp_env,_set_colorA,_set_colorB,_postA,_postB,_postC,_postD,_postE,_postF,_postG,_postH,
_set_clr,_set_adr,_mk_bond,_set_atom,_arg_ang,_chg_atom,_tmp_rot,_fuse,_push,_pop,
_size_a,_numeric,_jump_at,_connect_at);
def_com(1)(si,dl,dr,db,dm,tm,wf,wb,bd,bz,zf,zb,dt,wv,nl,vf,vb,si_,wf_,wb_,bd_);
@@ -197,8 +197,8 @@ def endfont=
enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def set_def_MC=
- save /,//,/*,*/,**,~,~~,^,^^,`,'`,<,>,>>,:>,&,:,=,\,\\,*\,\*,@,$,{,},
- |,||,|<,>|,|:,:|,_,d,w,z,inside_def_MC;
+ save /,//,/*,*/,**,*/*,~,~~,^,^^,`,'`,<,>,>>,:>,&,:,=,\,\\,*\,\*,*\*,@,$,{,},
+ |,||,|<,>|,|<=,|:,:|,_,d,w,z,inside_def_MC;
inside_def_MC:=1;
_:=Me; d:=db; w:=wf; z:=zf;
tertiarydef a=b == change_bond(a,b) enddef;
@@ -213,13 +213,14 @@ def set_def_MC=
tertiarydef a~b == ~~b,a enddef; tertiarydef a>b == :>b,a enddef;
def & == _connect_at enddef;
def @ == _jump_at enddef; def \ == @,0 enddef;
- def \\ == \~dm enddef; def *\ == \~wf enddef; def \* == \~zf enddef;
- def |< == (_push,1) enddef; def >| == (_pop,1) enddef;
- def | == |<,>| enddef; def || == (_stack_reset,0) enddef;
+ def \\ == \~dm enddef; def *\ == \~wf enddef; def \* == \~zf enddef; def *\* == \~wv enddef;
def |: == (_push,0) enddef; def :| == (_pop,0) enddef;
- def /secondary n == (_postA,n) enddef; def //secondary n == (_postB,n) enddef;
- def */secondary n == (_postC,n) enddef; def /*secondary n == (_postD,n) enddef;
- def */*secondary n == (_postE,n) enddef; def **secondary n == (_postF,n) enddef;
+ def |< == (_push,1) enddef; def >| == (_pop,1) enddef;
+ def |<=primary n == ``n,(_push,1) enddef;
+ def | == (_push,2) enddef; def || == (_pop,2) enddef;
+ def /secondary n == (_postA,n) enddef; def //secondary n == (_postB,n) enddef;
+ def */secondary n == (_postC,n) enddef; def /*secondary n == (_postD,n) enddef;
+ def **secondary n == (_postF,n) enddef; def */*secondary n == (_postG,n) enddef;
enddef;
%=================================================================================================
vardef '(text s)= ''(incr sub_usr)(s); sub_usr enddef;
@@ -658,10 +659,14 @@ def proc_bond_atom(expr n)=
for i=n upto cntD[0]:
com:=comD[0][i]; par:=parD[0][i];
if com=_push:
- if par=1: stkL[adrS]:=bondL; stkA[incr adrS]:=adrA:=cntA; stkB[adrS]:=adrB:=cntB;
- elseif par=0: temp_len:=bondL; fi
- elseif com=_pop: if par=1: adrA:=stkA[decr adrS]; adrB:=stkB[adrS]; bondL:=stkL[adrS];
- elseif par=0: bondL:=temp_len; fi
+ if par=1: stkL[adrS]:=bondL; stkA[incr adrS]:=adrA:=cntA; stkB[adrS]:=adrB:=cntB;
+ elseif par=0: temp_len:=bondL;
+ elseif par=2: stkA[adrS+1]:=cntA; stkB[adrS+1]:=cntB;
+ fi
+ elseif com=_pop: if par=1: adrA:=stkA[decr adrS]; adrB:=stkB[adrS]; bondL:=stkL[adrS];
+ elseif par=0: bondL:=temp_len;
+ elseif par=2: stkA[adrS+1]:=0;
+ fi
elseif com=_mk_bond: if (par=0)and(rotT<>0): rotT:=0; fi add_atom;
elseif com=_set_adr: adrT:=par;
elseif com=_set_atom: strAT:=par;
@@ -671,6 +676,7 @@ def proc_bond_atom(expr n)=
elseif com=_postD: lineT:=zf; ps_put;
elseif com=_postE: lineT:=nl; ps_put;
elseif com=_postF: lineT:=0; ps_put;
+ elseif com=_postG: lineT:=wv; ps_put;
elseif com=_postH: lineT:=nl; lenT:=_size_a; ps_put;
elseif com=_jp_bond: termA; tempB:=getB(par); check_adrB(tempB); sB[cntB+1]:=sB[tempB]; f_bra:=1;
elseif com=_jp_atom: termA; tempA:=getA(par); check_adrA(tempA); sB[cntB+1]:=tempA; f_bra:=1;
@@ -700,7 +706,6 @@ def proc_bond_atom(expr n)=
if lenT<>crR: f_lenT:=1; fi if envT<>hz: f_envT:=1; fi
elseif par=0: f_lineT:=f_rotT:=f_lenT:=f_envT:=rotT:=envT:=0; lineT:=si; lenT:=crR;
fi
- elseif com=_stack_reset: stkA[adrS+1]:=0;
elseif com=_term: termA;
elseif com=_set_colorA: colorA[getA(adrT)]:=par;
elseif com=_set_colorB: colorB[getB(adrT)]:=par;
@@ -732,9 +737,13 @@ def proc_skeleton=
com:=comD[0][i]; par:=parD[0][i];
if com=_push: if par=1: stkM[adrS]:=envB; adrS:=adrS+1; stkA[adrS]:=adrA:=cntA;
stkB[adrS]:=adrB:=cntB;
- elseif par=0: temp_len:=bondL; fi
+ elseif par=0: temp_len:=bondL;
+ elseif par=2: stkA[adrS+1]:=cntA; stkB[adrS+1]:=cntB;
+ fi
elseif com=_pop: if par=1: adrA:=stkA[decr adrS]; adrB:=stkB[adrS]; envB:=stkM[adrS];
- elseif par=0: temp_len:=bondL; fi
+ elseif par=0: temp_len:=bondL;
+ elseif par=2: stkA[adrS+1]:=0;
+ fi
elseif com=_jp_bond: termB; tempB:=getB(par); posBs:=posA[sB[tempB]];
angT:=angB[tempB]; f_bra:=1; rotT:=0;
elseif com=_jp_atom: termB; adrT:=getA(par); posBs:=posA[adrT];
@@ -754,7 +763,7 @@ def proc_skeleton=
elseif com=_cyc_sB: f_end:=1; proc_cyc(sB[getB(par)]);
elseif com=_cyc_eB: f_end:=1; proc_cyc(eB[getB(par)]);
elseif com=_term: termB;
- elseif com=_stack_reset: stkA[adrS+1]:=0;
+%%%%%%%%% elseif com=_stack_reset: stkA[adrS+1]:=0;
fi
endfor
enddef;
@@ -955,7 +964,7 @@ Na:='("{Na}");Ca:='("{Ca}");Hg:='("{Hg}");Ni:='("{Ni}");Ti:='("{Ti}");U:='("U");
R:='("R"); R1:='("{R^1^}"); R2:='("{R^2^}"); R3:='("{R^3^}"); R4:='("R^4^"); R5:='("{R^5^}");
%-------------------------------------------------------------------------------------------------
CHO:='("CHO"); OH:='("OH"); COOH:='("COOH"); CH2:='("C{H_2_}"); CH3:='("C{H_3_}"); CN:='("CN");
-NH2:='("N{H_2_}"); NO2:='("N{O_2_}"); SH:='("SH"); SO3:='("S{O_3_}"); NH:='(N,*/*H);
+NH2:='("N{H_2_}"); NO2:='("N{O_2_}"); SH:='("SH"); SO3:='("S{O_3_}"); NH:='(N,(_postE,H));
NMe:=N!:='(N,/Me); iPr:=Me!:='(/Me,60); tBu:='(/Me,/Me^60,60); SO:='(S,//O);
SOO :='(S,//O^-35,//O^35);
OMe:=O!:='(O,!); OEt:=O!2:='(O,!x2); OPr:=O!3:='(O,!x3); OiPr:=OMe!:='(O,!,iPr);