diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-05 20:49:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-05 20:49:13 +0000 |
commit | 7231d49bcafc5733408aa9592f44bfe5a35c10e2 (patch) | |
tree | 4f3b8999fc56cfc633b0de3249d22c4311f6b8a5 /Master/texmf-dist/metapost | |
parent | fd3f07fb7823629298e24465fb201600bf70f608 (diff) |
mcf2graph
git-svn-id: svn://tug.org/texlive/trunk@52292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r-- | Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 187 |
1 files changed, 93 insertions, 94 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf index 0906454eb51..8de584bebee 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 4.44 Copyright (c) 2013-2019 Akira Yamaji +% mcf2graph ver 4.45 Copyright (c) 2013-2019 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, @@ -28,8 +28,9 @@ % Set outputformat to "png" : mpost -s ahangle=1 FILENAME % Set outputformat to "svg" : mpost -s ahangle=2 FILENAME % Set outputformat to "eps" (.eps) : mpost -s ahangle=3 FILENAME -% Set output aux file : mpost -s ahlength=1 FILENAME -% Set output report : mpost -s ahlength=2 FILENAME +% Set output aux file (tag1:var1;tag2:var2) : mpost -s ahlength=1 FILENAME +% Set output aux file (tag1;tag2 var1;var2) : mpost -s ahlength=2 FILENAME +% Set output report : mpost -s ahlength=3 FILENAME % Set output MOL(V2000) : mpost -s ahlength=5 FILENAME % Set output MOL(V3000) : mpost -s ahlength=6 FILENAME % Set to use plain.mp (label,arrow) : mpost -s labeloffset=1 FILENAME @@ -46,9 +47,9 @@ pair save_pair[],msize,mposition,fsize,fmargin,save_mposition; picture mol_stru[],save_picture,temp_picture; path arrow_path,arrow_head; %------------------------------------------------------------------------------------------------- -char_num:=str_cnt:=proc_end:=mangle:=sw_label_emu:=sw_calc:=sw_extall:=0; -sw_numberA:=sw_numberB:=sw_mframe:=sw_aux_out:=sw_expand:=sw_fframe:=sw_trimming:=0; -sw_aframe:=sw_rep_out:=sw_mol_out:=sw_subst_off:=sw_single:=sw_auxfix:=sw_arrow:=0; +char_num:=str_cnt:=proc_end:=mangle:=sw_label_emu:=sw_calc:=sw_ext_all:=0; +sw_numberA:=sw_numberB:=sw_aux_out:=sw_expand:=sw_fframe:=sw_mframe:=sw_aframe:=sw_trimming:=0; +sw_rep_out:=sw_mol_out:=sw_subst_off:=sw_single:=sw_arrow:=0; numberA_start:=numberB_start:=1; numberA_end:=numberB_end:=4095; aux_max:=max_inf_num:=20; aux_delimiter:=";"; var1:="jobname"; tag1:="F"; var2:="char_num"; tag2:="C"; for i=3 upto aux_max: var[i]:=tag[i]:=""; endfor @@ -76,7 +77,8 @@ if (known green)and(known ahlength): fi %--default ahlength=4--------------------------------------------------------------------- if ahlength=1: sw_aux_out:=1; bboxmargin:=0; % output aux file - elseif ahlength=2: sw_rep_out:=1; bboxmargin:=0; % output report + elseif ahlength=2: sw_aux_out:=2; bboxmargin:=0; % output aux file(fixed mode) + elseif ahlength=3: sw_rep_out:=1; bboxmargin:=0; % output report elseif ahlength=5: sw_mol_out:=1; bboxmargin:=0; % output MOL(V2000) elseif ahlength=6: sw_mol_out:=2; bboxmargin:=0; % output MOL(V3000) fi @@ -98,7 +100,6 @@ if (known green)and(known ahlength): def # = enddef; vardef totalweight expr a= 0 enddef; def Cp(expr s) = if known s: if s<>0: withcolor color_list[s] fi fi enddef; - def ext(text TXT)= sw_extall:=sw_calc:=1; def EXTALL = TXT enddef; enddef; if atomfont="": atomfont:="draw"; fi % default atom font if defaultfont="": defaultfont:="draw"; fi % default label font %----------------------------------------------------------------------------------------- @@ -113,7 +114,6 @@ else: f_MP:=0; dotlabeldiam:=3bp; def Cp(expr s) = enddef; def color = transform enddef; - def ext(text TXT)= enddef; sw_arrow:=0; atomfont:="draw"; defaultfont:="draw"; @@ -122,11 +122,17 @@ fi clearit; %-------------------------------------------------------------------------------------------------- message "---------------------------------------------"; -message "This is mcf2graph ver 4.44 2019.07"; +message "This is mcf2graph ver 4.45 2019.10"; if f_MP=1: + if bboxmargin=0: message "output no image file"; + elseif bboxmargin=1: message "output first font only"; + fi + message "jobname="&jobname; message "numbersystem="&numbersystem; if ahlength=1: message "output aux file"; message "out_file_aux="&out_file_aux; + message "aux_delimiter="&aux_delimiter; + message "aux_delimiter="&aux_delimiter; elseif ahlength=2: message "output report file"; message "out_file_rep="&out_file_rep; elseif ahlength=5: message "output MOL file(V2000)"; @@ -134,16 +140,11 @@ if f_MP=1: elseif ahlength=6: message "output MOL file(V3000)"; message jobname&"-nnn-"&"inf_EN"&".mol"; fi - if bboxmargin=0: - message "No image file"; - else: - if outputformat="png": - message "outputformat="&outputformat &" / ppp="&decimal(hppp); - else: - message "outputformat="&outputformat; - fi - message "outputtemplate="&outputtemplate; - fi + message "outputformat="&outputformat; + if outputformat="png": message "hppp="&decimal(hppp)&"/vppp="&decimal(vppp); fi + message "outputtemplate="&outputtemplate; + message "atomfont="&atomfont; + message "defaultfont="&defaultfont; fi message "---------------------------------------------"; %-------------------------------------------------------------------------------------------------- @@ -151,6 +152,8 @@ let DIV= /; let MUL= *; let LT= <; let GT= >; let AND= &; let :: = : ; let == = %-------------------------------------------------------------------------------------------------- primarydef a at b = fat(a,b) enddef; def fat(expr a,b)= mposition:=b; a enddef; +def ext(text TXT)= sw_ext_all:=1; def EXT_ALL = TXT enddef; enddef; +def ext_clear= sw_ext_all:=0; def EXT_ALL = enddef; enddef; %-------------------------------------------------------------------------------------------------- ?3:=?20:=Ph:=Ph1:=Ph2:=hz:=0; vt:=1; ratio_chain_ring:= 0.66; ratio_atom_bond:=0.36; @@ -180,14 +183,14 @@ 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,_postG,_postH, + _tmp_env,_set_colorA,_set_colorB,_substA,_substB,_substC,_substD,_substE,_substF,_substG,_substH, _set_clr,_set_adr,_mk_bond,_set_atom,_arg_ang,_chg_atom,_tmp_rot,_fuse,_push,_pop, _size_a,_numeric,_jump_at,_connect_at,_set_and,_chg_charge,_nop); def_com(1)(si,dl,dr,db,dm,tm,wf,wb,bd,bz,zf,zb,dt,wv,nl,vf,vb,si_,wf_,wb_,bd_); %-------------------------------------------------------------------------------------------------- def parameter_list= - sw_rep_out,sw_numberA,sw_numberB,sw_mframe,sw_aux_out,sw_expand,sw_mol_out,sw_calc,sw_extall, - sw_aframe,sw_fframe,sw_subst_off,sw_single,sw_trimming,sw_arrow,sw_label_emu, + sw_rep_out,sw_numberA,sw_numberB,sw_mframe,sw_aux_out,sw_expand,sw_mol_out,sw_calc,sw_single, + sw_ext_all,sw_aframe,sw_fframe,sw_subst_off,sw_trimming,sw_arrow,sw_label_emu, ratio_atom_bond,ratio_thickness_bond,ratio_char_bond, ratio_chain_ring,ratio_bondgap_bond,ratio_zebra_black,ratio_zebragap_bond,ratio_thickness_char, ratio_wedge_bond,ratio_atomgap_atom,lonepairdiam,lonepairspace, @@ -271,7 +274,7 @@ def beginfont(text s)= enddef; %================================================================================================== def endfont= - if (f_MP=1)and(sw_extall=1): ext_font(EXTALL); fi + if sw_ext_all=1: ext_font(EXT_ALL); fi if sw_trimming>=1: nA:=nC:=4095; nB:=nD:=-4095; for i=1 upto cntM: @@ -308,27 +311,23 @@ def endfont= enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% def set_def_MC= - save /,//,/*,*/,**,*/*,~,~~,^,^^,`,'`,<,>,>>,:>,&,:,=,\,\\,*\,\*,*\*,@,$,{,},#, + save /,//,/*,*/,**,*/*,~,^,`,<,>,>>,&,:,=,\,\\,*\,\*,*\*,@,$,{,},#, |,||,|<,>|,|<=,|=,=|,|:,:|,_,d,w,z,inside_def_MC; inside_def_MC:=1; _:=Me; d:=db; w:=wf; z:=zf; tertiarydef a=b == if (known a)and(known b):: change_bond(a,b) else:: _nop fi enddef; tertiarydef a:b == if (known a)and(known b):: change_atom(a,b) else:: _nop fi enddef; - def { == '''( enddef; + def { == read_number( enddef; let } == ); def &primary s == (_set_and,ASCII(s)) enddef; vardef $primary a == a-4095 enddef; - def ^^primary n == (_tmp_rot,n) enddef; def ``primary n == (_chg_len,n) enddef; - def '`primary n == (_tmp_len,n) enddef; def <primary n == (_rot_ang,n) enddef; def >>primary n == (_chg_env,n) enddef; - def ~~primary n == (_tmp_line,n) enddef; - def :>primary n == (_tmp_env,n) enddef; - tertiarydef a^b == if known b:: ^^b,a else:: _nop,a fi enddef; - tertiarydef a`b == if known b:: '`b,a else:: _nop,a fi enddef; - tertiarydef a~b == if known b:: ~~b,a else:: _nop,a fi enddef; - tertiarydef a>b == if known b:: :>b,a else:: _nop,a fi enddef; + tertiarydef a^b == if known b:: (_tmp_rot,b),a else:: _nop,a fi enddef; + tertiarydef a`b == if known b:: (_tmp_len,b),a else:: _nop,a fi enddef; + tertiarydef a~b == if known b:: (_tmp_line,b),a else:: _nop,a fi enddef; + tertiarydef a>b == if known b:: (_tmp_env,b),a else:: _nop,a fi enddef; def # == _connect_at enddef; def @ == _jump_at enddef; def \ == @,0 enddef; @@ -344,17 +343,17 @@ def set_def_MC= def =| == (_pop,0) enddef; def | == (_push,2) enddef; def || == (_pop,2) enddef; - def /secondary n == if known n:: (_postA,n) else:: _nop fi enddef; - def //secondary n == if known n:: (_postB,n) else:: _nop fi enddef; - def */secondary n == if known n:: (_postC,n) else:: _nop fi enddef; - def /*secondary n == if known n:: (_postD,n) else:: _nop fi enddef; - def **secondary n == if known n:: (_postF,n) else:: _nop fi enddef; - def */*secondary n == if known n:: (_postG,n) else:: _nop fi enddef; + def /secondary n == if known n:: (_substA,n) else:: _nop fi enddef; + def //secondary n == if known n:: (_substB,n) else:: _nop fi enddef; + def */secondary n == if known n:: (_substC,n) else:: _nop fi enddef; + def /*secondary n == if known n:: (_substD,n) else:: _nop fi enddef; + def **secondary n == if known n:: (_substF,n) else:: _nop fi enddef; + def */*secondary n == if known n:: (_substG,n) else:: _nop fi enddef; enddef; %================================================================================================= -vardef '(text TXT)= ''(incr sub_usr)(TXT); sub_usr enddef; +vardef '(text TXT)= read_command(incr sub_usr)(TXT); sub_usr enddef; %------------------------------------------------------------------------------------------------- -def ''(expr ADR)(text TXT)= +def read_command(expr ADR)(text TXT)= begingroup save list_cnt; if unknown inside_def_MC:: set_def_MC fi @@ -394,7 +393,7 @@ def ''(expr ADR)(text TXT)= endgroup enddef; %------------------------------------------------------------------------------------------------- -vardef '''(text TXT)= +vardef read_number(text TXT)= sub_int:=sub_int+1; cntD[sub_int]:=0; for list==TXT:: @@ -475,7 +474,7 @@ vardef change_atom(expr a,b)= if (b>=H)and(b<=U):: if b==N:: PP(a,_N) elseif b==O:: PP(a,_O) elseif b==S:: PP(a,_S) else:: PX(a)(_chg_atom,b) fi - ef b==NH:: PA(_set_clr,1) PP(a,_N) PX(a)(_postH,H) PA(_set_clr,0) + ef b==NH:: PA(_set_clr,1) PP(a,_N) PX(a)(_substH,H) PA(_set_clr,0) ef b==_jump_at:: PA(_jp_atom,a) ef b==_connect_at:: PA(_cyc,a) fi @@ -743,7 +742,7 @@ def sub_add(expr a,b)= enddef; %------------------------------------------------------------------------------------------------- def sub_add_op(expr a,b)= - op_cnt[cntP]:=op_cnt[cntP]+1; op_com[cntP][op_cnt[cntP]]:=a; op_par[cntP][op_cnt[cntP]]:=b; + op_cnt[cntS]:=op_cnt[cntS]+1; op_com[cntS][op_cnt[cntS]]:=a; op_par[cntS][op_cnt[cntS]]:=b; enddef; %------------------------------------------------------------------------------------------------- def sub_pro(expr a,b)= @@ -769,7 +768,7 @@ enddef; %------------------------------------------------------------------------------------------------- def MC(text TXT)= begingroup - save com,par,adrA,adrB,f_bra,envT,envB,lenT,lineT,strAT,stkA,stkB,stkL,stkM,cntP,bondL,temp_len, + save com,par,adrA,adrB,f_bra,envT,envB,lenT,lineT,strAT,stkA,stkB,stkL,stkM,cntS,bondL,temp_len, temp_cntB,f_end,f_term,rotT,adrS,f_at,f_lineT,f_rotT,f_lenT,f_envT,angT,tempB,tempA, maxX,maxY,f_char,ps_adr,ps_com,sA,sC,sD,pA,pB,factor,m_wd,m_ht, op_com,op_par,op_cnt,crR,colorA,colorB,PA,PO,PP,PX,defaultsize,defaultscale; @@ -788,18 +787,18 @@ def MC(text TXT)= if (sw_expand=1)or(sw_mol_out>=1): expand_set; fi sub_usr:=sub_usr_start; sub_int:=sub_int_start; - cntA:=cntB:=cntP:=cntC:=0; strD[0]:=""; str_cnt:=2000; crR:=-ratio_chain_ring; + cntA:=cntB:=cntS:=cntC:=0; strD[0]:=""; str_cnt:=2000; crR:=-ratio_chain_ring; %----------------------------------------------------------------------------------------------- font_wd:=xpart(fsize); font_ht:=ypart(fsize); margin_lr:=xpart(fmargin); margin_tb:=ypart(fmargin); %=============================================================================================== - ''(0)(TXT,(_term,0)); + read_command(0)(TXT,(_term,0)); %----------------------------------------------------------------------------------------------- proc_bond_atom(1); %----------------------------------------------------------------------------------------------- - if (cntP>0)and(sw_subst_off=0): post_get(1); fi + if (cntS>0)and(sw_subst_off=0): subst_get(1); fi %----------------------------------------------------------------------------------------------- char_use_check; %-scaling--------------------------------------------------------------------------------------- @@ -898,18 +897,18 @@ def MC(text TXT)= mol_stru[cntM]:=currentpicture; clearit; endgroup; - if ((sw_aux_out=1)or(sw_rep_out=1)or(sw_mol_out>=1)or(sw_calc=1))and(f_MP=1): proc_calc; fi + if ((sw_aux_out>=1)or(sw_rep_out=1)or(sw_mol_out>=1)or(sw_calc=1))and(f_MP=1): proc_calc; fi %----------------------------------------------------------------------------------------------- %%%% message "count of usr ="& decimal(sub_usr) &" "& decimal(sub_usr-sub_usr_start); %%%% message "count of int ="& decimal(sub_int) &" "& decimal(sub_int-sub_int_start); %----------------------------------------------------------------------------------------------- enddef; %------------------------------------------------------------------------------------------------- -def post_put= +def subst_put= begingroup save nA; if f_at=1: nA:=getA(adrT); check_adrA(nA); else: nA:=cntA+1; fi - cntP:=cntP+1; ps_adr[cntP]:=nA; ps_com[cntP]:=par; op_cnt[cntP]:=0; + cntS:=cntS+1; ps_adr[cntS]:=nA; ps_com[cntS]:=par; op_cnt[cntS]:=0; if lineT<>0: PO(_tmp_line,lineT) fi if rotT<>0: PO(_rot_ang,rotT) fi if lenT<>crR: PO(_chg_len,lenT) fi @@ -923,16 +922,16 @@ def post_put= endgroup enddef; %------------------------------------------------------------------------------------------------- -def post_get(expr n)= +def subst_get(expr n)= sub_int:=0; - nA:=cntP; nB:=cntD[0]; - for i=n upto cntP: + nA:=cntS; nB:=cntD[0]; + for i=n upto cntS: PA(_jp_atom_abs,ps_adr[i]) PA(_push,1) for j=1 upto op_cnt[i]: PA(op_com[i][j],op_par[i][j]) endfor for j=1 upto cntD[ps_com[i]]: PA(comD[ps_com[i]][j],parD[ps_com[i]][j]) endfor PA(_pop,1) PA(_term,0) endfor - proc_bond_atom(nB+1); if cntP>nA: post_get(nA+1); fi + proc_bond_atom(nB+1); if cntS>nA: subst_get(nA+1); fi enddef; %------------------------------------------------------------------------------------------------- def draw_frame(expr PS,LX,LY,PN)= @@ -1013,14 +1012,14 @@ def proc_bond_atom(expr n)= ef nC=_mk_bond: if (par=0)and(rotT<>0): rotT:=0; fi add_atom; ef nC=_set_adr: adrT:=par; ef nC=_set_atom: strAT:=par; - ef nC=_postA: post_put; - ef nC=_postB: lineT:=dm; post_put; - ef nC=_postC: lineT:=wf; post_put; - ef nC=_postD: lineT:=zf; post_put; - ef nC=_postE: lineT:=nl; post_put; - ef nC=_postF: lineT:=0; post_put; - ef nC=_postG: lineT:=wv; post_put; - ef nC=_postH: lineT:=nl; lenT:=_size_a; post_put; + ef nC=_substA: subst_put; + ef nC=_substB: lineT:=dm; subst_put; + ef nC=_substC: lineT:=wf; subst_put; + ef nC=_substD: lineT:=zf; subst_put; + ef nC=_substE: lineT:=nl; subst_put; + ef nC=_substF: lineT:=0; subst_put; + ef nC=_substG: lineT:=wv; subst_put; + ef nC=_substH: lineT:=nl; lenT:=_size_a; subst_put; ef nC=_jp_bond: termA; tempB:=getB(par); check_adrB(tempB); sB[cntB+1]:=sB[tempB]; f_bra:=1; ef nC=_jp_atom: termA; tempA:=getA(par); check_adrA(tempA); sB[cntB+1]:=tempA; f_bra:=1; ef nC=_jp_atom_abs: sB[cntB+1]:=par; f_bra:=1; temp_cntB:=cntB; @@ -1106,7 +1105,7 @@ def proc_skeleton= ef nC=_mk_bond: if (par=0)and(rotT<>0):par:=rotT; rotT:=0; fi add_bond(par); ef nC=_rot_ang: angT:=(angT+par) mod 360; ef nC=_tmp_rot: rotT:=par; - ef (nC>=_postA)and(nC<=_postH): rotT:=0; + ef (nC>=_substA)and(nC<=_substH): rotT:=0; ef nC=_chg_env: envB:=par; ef nC=_tmp_env: envT:=par; ef nC=_set_clr: f_at:=par; if par=0: lineT:=si; lenT:=crR; rotT:=envT:=0; fi @@ -1347,7 +1346,7 @@ Li[1]:='("{Li^+^}"); Na[1]:='("{Na^+^}"); Cl[-1]:='("{Cl^-^}"); Br[-1]:='("{Br^- 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,(_postE,H)); +NH2:='("N{H_2_}"); NO2:='("N{O_2_}"); SH:='("SH"); SO3:='("S{O_3_}"); NH:='(N,(_substE,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); @@ -1574,25 +1573,25 @@ def STb(expr ATOM)(text TXT)= enddef; %================================================================================================== tbl_cnt:=0; -STa("C" ,12.0107, 12.0000000); STa("H" , 1.00794, 1.00782503223); -STa("{Al}",26.9815, 26.98153853); STa("{As}",74.9216, 74.92159457); -STa("B" ,10.811, 11.00930536); STa("{Br}",79.904, 78.9183376); -STa("{Ca}",40.078, 39.962590863); STa("{Cl}",35.453, 34.968852); -STa("{Co}",58.933194, 58.93319429); STa("{Cr}",51.9961, 51.94050623); -STa("{Cu}",63.546, 62.92959772); STa("D" ,2.012, 2.01410177812); -STa("F" ,18.9984, 18.99840316273); STa("{Fe}",55.845, 55.93493633); -STa("{Hg}",200.59, 201.97064340); STa("I" ,126.90447,126.9044719); -STa("K" ,39.0983, 38.9637064864); STa("{Li}",6.941, 7.0160034366); -STa("{Mg}",24.305, 23.985041697); STa("{Mn}",54.938044, 54.93804391); -STa("N" ,14.0067, 14.00307400443); STa("{N^+^}",14.0067, 14.00307400443); +STa("C" ,12.0107, 12.0000000); STa("H" , 1.00794, 1.00782503223); +STa("{Al}",26.9815, 26.98153853); STa("{As}",74.9216, 74.92159457); +STa("B" ,10.811, 11.00930536); STa("{Br}",79.904, 78.9183376); +STa("{Ca}",40.078, 39.962590863); STa("{Cl}",35.453, 34.968852); +STa("{Co}",58.933194, 58.93319429); STa("{Cr}",51.9961, 51.94050623); +STa("{Cu}",63.546, 62.92959772); STa("D" ,2.012, 2.01410177812); +STa("F" ,18.9984, 18.99840316273); STa("{Fe}",55.845, 55.93493633); +STa("{Hg}",200.59, 201.97064340); STa("I" ,126.90447,126.9044719); +STa("K" ,39.0983, 38.9637064864); STa("{Li}",6.941, 7.0160034366); +STa("{Mg}",24.305, 23.985041697); STa("{Mn}",54.938044, 54.93804391); +STa("N" ,14.0067, 14.00307400443); STa("{N^+^}",14.0067, 14.00307400443); STa("{N^-^}",14.0067, 14.00307400443); -STa("{Na}",22.98977, 22.9897692820); STa("{Ni}",58.693, 57.93534241); -STa("O" ,15.9994, 15.99491461957); STa("{O^-^}",15.9994, 15.99491461957); -STa("{O^p^}",15.9994, 15.99491461957); STa("P" ,30.973762, 30.97376199842); -STa("S" ,32.065, 31.9720711744); STa("{S^p^}",32.065, 31.9720711744); -STa("{S^m^}",32.065, 31.9720711744); -STa("{Se}",78.971, 79.9165218); STa("{Si}",28.0855, 27.97692653465); -STa("{Sn}",118.71, 119.90220163); STa("{Ti}",47.867, 47.94794198); +STa("{Na}",22.98977, 22.9897692820); STa("{Ni}",58.693, 57.93534241); +STa("O" ,15.9994, 15.99491461957); STa("{O^-^}",15.9994, 15.99491461957); +STa("{O^p^}",15.9994, 15.99491461957); STa("P" ,30.973762, 30.97376199842); +STa("S" ,32.065, 31.9720711744); STa("{S^p^}",32.065, 31.9720711744); +STa("{S^m^}",32.065, 31.9720711744); +STa("{Se}",78.971, 79.9165218); STa("{Si}",28.0855, 27.97692653465); +STa("{Sn}",118.71, 119.90220163); STa("{Ti}",47.867, 47.94794198); STa("{Zn}",65.409, 63.92914201); %-------------------------------------------------------------------------------------------------- STb("{H_2_}")("H","H"); STb("OH")("O","H"); STb("O{Na}")("O","{Na}"); STb("CN")("C","N"); @@ -1658,26 +1657,26 @@ def proc_calc= endfor cal_MI:=substring (0,10) of decimal(num_MI); cal_MW:=substring (0,8) of decimal(num_MW); - if sw_aux_out=1: proc_auxfile_out; fi + if sw_aux_out>=1: proc_auxfile_out; fi if sw_rep_out=1: proc_report_out; fi if sw_mol_out>=1: proc_mol_out; fi endgroup enddef; %================================================================================================== -def auxtag_out= - for i=1 upto aux_max: exitif tag[i]=""; if i=1: printf tag[1] else: &aux_delimiter&tag[i] fi - endfor -enddef; -%================================================================================================== def proc_auxfile_out= message "["&decimal(char_num)&"]:"&inf_EN; out_file_name:=out_file_aux; - for i=1 upto aux_max: exitif tag[i]=""; - if i=1: printf "" else: &aux_delimiter fi if sw_auxfix=0: &tag[i]&":" fi & + if (char_num=1)and(sw_aux_out=2): + printf tag[1] for i=2 upto aux_max: exitif tag[i]=""; &";"&tag[i] endfor ; + fi + for i=1 upto aux_max: exitif tag[i]=""; + if i=1: printf "" else: &aux_delimiter fi + if sw_aux_out=1: &tag[i]&":" fi & if string scantokens(var[i]): scantokens(var[i]) - elseif numeric scantokens(var[i]): decimal(scantokens(var[i])) fi + elseif numeric scantokens(var[i]): decimal(scantokens(var[i])) + fi endfor - if sw_auxfix=0: for i=1 upto inf_num: &aux_delimiter&info[i] endfor; fi + if sw_aux_out=1: for i=1 upto inf_num: &aux_delimiter&info[i] endfor; fi enddef; %================================================================================================== vardef round_auto(expr n)= |