diff options
author | Karl Berry <karl@freefriends.org> | 2020-08-10 21:03:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-08-10 21:03:24 +0000 |
commit | ac19f486a8738d31f57d8017a755088231008738 (patch) | |
tree | dad0a2ade0c0d28e9710a17e83fc5a7514a640d0 /Master/texmf-dist/metapost | |
parent | 6f5713565f4a97d90fca8a6cc5dfa14bf4a7bb42 (diff) |
mcf2graph (10aug20)
git-svn-id: svn://tug.org/texlive/trunk@56086 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r-- | Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf index 5a4802cb487..6011d247e68 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 4.50 Copyright (c) 2013-2020 Akira Yamaji +% mcf2graph ver 4.51 Copyright (c) 2013-2020 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, @@ -51,9 +51,11 @@ path arrow_path,dottedline_path,line_path,arrow_head; 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_group_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 +numberA_start:=numberB_start:=1; numberA_end:=numberB_end:=4095; +%------------------------------------------------------------------------------------------------- +aux_max:=max_inf_num:=20; +aux_delimiter:=";"; +for i=1 upto aux_max: var[i]:=tag[i]:=""; endfor %================================================================================================= if (known green)and(known ahlength): f_MP:=1; @@ -124,7 +126,7 @@ fi clearit; %-------------------------------------------------------------------------------------------------- message "---------------------------------------------"; -message "This is mcf2graph ver 4.50 2020.07"; +message "This is mcf2graph ver 4.51 2020.08"; if f_MP=1: if bboxmargin=0: message "output no image file"; elseif bboxmargin=1: message "output first font only"; @@ -242,7 +244,7 @@ def beginfont(text s)= begingroup save cntA,cntB,cntM,minX,minY,f_beginchar,numS,sftX,sftY,f_ext,blen,ext,add, cal_FM,cal_MW,cal_MW_str,cal_MI,cal_MI_str,wdM,htM, - inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB,inf_MW, + inf_NO,inf_EN,inf_JN,inf_MW,inf_MI,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB, posA,posM,lineB,sB,eB,angB,angA,wdA,dxA,lenB,ang_br,info; numeric lineB[],sB[],eB[],angB[],angA[],lenB[],angX[],numS[],wdM[],htM[],wdA[],dxA[]; pair posA[],posM[][]; @@ -252,8 +254,8 @@ def beginfont(text s)= def ext=ext_to_font enddef; def add=add_to_molecule enddef; %------------------------------------------------------------------------------------------------ - inf_NO:=inf_EN:=inf_JN:=inf_FM:=inf_CAS:=inf_USE:=inf_EXA:=inf_EXB:=inf_MW:=""; - cal_MW:=cal_MW_str:=cal_FM:=""; + inf_NO:=inf_EN:=inf_JN:=inf_MW:=inf_FM:=inf_CAS:=inf_USE:=inf_EXA:=inf_EXB:=""; + cal_MW:=cal_MW_str:=cal_MI:=cal_MI_str:=cal_FM:=""; %------------------------------------------------------------------------------------------------ char_num:=char_num+1; store_par(parameter_list); @@ -531,9 +533,9 @@ enddef; %-------------------------------------------------------------------------------------------------- def add_to_molecule(text TXT)= begingroup - save w,h,n,l,p,am,aw,A,B,plus,minus,lonepair,**,<<,/*; + save w,h,n,l,p,am,aw,A,B,plus,minus,lonepair,__,**,=>,<<,/*; numeric A[]dir,B[]up,A[]ang,B[]ang; - pair p[],A[],B[]s,B[]e,B[]m,A[]up,A[]left,A[]right,A[]down,B[]up,B[]left,B[]right,B[]down; + pair __,p[],A[],B[]s,B[]e,B[]m,A[]up,A[]left,A[]right,A[]down,B[]up,B[]left,B[]right,B[]down; path B[]; ext_setup; def plus = circled_plus_add enddef; @@ -541,7 +543,10 @@ def add_to_molecule(text TXT)= def lonepair = lone_pair_add enddef; let ** = scaled; let << = rotated; + let => = shifted; + __ = (1,0); primarydef a /* b = point b of a enddef; + %---------------------------------------------- w:=mol_wd; h:=mol_ht; l:=blen; aw:=atom_wd; p0:=(minX,minY); An:=cntA; Bn:=cntB; @@ -565,8 +570,14 @@ enddef; %-------------------------------------------------------------------------------------------------- def ext_to_font(text TXT)= begingroup - save w,h,wd,ht,n,p,am,aw; - pair p[]; + save w,h,wd,ht,n,p,am,aw,__,**,<<,=>,/*; + pair __,p[]; + let ** = scaled; + let << = rotated; + let => = shifted; + primarydef a /* b = point b of a enddef; + __ = (1,0); + %---------------------------------------------------------------------- ext_setup; w:=xpart(fsize); h:=ypart(fsize); @@ -1595,17 +1606,29 @@ enddef; def proc_auxfile_out= message "["&decimal(char_num)&"]:"&inf_EN; out_file_name:=out_file_aux; + %-------------------------------------------------------------------------------------- if (char_num=1)and(sw_aux_out=2): - printf tag[1] for i=2 upto aux_max: exitif tag[i]=""; &";"&tag[i] endfor ; + printf tag[1] for i=2 upto aux_max: exitif tag[i]=""; &aux_delimiter&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])) + if sw_aux_out=1: &tag[i]&":" fi + if tag[i]="F": & jobname + elseif tag[i]="C": & decimal(char_num) + elseif tag[i]="mw": & cal_MW + elseif tag[i]="fm": & cal_FM + elseif tag[i]="mi": & cal_MI + elseif tag[i]="w": & decimal(xpart(fsize)) + elseif tag[i]="h": & decimal(ypart(fsize)) + elseif tag[i]="w1": & decimal(mol_wd) + elseif tag[i]="h1": & decimal(mol_ht) + elseif tag[i]="An": & decimal(cntA) + elseif tag[i]="Bn": & decimal(cntB) + else: fi endfor - if sw_aux_out=1: for i=1 upto inf_num: &aux_delimiter&info[i] endfor; fi + if (sw_aux_out=1)or(sw_aux_out=3): for i=1 upto inf_num: &aux_delimiter&info[i] endfor; fi enddef; %================================================================================================== vardef round_auto(expr n)= |