summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-02-06 23:08:31 +0000
committerKarl Berry <karl@freefriends.org>2016-02-06 23:08:31 +0000
commit271b5e39301a387f969ef73ea8d24eb4f087d8da (patch)
tree48805808c93aeebe7a24cd0ab78a8b0a7aeb55a6 /Master/texmf-dist/metapost
parent52e9577d57804c7b92390862d0058a88a346a870 (diff)
mcf2graph (7feb16)
git-svn-id: svn://tug.org/texlive/trunk@39605 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf31
1 files changed, 18 insertions, 13 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index c8d36c276d7..59907975a36 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 3.78 Copyright (c) 2013-2016 Akira Yamaji
+% mcf2graph ver 3.80 Copyright (c) 2013-2016 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,
@@ -20,7 +20,7 @@
% Molecular Coding Format(MCF) to font(pk)/eps/sgv/png/mdl molfile(V2000)
%----------------------------------------------------------------------------------------------
% This package is located at : http://www.ctan.org/pkg/mcf2graph
-% Suggestion or request mail to : akira.yamaji5@gmail.com
+% 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
@@ -30,7 +30,7 @@
% Set output checklist : mpost -s ahlength=2 FILENAME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tracingstats:=1;
-message " This is mcf2graph ver 3.7 2016.1";
+message " This is mcf2graph ver 3.8 2016.2";
%-------------------------------------------------------------------------------------------------
pair posB[],posA[],pairT,Ls,Le,pairA;
numeric angB[],angA[],br_ang[],sB[],eB[],f_FON[],atom_w[],atom_h[],atom_d[],strA[],stkB[],stkA[],
@@ -68,8 +68,9 @@ else: f_MP:=0;
clearit; chem_structure:=currentpicture;
%-------------------------------------------------------------------------------------------------
let DIV= /; let MUL= *; let LT= <; let GT= >; let AND= &; let :: = : ; let == = =;
+primarydef a SUB b = a-b enddef;
?3:=?20:=Ph:=Ph1:=Ph2:=hz:=0; vt:=1;
-first_def_number:=500; user_def_number:=2500; ab_def_number:=3000; unit_e:=1/2048;
+first_def_number:=500; user_def_number:=2500; ab_def_number:=3000;
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_zebragap_bond:=0.12;
@@ -82,7 +83,7 @@ def def_com(expr n)(text tx)= nA:=n; forsuffixes list=tx:: list:=nA; nA:=nA+1; e
def_com(-4000)(_term,_jp_atom,_jp_atom_abs,_jp_bond,_cyc,_cyc_sB,_cyc_eB,_set_line,_chg_line,
_dl,_tmp_line,_chg_len,_get_len,_ring_len,_tmp_len,_rot_ang,_set_ang,_adj_ang,_chg_env,
_tmp_env,_set_colorA,_set_colorB,_postA,_postB,_postC,_postD,_postE,_postF,_set_psA,
- _skeletonA_end,_skeletonB_end,
+ _skeletonA_end,_skeletonB_end,_stack_reset,
_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);
%-------------------------------------------------------------------------------------------------
@@ -175,18 +176,19 @@ def font_use_check=
enddef;
%-------------------------------------------------------------------------------------------------
def set_def_MC=
- save /,*,//,/*,*/,**,~,^,`,{,},<,>,&,&#,:,=,\,\\,*\,\*,@,$,#,|,d,w,z,inside_def_MC;
+ save /,*,//,/*,*/,**,~,^,`,{,},<,>,&,&#,:,=,\,\\,*\,\*,@,$,#,|,||,d,w,z,inside_def_MC;
inside_def_MC:=1; d:=dl; w:=wf; z:=zf;
vardef $(text a)tertiary b == $$(a)(b) enddef; tertiarydef a=b == $$(a)(b) enddef;
vardef @(text a)tertiary b == @@(a)(b) enddef; tertiarydef a:b == @@(a)(b) enddef;
- vardef #primary n == n MUL unit_e enddef;
+ vardef #primary a == if numeric a:: a-4095 elseif pair a:: a+(0,-4095) fi enddef;
def &primary n ==(_cyc,n) enddef; def &# == & # enddef;
tertiarydef a^b == (_tmp_rot,b),a enddef; tertiarydef a`b == (_tmp_len,b),a enddef;
tertiarydef a>b == (_tmp_env,b),a enddef; tertiarydef a~b == (_tmp_line,b),a enddef;
def * == (0,1) enddef; def \ == *,0 enddef; def \\ == *,0~dm enddef;
def *\ == *,0~wf enddef; def \* == *,0~zf enddef;
def { == (_push,1) enddef; def } == (_pop,1) enddef;
- def {{ == (_push,0) enddef; def }} == (_pop,0) enddef; def | == {,} enddef;
+ def {{ == (_push,0) enddef; def }} == (_pop,0) enddef;
+ def | == {,} enddef; def || == (_stack_reset,0) enddef;
def >>primary n == (_chg_env,n) enddef; def ``primary n == (_chg_len,n) enddef;
def <primary n == (_rot_ang,n) enddef;
def /secondary n == (_postA,n) enddef; def //secondary n == (_postB,n) enddef;
@@ -214,7 +216,7 @@ enddef;
def !?(expr a)(expr b) =
PB(_jp_bond,a) PB(_get_len,a) PB(_push,0)
PB(_chg_len,_ring_len) for i==1 upto b-2:: PB(_mk_bond,360 DIV b) endfor PB(_pop,0)
- if a>=1:: PB(_cyc_eB,0) elseif a<=0:: PB(_cyc_eB,a-b+2) else:: PB(_cyc_eB,a) fi
+ if a>=1:: PB(_cyc_eB,0) elseif a>=-999:: PB(_cyc_eB,a-b+2) else:: PB(_cyc_eB,a) fi
enddef;
%-------------------------------------------------------------------------------------------------
def !!?(expr a)(expr b)(expr c) =
@@ -380,6 +382,7 @@ def proc_bond_atom(expr n)=
if par=1: if lineT<>si: f_lineT:=1; fi if rotT<>0: f_rotT:=1; fi
if lenT<>crR: f_lenT:=1; fi if envT<>hz: f_envT:=1; fi fi
if 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;
@@ -423,14 +426,16 @@ 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;
fi
endfor
enddef;
%-------------------------------------------------------------------------------------------------
-vardef getA(expr n)= if n>=1: stkA[adrS+1]+n elseif n<=-1: cntA+n+1
- elseif n>0: stkA[adrS]+2048n elseif n<0: -2048n fi enddef;
-vardef getB(expr n)= if n>=1: stkB[adrS+1]+n elseif n<=-1: cntB+n+1 elseif n=0: tempB
- elseif n>0: stkB[adrS]+2048n elseif n<0: -2048n fi enddef;
+vardef getA(expr n)=
+ if n>=0: stkA[adrS+1]+n elseif n>=-999: cntA+n+1 else: stkA[adrS]+n+4095 fi enddef;
+vardef getB(expr n)=
+ if n>=1: stkB[adrS+1]+n elseif n=0: tempB elseif n>=-999: cntB+n+1 else: stkB[adrS]+n+4095 fi
+enddef;
def termA= if f_term=0: if f_bra=0: strA[incr cntA]:=strAT; strAT:=0;
if f_MP=1: colorA[cntA]:=0; fi else: f_bra:=0; fi f_term:=1; fi enddef;
def termB=