summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost/mcf2graph
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-08-30 20:49:54 +0000
committerKarl Berry <karl@freefriends.org>2015-08-30 20:49:54 +0000
commit633ddebf6e38c4c7056d98b02896cf8693fabafe (patch)
tree60f3e97822530278b060370262fe2a493588ff45 /Master/texmf-dist/metapost/mcf2graph
parent0fbd23a11cda5bc0444a84d9da29aa004f08dc9f (diff)
mcf2graph (30aug15)
git-svn-id: svn://tug.org/texlive/trunk@38247 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/mcf2graph')
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf44
1 files changed, 25 insertions, 19 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index 8576614b35c..ae32d1dd010 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 3.59 Copyright (c) 2013-2015 Akira Yamaji
+% mcf2graph ver 3.595 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,
@@ -70,11 +70,12 @@ 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;
first_def_number:=500; user_def_number:=2500; ab_def_number:=3000; unit_e:=1/2048;
-lr_margin:=tb_margin:=0.4mm; ratio_chain_ring:= 0.66; ratio_atom_bond:=0.36;
+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;
-ratio_char_bond:=1.5; ratio_bondgap_bond:=0.15; ratio_zebra_gap:=0.12;
-ratio_zebra_black:=0.4; ratio_wedge_bond:=0.15; font_gap:=.066;
-offset_thick#:=0.2pt#; offset_gap#:=0.3pt#; offset_zebra_gap#:=0.1pt#;
+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_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
def def_com(expr n)(text tx)= nA:=n; forsuffixes list=tx:: list:=nA; nA:=nA+1; endfor enddef;
@@ -84,11 +85,14 @@ def_com(-4000)(_term,_jp_atom,_jp_atom_abs,_jp_bond,_cyc,_cyc_sB,_cyc_eB,_set_li
_set_clr,_set_adr,_mk_bond,_set_atom,_arg_ang,_chg_atom,_tmp_rot,_fuse,_push,_pop,_size_a);
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,
+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,
- lr_margin,tb_margin,ratio_atom_bond,ratio_thickness_bond,ratio_char_bond,
- ratio_chain_ring,offset_atom,max_bond_width,ratio_bondgap_bond,ratio_zebra_black,
- ratio_zebra_gap,ratio_wedge_bond,font_gap,offset_zebra_gap,offset_gap,offset_thick
+ 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#,
+ offset_zebra_gap,offset_zebra_gap#,offset_bond_gap,offset_bond_gap#,
+ offset_thickness,offset_thickness#
enddef;
%-------------------------------------------------------------------------------------------------
nA:=0; for list=parameter_list: st_p[incr nA]:=list; endfor
@@ -97,8 +101,10 @@ def restore_par(text t)= nA:=0;
forsuffixes list=t: if list<>st_p[incr nA]: list:=st_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#;
+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#;
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
@@ -121,11 +127,11 @@ def endfont=
enddef;
%-------------------------------------------------------------------------------------------------
def size_setup= BL# := font_wd#*ratio_bond_width;
- wedge_wd# := ratio_wedge_bond*BL#;
- zebra_gap# := ratio_zebra_gap*BL#+offset_zebra_gap#;
+ wedge_wd# := ratio_wedge_bond*BL#+offset_wedge#;
+ zebra_gap# := ratio_zebragap_bond*BL#+offset_zebra_gap#;
AL# := ratio_atom_bond*BL#+offset_atom#;
- gap# := ratio_bondgap_bond*BL#+offset_gap#;
- bond_pen_wd# := ratio_thickness_bond*BL#+offset_thick#;
+ gap# := ratio_bondgap_bond*BL#+offset_bond_gap#;
+ bond_pen_wd# := ratio_thickness_bond*BL#+offset_thickness#;
char_pen_wd# := ratio_char_bond*bond_pen_wd#;
define_pixels(BL,zebra_gap,wedge_wd,AL,gap,bond_pen_wd,char_pen_wd,font_wd,font_ht);
font_size_setup;
@@ -153,8 +159,8 @@ for i=1 upto cntA: xpos:=xpart(posA[i]); ypos:=ypart(posA[i]);
enddef;
%-------------------------------------------------------------------------------------------------
def resize(expr WD,HT)=
- if (len_y/len_x)>(font_ht/font_wd): factor:=(font_ht*HT-2tb_margin)/len_y;
- else: factor:=(font_wd*WD-2lr_margin)/len_x; fi
+ if (len_y/len_x)>(font_ht/font_wd): factor:=(font_ht*HT-2margin_top_bottom)/len_y;
+ else: factor:=(font_wd*WD-2margin_left_right)/len_x; fi
ratio_bond_width:=ratio_bond_width*factor; len_x:=len_x*factor; len_y:=len_y*factor;
enddef;
%-------------------------------------------------------------------------------------------------
@@ -577,12 +583,12 @@ enddef;
def POh= (hP,.25aH)..z19..(fW,.25aH)..(hW,hH)..cycle enddef;
def FD(expr c)(text s)=
if f_FON[ASCII(c)]=1:
- aW:=atom_w[ASCII(c)]*(1-font_gap*2); aH:=atom_h[ASCII(c)]*(1-font_gap*2);
+ aW:=atom_w[ASCII(c)]*(1-ratio_atomgap_atom*2); aH:=atom_h[ASCII(c)]*(1-ratio_atomgap_atom*2);
fW:=aW-hP; hW:=.5aW; fH:=aH-hP; hH:=.5aH;
z01=( 0,hP); z02=(hP, 0); z03=(hP,hP); z05=(aW,hP); z07=(fW, 0); z08=( 0,hH); z09=(hP,hH);
z10=(fW,hH); z12=( 0,fH); z13=(hP,fH); z14=(hW,fH); z16=(aW,fH); z18=(hP,aH); z19=(hW,hP);
s;
- atom_font[ASCII(c)]:=currentpicture shifted (font_gap*AL,font_gap*AL);
+ atom_font[ASCII(c)]:=currentpicture shifted (ratio_atomgap_atom*AL,ratio_atomgap_atom*AL);
clearxy; save x,y; clearit; fi
enddef;
%-------------------------------------------------------------------------------------------------