From a33f60e20f19ec0a00810f07db905f91903845ab Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Nov 2018 21:55:22 +0000 Subject: mcf2graph (11nov18) git-svn-id: svn://tug.org/texlive/trunk@49129 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 65 ++++++++++++++--------- 1 file changed, 40 insertions(+), 25 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 e2f44387b1d..3e9507270bc 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 4.33 Copyright (c) 2013-2018 Akira Yamaji +% mcf2graph ver 4.34 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, @@ -22,17 +22,20 @@ % This package is located at : http://www.ctan.org/pkg/mcf2graph % Suggestion or request mail to : mcf2graph@gmail.com %---------------------------------------------------------------------------------------------- -% Set output no image file : mpost -s ahangle=0 FILENAME -% Set outputformat to "png" : mpost -s ahangle=1 FILENAME -% Set outputformat to "svg" : mpost -s ahangle=2 FILENAME -% Set outputformat to MOL(V2000) : mpost -s ahangle=3 FILENAME -% Set outputformat to MOL(V3000) : mpost -s ahangle=4 FILENAME -% Set make first font only : mpost -s ahlength=1 FILENAME -% Set output report : mpost -s ahlength=2 FILENAME -% Set to use plain.mp label,arrow : mpost -s ahlength=3 FILENAME +% Set output no image file : mpost -s bboxmargin=0 FILENAME +% Set output first font only : mpost -s bboxmargin=1 FILENAME +% Set outputformat to "png" : mpost -s ahangle=1 FILENAME +% Set outputformat to "svg" : mpost -s ahangle=2 FILENAME +% Set outputformat to "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 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 +% Set to use plain.mp label,arrow,atom : mpost -s labeloffset=2 FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tracingstats:=1; -message " This is mcf2graph ver 4.3 2018.06"; +message " This is mcf2graph ver 4.3 2018.11"; %------------------------------------------------------------------------------------------------- newinternal nA,nB,nC,nD,nE,nF,char_num,str_cnt,sub_usr,sub_int,tbl_cnt,sharp_char; numeric save_para[],comD[][],parD[][],cntD[],tbl_str_wd[],tbl_atom[],tbl_subst[][],tbl_atom_wt[], @@ -44,7 +47,7 @@ path arrow_path,arrow_head; %------------------------------------------------------------------------------------------------- char_num:=str_cnt:=proc_end:=sw_label_emu:=0; sw_numberA:=sw_numberB:=sw_mol_frame:=sw_aux_out:=sw_solid:=sw_expand:=sw_font_frame:=sw_clip:=0; -sw_atom_frame:=sw_report:=sw_mol_out:=sw_subst_off:=sw_bond_single:=sw_auxfix:=sw_arrow:=0; +sw_atom_frame:=sw_rep_out:=sw_mol_out:=sw_subst_off:=sw_bond_single:=sw_auxfix:=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 @@ -54,18 +57,30 @@ if (known green)and(known ahlength): color color_list[]; atomfont:=defaultfont:=""; mp_log_name:=jobname&"-info.aux"; - if ahlength=1: proc_end:=1; % first molecular only - elseif ahlength=2: sw_report:=1; def shipit = enddef; % report on - elseif ahlength=3: sw_arrow:=1; defaultfont:="uhvr8r"; % use mp label - elseif ahlength=5: sw_arrow:=1; defaultfont:=atomfont:="uhvr8r"; % use mp atom,label + prologues:=3; + %-- default bboxmargin=2------------------------------------------------------------------ + if bboxmargin=0: def shipit = enddef; % No image file + elseif bboxmargin=1: proc_end:=1; % output first font only fi - if ahangle=0: def shipit = enddef; % No image file - elseif ahangle=1: outputformat:="png"; hppp:=vppp:=0.1; % PNG format - elseif ahangle=2: outputformat:="svg"; prologues:=3; % SVG format - elseif ahangle=3: sw_mol_out:=1; def shipit = enddef; % output MOL V2000 - elseif ahangle=4: sw_mol_out:=2; def shipit = enddef; % output MOL V3000 + %--default ahangle=45--------------------------------------------------------------------- + if ahangle=1: outputformat:="png"; hppp:=vppp:=0.1; % png format + elseif ahangle=2: outputformat:="svg"; % svg format + elseif ahangle=3: outputformat:="eps"; % eps format(.eps) + fi + %--default ahlength=4--------------------------------------------------------------------- + if ahlength=1: sw_aux_out:=1; % output aux + elseif ahlength=2: sw_rep_out:=1; % output report + elseif ahlength=5: sw_mol_out:=1; % output MOL V2000 + elseif ahlength=6: sw_mol_out:=2; % output MOL V3000 + fi + %--default labeloffset=3------------------------------------------------------------------ + if labeloffset=1: sw_arrow:=1; defaultfont:="uhvr8r"; % plain.mp label + elseif labeloffset=2: sw_arrow:=1; defaultfont:=atomfont:="uhvr8r"; % plain.mp label,atom + fi + %----------------------------------------------------------------------------------------- + if (outputformat="eps")and(ahangle<>3): outputtemplate:="%j-%3c."&"mps"; + else: outputtemplate:="%j-%3c."&outputformat; fi - outputtemplate:="%j-%3c."&outputformat; def beginchar(expr a,b,c,d)= beginfig(a) w:=b*pt; h:=c*pt; enddef; def endchar = endfig enddef; def printf expr s= write s to mp_log_name enddef; @@ -80,7 +95,6 @@ else: f_MP:=0; def color = transform enddef; def printf expr s= message s enddef; sw_arrow:=0; - dotlabeldiam:=3bp; %----------------------------------------------------------------------- atomfont:="draw"; defaultfont:="draw"; @@ -104,6 +118,7 @@ font_wd:=30mm; font_ht:=20mm; %================================================================================================== ahangle:=45; ahlength:=4bp; +bboxmargin:=2bp; defaultsize:=8bp; atomfontsize:=8bp; defaultscale:=1; @@ -123,7 +138,7 @@ def_com(-4000)(_term,_jp_atom,_jp_atom_abs,_jp_bond,_cyc,_cyc_sB,_cyc_eB,_set_li 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_report,sw_numberA,sw_numberB,sw_mol_frame,sw_aux_out,sw_solid,sw_expand,sw_mol_out, + sw_rep_out,sw_numberA,sw_numberB,sw_mol_frame,sw_aux_out,sw_solid,sw_expand,sw_mol_out, sw_atom_frame,sw_font_frame,sw_subst_off,sw_bond_single,sw_clip,sw_arrow,sw_label_emu, margin_left_right,margin_top_bottom,ratio_atom_bond,ratio_thickness_bond,ratio_char_bond, ratio_chain_ring,ratio_bondgap_bond,ratio_zebra_black,ratio_zebragap_bond,ratio_thickness_char, @@ -563,7 +578,7 @@ def MCd(expr RW,RH)(expr FW,FH)(text TX)= addto mol_stru[cntM] also currentpicture; clearit; endgroup; - if ((sw_aux_out=1)or(sw_report=1)or(sw_mol_out>=1))and(f_MP=1): proc_calc_out; fi + if ((sw_aux_out=1)or(sw_rep_out=1)or(sw_mol_out>=1))and(f_MP=1): proc_calc_out; 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); @@ -1313,7 +1328,7 @@ def proc_calc_out= cal_MI:=substring (0,10) of decimal(MI_num); cal_MW:=substring (0,8) of decimal(MW_num); if sw_aux_out=1: proc_auxfile_out; fi - if sw_report=1: proc_report_out; fi + if sw_rep_out=1: proc_report_out; fi if sw_mol_out>=1: proc_mol_out; fi endgroup enddef; -- cgit v1.2.3