From 575f2bbe8910ca23531c9bbadb78f3334be696e2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 1 Sep 2015 21:49:29 +0000 Subject: mcf2graph (1sep15) git-svn-id: svn://tug.org/texlive/trunk@38266 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'Master/texmf-dist/metapost') diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf index ae32d1dd010..c7beb8ad15a 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 3.595 Copyright (c) 2013-2015 Akira Yamaji +% mcf2graph ver 3.61 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, @@ -30,7 +30,7 @@ % Set output checklist : mpost -s ahlength=2 FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tracingstats:=1; -message " This is mcf2graph ver 3.5 2015.8 "; +message " This is mcf2graph ver 3.6 2015.9 "; newinternal com,par,cntA,cntB,adrS,adrA,adrB,dx,nX,i,u,j,k,v,xp,yp,nA,nB; %------------------------------------------------------------------------------------------------- pair posB[],posA[],pairT,Ls,Le,pairA; @@ -45,7 +45,7 @@ picture atom_font[],chem_structure,temp_picture; sw_numberA:=sw_numberB:=sw_mol_frame:=sw_logout:=sw_solid:=sw_expand:=sw_start_vector:=0; sw_font_frame:=sw_atom_frame:=sw_checklist:=sw_MOLfile:=0; sw_info_file:=sw_info_char:=1; sw_info_lenx:=sw_info_leny:=sw_info_weight:=sw_info_formula:=0; -char_num:=str_cnt:=size_changed:=proc_end:=0; +char_num:=str_cnt:=proc_end:=0; if known green: f_MP:=1; mp_log_name:=jobname&"-info.aux"; if ahlength=1: proc_end:=1; fi % first molecular only @@ -74,7 +74,7 @@ margin_left_right:=margin_top_bottom:=0.4mm; ratio_chain_ring:= 0.66; ratio_a ratio_thickness_bond:=0.015; offset_atom#:=0.8pt#; max_bond_width:=0.25; ratio_char_bond:=1.5; ratio_bondgap_bond:=0.15; ratio_zebragap_bond:=0.12; ratio_zebra_black:=0.4; ratio_wedge_bond:=0.12; ratio_atomgap_atom:=.050; -offset_thickness#:=0.2pt#; offset_bond_gap#:=0.3pt#; offset_zebra_gap#:=0.1pt#; +offset_thickness#:=0.2pt#; offset_bond_gap#:=0.3pt#; offset_zebra_gap#:=0.1pt#; offset_wedge#:=0.4pt#; par_s=ASCII("{"); par_e=ASCII("}"); score_u=ASCII("_"); hat=ASCII("^"); max_info_num:=12; for i:=1 upto max_info_num: info[i]:=":"; endfor @@ -86,8 +86,8 @@ def_com(-4000)(_term,_jp_atom,_jp_atom_abs,_jp_bond,_cyc,_cyc_sB,_cyc_eB,_set_li def_com(1)(si,dl,dr,dm,tm,wf,wb,bd,zf,zb,ov,dt,no,ar,vf,vb,wv,nl); %------------------------------------------------------------------------------------------------- def parameter_list= - sw_checklist,sw_numberA,sw_numberB,sw_mol_frame,sw_logout,sw_solid,sw_expand, - sw_MOLfile,sw_start_vector,sw_atom_frame,sw_font_frame, + sw_checklist,sw_numberA,sw_numberB,sw_mol_frame,sw_logout,sw_solid,sw_expand,sw_MOLfile, + sw_start_vector,sw_atom_frame,sw_font_frame, margin_left_right,margin_top_bottom,ratio_atom_bond,ratio_thickness_bond,ratio_char_bond, ratio_chain_ring,offset_atom,offset_atom#,max_bond_width,ratio_bondgap_bond,ratio_zebra_black, ratio_zebragap_bond,ratio_wedge_bond,ratio_atomgap_atom,offset_wedge,offset_wedge#, @@ -95,22 +95,22 @@ def parameter_list= offset_thickness,offset_thickness# enddef; %------------------------------------------------------------------------------------------------- -nA:=0; for list=parameter_list: st_p[incr nA]:=list; endfor -def store_par(text t)= nA:=0; for list=t: if st_p[incr nA]<>list: st_p[nA]:=list; fi endfor enddef; +nA:=0; for list=parameter_list: stock_p[incr nA]:=list; endfor +def store_par(text t)= + nA:=0; for list=t: if stock_p[incr nA]<>list: stock_p[nA]:=list; fi endfor enddef; def restore_par(text t)= nA:=0; - forsuffixes list=t: if list<>st_p[incr nA]: list:=st_p[nA]; fi endfor + forsuffixes list=t: if list<>stock_p[incr nA]: list:=stock_p[nA]; fi endfor enddef; %------------------------------------------------------------------------------------------------- def beginfont(text s)= - mol_name:=mol_formula:=""; len_x:=len_y:=cntA:=info_num:=mol_weight:=0; - store_par(parameter_list); - ratio_bond_width:=1mm#/font_wd#; + mol_name:=mol_formula:=""; len_x:=len_y:=cntA:=info_num:=mol_weight:=f_beginchar:=0; + store_par(parameter_list); stock_wd#:=font_wd#; stock_ht#:=font_ht#; + ratio_bond_width:=1/30; for list=s: info_num:=info_num+1; info[info_num]:=list; if substring (0,2) of list="EN": mol_name:=substring (3,length(list)) of list; fi if substring (0,2) of list="FM": mol_formula:=substring (3,length(list)) of list; fi if substring (0,2) of list="MW": mol_weight:=scantokens(substring (3,length(list)) of list); fi endfor - beginchar(char_num,font_wd#,font_ht#,0); clearit; enddef; %------------------------------------------------------------------------------------------------- def endfont= @@ -119,10 +119,10 @@ def endfont= if sw_logout=1: logfile_out; fi if sw_checklist=1: checklist_out; fi if sw_MOLfile=1: MOL_out; fi - char_num:=char_num+1; currentpicture:=chem_structure; chem_structure:=nullpicture; - restore_par(parameter_list); - if size_changed=1: font_wd#:=stock_wd#; font_ht#:=stock_ht#; size_changed:=0; fi - endchar; + if f_beginchar=1: + char_num:=char_num+1; currentpicture:=chem_structure; chem_structure:=nullpicture; + endchar; fi + restore_par(parameter_list); font_wd#:=stock_wd#; font_ht#:=stock_ht#; if proc_end=1: scantokens("bye"); fi enddef; %------------------------------------------------------------------------------------------------- @@ -289,6 +289,7 @@ def AUX(expr a,b)(text s)=s addto chem_structure also currentpicture shifted(a,b def MCf(text s)= MCd(1,1)(.5,.5)(s); enddef; %------------------------------------------------------------------------------------------------- def MCd(expr RW,RH)(expr FW,FH)(text s)= + if f_beginchar=0: beginchar(char_num,font_wd#,font_ht#,0); clearit; f_beginchar:=1; fi mc_num:=user_def_number; ab_num:=ab_def_number; chainRT:=-ratio_chain_ring; adrA:=adrB:=cntA:=cntB:=adrS:=cntPS:=angA[0]:=angB[0]:=br_ang[0]:=sB[0]:=cntC:=cntP:=0; stkA[0]:=stkB[0]:=stkL[0]:=stkM[0]:=strAT:=f_lineT:=f_lenT:=f_envT:=f_rotT:=0; -- cgit v1.2.3