diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf | 37 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf | bin | 535780 -> 535779 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf | 321 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf | bin | 633398 -> 617135 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex | 336 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf | bin | 202100 -> 202477 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex | 155 | ||||
-rw-r--r-- | Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 436 |
10 files changed, 732 insertions, 564 deletions
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG index d0926ab2093..8bf1b7f3d57 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG +++ b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG @@ -1,6 +1,13 @@ ******************************************************************************* - Changelog of mcf2graph software package by Akira Yamaji 2021-02-11 + Changelog of mcf2graph software package by Akira Yamaji 2021-02-21 ******************************************************************************* +[ver. 4.58 / 2021-02-21] + -change syntax + "+" => p_ + "-" => n_ + -add function check_mc() + -update MCF manual,example + [ver. 4.57 / 2021-02-11] -change syntax n:@ => @n diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/README b/Master/texmf-dist/doc/metapost/mcf2graph/README index 7b4bb20d032..dd818987a10 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/README +++ b/Master/texmf-dist/doc/metapost/mcf2graph/README @@ -1,7 +1,7 @@ ******************************************************************************** mcf2graph : Convert Molecular Coding Format to graphics with METAFONT/METAPOST Author : Akira Yamaji - version : 4.57 2021-02-11 + version : 4.58 2021-02-21 E-mail : mcf2graph@gmail.com Located at : http://www.ctan.org/pkg/mcf2graph ******************************************************************************** diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf index b1675647755..65420533fc0 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf @@ -1,8 +1,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format for mcf_example.tex by Akira Yamaji 2021.02.11 +% Molecular Coding Format for mcf_example.tex by Akira Yamaji 2021.02.21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -input mcf2graph.mf; %%% it must be version 4.57 -message "* mcf_exa_soc 2021.02.11"; +input mcf2graph.mf; %%% it must be version 4.58 +message "* mcf_exa_soc 2021.02.21"; message ""; %------------------------------------------------------------------------- fsize:=(35mm,24mm); @@ -29,12 +29,7 @@ tag1:="F"; tag2:="C"; tag3:="fm"; tag4:="mw"; tag5:="EN"; tag6:="MW"; %%%% for i=nA step nA until w: draw(i,0)--(i,h); endfor %%%% for i=nA step nA until h: draw(0,i)--(w,i); endfor ); %--------------------------------------------------------------------------- -%%%%sw_calc:=1; -%%%%ext(defaultfont:="uhvr8r"; defaultscale:=.3; -%%%% label.lrt(decimal(char_num)&":"&inf_EN&" MW="&cal_MW -%%%% if (inf_MW<>"-")and(cen_MW<40): -%%%% &"("& decimal(num_MW-scantokens(inf_MW))&")" -%%%% else: &"(-)" fi ,(-2bp,1.5bp));) +%%%%ext(defaultfont:="uhvr8r"; defaultscale:=.3; label.lrt(mc,(-2bp,1.5bp));) %*************************************************************************** beginfont("EN:Adenine","MW:135.13") MC(<30,?6,3=?5,{1,3,5,9}=dl,{2,6,9}:N,5:/NH2,7:NH) @@ -116,8 +111,8 @@ endfont %*************************************************************************** beginfont("EN:Thiamine","MW:300.81") MC(<30,Ph,4:/NH2,@3,\`1,!,<-12,?5,{-1,-4}=dl,{1,5,8}:N,11:S,{6,9}:/_, - @-3,\,!2,OH,8:"+"^72) - MCat(.95,.75)(Cl,"-"^15) + @-3,\,!2,OH,8:p_^72) + MCat(.95,.75)(Cl,n_^15) endfont %************************************************************************** beginfont("EN:Gibberellin A3","MW:346.379"); @@ -183,8 +178,8 @@ beginfont("EN:Sudan red 1","MW:248.28") endfont %*************************************************************************** beginfont("EN:Basic blue 1","MW:319.86") - MC(<30,Ph,3=Ph,6=Ph,2:S,5:N,{8,13}:/N?!,2:"+") - MCat(1,.7)(Cl,"-"^15) + MC(<30,Ph,3=Ph,6=Ph,2:S,5:N,{8,13}:/N?!,2:p_) + MCat(1,.7)(Cl,n_^15) endfont %*************************************************************************** beginfont("EN:Disperse violet 1","MW:238.25") @@ -240,9 +235,9 @@ beginfont("EN:Halfenprox","MW:477.4") endfont %*************************************************************************** beginfont("EN:Paraquat","MW:257.16") - MC(Ph,@4,\,Ph,{1,10}:N!,1:"+"^-90,10:"+"^90) - MCat(1,.75)(Cl,"-"^15) - MCat(1,.60)(Cl,"-"^15) + MC(Ph,@4,\,Ph,{1,10}:N!,1:p_^-90,10:p_^90) + MCat(1,.75)(Cl,n_^15) + MCat(1,.60)(Cl,n_^15) endfont %*************************************************************************** beginfont("EN:Picolinafen","MW:376.331") @@ -484,9 +479,9 @@ endfont %*************************************************************************** beginfont("EN:Cefalonium","MW:458.5107") MC(<45,?4,-3=?6,-4=dl,2:N,8:S, - 3^45:/*H,1://O^15,@5,\*,//O,!,O,"-"^40, + 3^45:/*H,1://O^15,@5,\*,//O,!,O,n_^40, @4,*\^15,NH,!,//O,!2,?5,{-1,-3}=dl,-4:S, - @6,\,!,|,Ph,1:N,1:"+"^180,@4,\,//O,!,NH2) + @6,\,!,|,Ph,1:N,1:p_^180,@4,\,//O,!,NH2) endfont %*************************************************************************** beginfont("EN:Cefazorin","MW:454.51") @@ -498,9 +493,9 @@ endfont %*************************************************************************** beginfont("EN:Cefquinome","MW:528.6") MC(<45,?4,-3=?6,-4=dl,2:N,8:S, - 3^45:/*H,1://O^15,@5,\*,//O,!,O,"-"^40, + 3^45:/*H,1://O^15,@5,\*,//O,!,O,n_^40, @4,*\^15,NH,!,//O,!,//'(N,!,O,!),!,?5,{-2,-5}=dl,-3:S,-1:N,-2:/NH2, - @6,\,!,Ph,-2=?6,-10:N,-10:"+"^180) + @6,\,!,Ph,-2=?6,-10:N,-10:p_^180) endfont %*************************************************************************** beginfont("EN:Ceftiofur","MW:523.5626") @@ -803,7 +798,7 @@ beginfont("EN:illudin S","MW:264.3") endfont %*************************************************************************** beginfont("EN:Muscarine","MW:174.26") - MC(<18,?5,2:O,1:*/_,5:/*OH,@3,*\,48,N,??,"+"^180,!) + MC(<18,?5,2:O,1:*/_,5:/*OH,@3,*\,48,N,??,p_^180,!) endfont %*************************************************************************** beginfont("EN:Psilocybin","MW:284.248") diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf Binary files differindex 71e5a0dfb0f..ba142e98185 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf index 0f99177e283..3a2da782e28 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf @@ -1,128 +1,134 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2021.02.11 +% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2021.02.21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -input mcf2graph.mf; %% it must be version 4.57 -message "mcf_man_soc 2021.01.31"; message ""; +input mcf2graph.mf; %% it must be version 4.578 +message "mcf_man_soc 2021.02.21"; message ""; %------------------------------------------------------------------------ sw_mframe:=0; sw_expand:=0; %%%%sw_aux_out:=0; %%%%sw_rep_out:=1; -%ext(defaultscale:=.5; label.bot(decimal(char_num)&":"&inf_EN,(.5w,0));) +%%%%ext(defaultscale:=.5; label.bot(decimal(char_num)&":"&inf_EN,(.5w,0));) +%%%%ext(defaultscale:=.5; label.bot(mc,(.5w,0));) %*********************************************************************** fsize:=(40mm,25mm); blength:=6mm; %*********************************************************************** -beginfont("EN:Glycine") - MC(<30,NH2,!2,COOH) +beginfont("EN:Glycine",":<30,NH2,!2,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Alanine") - MC(<30,NH2,!~wb,/_,!,COOH) +beginfont("EN:L-Alanine",":<30,NH2,!~wb,/_,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Valine") - MC(<30,NH2,!~wb,/!?!,!,COOH) +beginfont("EN:L-Valine",":<30,NH2,!~wb,/!?!,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Leucine") - MC(<30,NH2,!~wb,/!?!,!,COOH) +beginfont("EN:L-Leucine",":<30,NH2,!~wb,/!?!,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Isoleucine") - MC(<30,NH2,!~wb,/'(/*_,!2),!,COOH) +beginfont("EN:L-Isoleucine",":<30,NH2,!~wb,/'(/*_,!2),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Serine") - MC(<30,NH2,!~wb,/!OH,!,COOH) +beginfont("EN:L-Serine",":<30,NH2,!~wb,/!OH,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Threonine") - MC(<30,NH2,!~wb,/'(/_,!~wf,OH),!,COOH) +beginfont("EN:L-Threonine",":<30,NH2,!~wb,/'(/_,!~wf,OH),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Cysteine") - MC(<30,NH2,!~wb,/!SH,!,COOH) +beginfont("EN:L-Cysteine",":<30,NH2,!~wb,/!SH,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Methionine") - MC(<30,NH2,!~wb,/'(!2,S,!),!,COOH) +beginfont("EN:L-Methionine",":<30,NH2,!~wb,/'(!2,S,!),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Phenylalanine") - MC(<30,NH2,!~wb,/!Ph,!,COOH) +beginfont("EN:L-Phenylalanine",":<30,NH2,!~wb,/!Ph,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Tyrosine") - MC(<30,NH2,!~wb,/'(!Ph,-3:/OH),!,COOH) +beginfont("EN:L-Tyrosine",":<30,NH2,!~wb,/'(!Ph,-3:/OH),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Triptophan") - MC(<30,NH2,!~wb,!,COOH,@2,\,!,<24,|,?5,-4=Ph,2=dr,5=dl,4:NH) +beginfont("EN:L-Triptophan", + ":<30,NH2,!~wb,!,COOH,@2,\,!,<24,|,?5,-4=Ph,2=dr,5=dl,4:NH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Prorine") - MC(<18,?5,3:NH,4:*/COOH) +beginfont("EN:L-Prorine",":<18,?5,3:NH,4:*/COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Glutamine") - MC(<30,NH2,!~wb,!,COOH,@2,\`1,!`1,!,//O,!,NH2) +beginfont("EN:L-Glutamine", + ":<30,NH2,!~wb,!,COOH,@2,\`1,!`1,!,//O,!,NH2") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Asparagine") - MC(<30,NH2,!~wb,/'(!,//O,!,NH2),!,COOH) +beginfont("EN:L-Asparagine",":<30,NH2,!~wb,/'(!,//O,!,NH2),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Aspartic acid") - MC(<30,NH2,!~wb,/!COOH,!,COOH) +beginfont("EN:L-Aspartic acid",":<30,NH2,!~wb,/!COOH,!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Glutamic acid") - MC(<30,NH2,!~wb,/'(!2,COOH),!,COOH) +beginfont("EN:L-Glutamic acid",":<30,NH2,!~wb,/'(!2,COOH),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Lysine") - MC(<30,NH2,!~wb,/'(!4,NH2),!,COOH) +beginfont("EN:L-Lysine",":<30,NH2,!~wb,/'(!4,NH2),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Arginine") - MC(<30,NH2,!~wb,!,COOH,@2,\`1,!`1,!2,NH,!,//NH,!,NH2) +beginfont("EN:L-Arginine", + ":<30,NH2,!~wb,!,COOH,@2,\`1,!`1,!2,NH,!,//NH,!,NH2") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Hystidine") - MC(<30,NH2,!~wb,!,COOH,@2,\,!,|,?5,{1,3}=dl,3:N,5:NH) +beginfont("EN:L-Hystidine", + ":<30,NH2,!~wb,!,COOH,@2,\,!,|,?5,{1,3}=dl,3:N,5:NH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-DOPA") - MC(<30,NH2,!~wb,!,COOH,@2,\,!,Ph,{-3,-4}:/OH) +beginfont("EN:L-DOPA",":<30,NH2,!~wb,!,COOH,@2,\,!,Ph,{-3,-4}:/OH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:Ornithine") - MC(<30,NH2,!~wb,/'(!3,NH2),!,COOH) +beginfont("EN:Ornithine",":<30,NH2,!~wb,/'(!3,NH2),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:Citrulline") - MC(<30,NH2,!~wb,/'(!3,NH,!,//O,!,NH2),!,COOH) +beginfont("EN:Citrulline",":<30,NH2,!~wb,/'(!3,NH,!,//O,!,NH2),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:GABA") - MC(<30,NH2,!4,COOH) +beginfont("EN:GABA",":<30,NH2,!4,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:amino Levulinic acid") - MC(<30,NH2,!2,//O,!3,COOH) +beginfont("EN:amino Levulinic acid",":<30,NH2,!2,//O,!3,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:4-amino benzoic acid") - MC(<30,Ph,1:/NH2,4:/COOH) +beginfont("EN:4-amino benzoic acid",":<30,Ph,1:/NH2,4:/COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Carboxyl glutamic acid") - MC(<30,NH2,!~wb,/'(!,/COOH,!,COOH),!,COOH) +beginfont("EN:L-Carboxyl glutamic acid", + ":<30,NH2,!~wb,/'(!,/COOH,!,COOH),!,COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** -beginfont("EN:L-Hydroxy Prorine") - MC(<18,?5,1:/OH,3:NH,4:*/COOH) +beginfont("EN:L-Hydroxy Prorine",":<18,?5,1:/OH,3:NH,4:*/COOH") + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*********************************************************************** %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -376,7 +382,7 @@ endfont beginfont("EN:Charged atom") sw_trimming:=1; fsize:=(60mm,12mm); - MC(<-30,!2,N,??,"+",!2,S,"-"^180,!6,7:N,7:??,9:S,7:"+",9:"-"^180) + MC(<-30,!2,N,??,p_,!2,S,n_^180,!6,7:N,7:??,9:S,7:p_,9:n_^180) endfont %*********************************************************************** beginfont("EN:fused ring") @@ -883,25 +889,25 @@ beginfont("EN:Switwch bondtype off") endfont %*********************************************************************** beginfont("EN:Switwch font frame 1") - fsize:=(40mm,10mm); + fsize:=(30mm,10mm); fmargin:=(5mm,1.5mm); sw_fframe:=1; MC(<30,Ph) endfont beginfont("EN:Switwch font frame 2") - fsize:=(40mm,10mm); + fsize:=(30mm,10mm); fmargin:=(5mm,1.5mm); sw_fframe:=2; MC(<30,Ph) endfont beginfont("EN:Switwch font frame 3") - fsize:=(40mm,10mm); + fsize:=(30mm,10mm); fmargin:=(5mm,1.5mm); sw_fframe:=3; MC(<30,Ph) endfont beginfont("EN:Switwch font frame 4") - fsize:=(40mm,10mm); + fsize:=(30mm,10mm); fmargin:=(5mm,1.5mm); sw_fframe:=4; MC(<30,Ph) @@ -962,23 +968,33 @@ endfont %----------------------------------------------------------------------- beginfont("EN:MCat()") defaultsize:=5bp; - fsize:=(75mm,75mm); + fsize:=(40mm,40mm); fmargin:=(3mm,3mm); - blength:=0.07; + blength:=0.1; sw_fframe:=1; mangle:=0; - for i=1 step -0.25 until 0: - for j=0 step 0.25 until 1: + for i=1 step -0.5 until 0: + for j=0 step 0.5 until 1: MCat(j,i)(Ph,4:N) add( drawarrow((A1+A1up**aw)..A1); label(decimal(mangle),p0+(0.5w,0.5h)); ) - mangle:=mangle+15; + mangle:=mangle+30; endfor endfor endfont %*********************************************************************** +beginfont("EN:Pyridine",":<30,Ph,2:N") + fsize:=(12mm,12mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi +endfont +%----------------------------------------------------------------------- +beginfont("EN:Pyridine",":<30,Ph,2):N") + fsize:=(12mm,12mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi +endfont +%*********************************************************************** beginfont("EN:add() 1") fsize:=(70mm,43mm); sw_aframe:=sw_mframe:=1; @@ -1097,102 +1113,115 @@ beginfont("EN:?6") endfont defaultsize:=save_defaultsize; %*************************************************************************** -beginfont("EN:Luciferin","MW:280.33") - fsize:=(60mm,20mm); - MC( - <30,Ph,3=?5,@8,\,?5,{9,16}=dl, - {9,14}:N,{7,11}:S,1:/OH,-2:*/COOH - ) +beginfont("EN:Luciferin","MW:280.33", + %--------------------------------------- + ": <30,Ph,3=?5,@8,\,?5,{9,16}=dl, ", + ": {9,14}:N,{7,11}:S,1:/OH,-2:*/COOH ") + %--------------------------------------- + fsize:=(50mm,15mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*************************************************************************** -beginfont("EN:Colchicine","MW:385.41") - fsize:=(60mm,25mm); - MC( - <30,Ph,{1,2,6}:/O!,-4=?7,-5=?7,{-1,-4,-6}=dl,-2://O,-3:/O!, - @9,\,NH,!,//O,! - ) +beginfont("EN:Colchicine","MW:385.41", + %--------------------------------------- + ": <30,Ph,{1,2,6}:/O!,-4=?7,-5=?7, ", + ": {-1,-4,-6}=dl,-2://O,-3:/O!, ", + ": @9,\,NH,!,//O,! ") + %--------------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*************************************************************************** -beginfont("EN:Paclitaxel","MW:853.91") - MC( - ?6,5=dl,@3,#1,36,45,45,45,45,##, - &($5),-4=?6,-4=?4,-1=wb,-3=wf,-1:O,||, - 4:??,6:/_,{3^-60,15}:*/OH,8:/*H^-60, - 9:*/_^60,10://O, - @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf,NH,-60,//O,60,Ph, - @7,\*,O,-45,//O,60,Ph,@11,*\,O,-60,//O,60, - @12,\*^-15,O,60,//O,-60 - ) +beginfont("EN:Paclitaxel","MW:853.91", + %------------------------------------------------------ + ": ?6,5=dl,@3,#1,36,45,45,45,45,##, ", + ": &($5),-4=?6,-4=?4,-1=wb,-3=wf,-1:O,||, ", + ": 4:??,6:/_,{3^-60,15}:*/OH,8:/*H^-60, ", + ": 9:*/_^60,10://O, ", + ": @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf,NH,-60,//O,60,Ph, ", + ": @7,\*,O,-45,//O,60,Ph,@11,*\,O,-60,//O,60, ", + ": @12,\*^-15,O,60,//O,-60 ") + %------------------------------------------------------ + fsize:=(50mm,25mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*************************************************************************** -beginfont("EN:Lycorine","MW:287.31") - fsize:=(60mm,25mm); - MC(<30, - Ph,-4=?6,-2=?6,6=?5,(9,12)=?5[3], - 13=dl,8:N,{15,17}:O, - 9:/*H^180,10:*/H^60,13:*/OH,14:/*OH - ) -endfont -%*********************************************************************** -beginfont("EN:Gibberellin A3","MW:346.37"); - fsize:=(60mm,20mm); - MC( - <18,?5,3=?7,5=?6[12],@8,160`1.3,&3, - 13=dl,6=wf,8=wb, - @5,40~zf`1,O,50,//O^180,&14~zb, - 2:/COOH,7://_,13:*/OH,8:/*OH, - 14:*/_,{1,4}:*/H^60 - ) +beginfont("EN:Lycorine","MW:287.31", + %----------------------------------------- + ": <30,Ph,-4=?6,-2=?6,6=?5,(9,12)=?5[3], ", + ": 13=dl,8:N,{15,17}:O, ", + ": 9:/*H^180,10:*/H^60,13:*/OH,14:/*OH ") + %----------------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi +endfont +%*********************************************************************** +beginfont("EN:Gibberellin A3","MW:346.37", + %---------------------------------------- + ": <18,?5,3=?7,5=?6[12],@8,160`1.3,&3, ", + ": 13=dl,6=wf,8=wb, ", + ": @5,40~zf`1,O,50,//O^180,&14~zb, ", + ": 2:/COOH,7://_,13:*/OH,8:/*OH, ", + ": 14:*/_,{1,4}:*/H^60 ") + %---------------------------------------- + fsize:=(50mm,18mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*************************************************************************** -beginfont("EN:Quinine","MW:324.42") - fsize:=(60mm,25mm); - MC( - <30,Ph,3=Ph,7:N,6:/O!, - @10,\,*/OH,/H~zf^-60,!, - |,?6,2:N,1:*/H^60,4:*/!!, - @2,165~zf,60,&5~zb - ) +beginfont("EN:Quinine","MW:324.42", + %---------------------------------------- + ": <30,Ph,3=Ph,7:N,6:/O!, ", + ": @10,\,*/OH,/H~zf^-60,!, ", + ": |,?6,2:N,1:*/H^60,4:*/!!, ", + ": @2,165~zf,60,&5~zb ") + %---------------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont %*************************************************************************** sw_calc:=1; ext(defaultfont:="uhvr8r"; defaultscale:=.75; - label.urt("NO = "&decimal(char_num),(0.1w,0.60h)); - label.urt("EN = "&inf_EN ,(0.1w,0.56h)); - label.urt("MW = "&inf_MW ,(0.1w,0.52h)); - label.urt("mw = "&cal_MW ,(0.1w,0.48h)); - label.urt("fm = "&cal_FM ,(0.1w,0.44h)); - label.urt("w = "&decimal(w) ,(0.1w,0.40h)); - label.urt("h = "&decimal(h) ,(0.1w,0.36h)); - label.urt("n = "&decimal(n) ,(0.1w,0.32h)); + label.urt("NO = "&decimal(char_num),(0.01w,0.60h)); + label.urt("EN = "&inf_EN ,(0.01w,0.57h)); + label.urt("MW = "&inf_MW ,(0.01w,0.54h)); + label.urt("mw = "&cal_MW ,(0.01w,0.51h)); + label.urt("fm = "&cal_FM ,(0.01w,0.48h)); + label.urt("w = "&decimal(w) ,(0.01w,0.45h)); + label.urt("h = "&decimal(h) ,(0.01w,0.42h)); + label.urt("n = "&decimal(n) ,(0.01w,0.39h)); label.urt("ratio_thickness_bond = "&decimal(ratio_thickness_bond), - (0.1w,0.28h)); + (0.01w,0.36h)); label.urt("ratio_atom_bond = "&decimal(ratio_atom_bond), - (0.1w,0.24h)); + (0.01w,0.33h)); label.urt("ratio_bondgap_bond = "&decimal(ratio_bondgap_bond), - (0.1w,0.20h)); + (0.01w,0.30h)); label.urt("ratio_chain_ring = "&decimal(ratio_chain_ring), - (0.1w,0.16h)); - label.urt("sw_fframe = "&decimal(sw_fframe),(0.1w,0.12h)); - label.urt("sw_aframe = "&decimal(sw_aframe),(0.1w,0.08h)); - label.urt("sw_trimming = "&decimal(sw_trimming),(0.1w,0.04h)); + (0.01w,0.27h)); + label.urt("sw_fframe = "&decimal(sw_fframe),(0.01w,0.24h)); + label.urt("sw_aframe = "&decimal(sw_aframe),(0.01w,0.21h)); + label.urt("sw_trimming = "&decimal(sw_trimming),(0.01w,0.18h)); + label.urt("mc1 ="&mc1,(0.01w,0.12h)); + label.urt("mc2 ="&mc2,(0.01w,0.09h)); + label.urt("mc3 ="&mc3,(0.01w,0.06h)); ) %*************************************************************************** -beginfont("EN:Ampicillin","MW:349.405") - fsize:=(60mm,90mm); - MCat(0.5,1)(<45,?4,-3=?5,2:N,7:S, - {3^45,4^-45}:/*H,1://O^15,5:/*COOH^-18,6:??, - @4,*\^75,NH,!,//O,!,/*NH2,!,Ph) +beginfont("EN:Ampicillin","MW:349.405", +": <45,?4,-3=?5,2:N,7:S,", +": 3^45:/*H,1://O^15,5:/*COOH^-18,6:??,", +": @4,*\^15,NH,!,//O,!,/*NH2,!,Ph" +) + fsize:=(72mm,110mm); + blength:=7mm; + if check_mc(mc)=0: MCat(0.5,0.95)(scantokens(mc)) fi endfont %*************************************************************************** -beginfont("EN:Cholesterol","CAS:57-88-5","FM:C27H46O","MW:386.65") - fsize:=(60mm,90mm); - MCat(0.5,1)( - <30,?6,{-4,-2}=?6,-4=?5,7=dl, - 1:*/OH,{4,12}:*/_^60,9:*/H^60, - 10:/*H^180,11:/*H^-60,17:/*H^-54, - @-1,18,/*_,-60,!3,?! - ) +beginfont("EN:Cholesterol","MW:386.65", + ": <30,?6,{-4,-2}=?6,-4=?5,7=dl, ", + ": 10:/*H^180,11:/*H^-60,17:/*H^-54, ", + ": 1:*/OH,{4,12}:*/_^60,@-1,18,/*_,-60,!3,?!") + fsize:=(72mm,110mm); + blength:=7mm; + if check_mc(mc)=0: MCat(0.5,0.95)(scantokens(mc)) fi endfont %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bye diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf Binary files differindex 9e3950eeff1..5b295a87bb1 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex index ef6c9b124f8..aea619862ad 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format manual by Akira Yamaji 2021.02.11 +% Molecular Coding Format manual by Akira Yamaji 2021.02.21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper]{article} \usepackage[pdftex]{graphicx} @@ -52,9 +52,9 @@ }% %--------------------------------------------------------------------------- \def\put@char{% - \begin{picture}(75,110)% - \put(0,100){\bf [\NO]\EN}% - \put(5,95){\small\tt FM:\fm{ }MW:\mw}% + \begin{picture}(75,130)% + \put(0,120){\bf [\NO]\EN}% + \put(5,115){\small\tt FM:\fm{ }MW:\mw}% \put(5,0){\font\@strufont=\File\relax% \hbox{\@strufont\char\Char}}% \end{picture}% @@ -394,10 +394,10 @@ exact mass, molecular formula. %----------------------------------------------------------------------------- \subsubsection{Charged atom} \begin{verbatim} - "+" : positive / "-" : negative + p_ : positive / n_ : negative -<-30,!2,N,??,"+",!2,S,"-"^180, -!6,7:N,7:??,9:S,7:"+",9:"-"^180 +<-30,!2,N,??,p_,!2,S,n_^180, +!6,7:N,7:??,9:S,7:n_,9:n_^180 \end{verbatim} \MCFgraph %----------------------------------------------------------------------------- @@ -902,7 +902,7 @@ exact mass, molecular formula. 0.06 0.12 0.20 \end{verbatim} %----------------------------------------------------------------------------- -\newpage +%%\newpage %----------------------------------------------------------------------------- \subsection{Drawing mode} %----------------------------------------------------------------------------- @@ -989,7 +989,7 @@ MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2) \end{verbatim} \MCFgraph \begin{verbatim} - (Draw frame inside margin) + (Frame inside margin) sw_fframe=2 \end{verbatim} \MCFgraph @@ -999,7 +999,7 @@ MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2) \end{verbatim} \MCFgraph \begin{verbatim} - (Draw small dot at corner) + (Small dot at corner) sw_fframe=4 \end{verbatim} \MCFgraph @@ -1018,6 +1018,28 @@ MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2) MC(<30,COOH,!,COOH) \end{verbatim} \MCFgraph +%----------------------------------------------------------------------------- +\subsubsection{Remove indent} +\index{sw\_indent\_off}% +\begin{verbatim} + ** default sw_indent_off=0 + beginfont(": Ph ", + ": ,{1,4}:N ", + ": ,{2,3}:/_ ") + endfont + + mc1=" Ph" + mc2=" ,{1,4}:N" + mc3=" ,{2,3}:/_" + + sw_indent_off=1 + mc1="Ph" + mc2=",{1,4}:N" + mc3=",{2,3}:/_" + + mc="Ph,{1,4}:N,{2,3}:/_" ** 0 or 1 +\end{verbatim} +%----------------------------------------------------------------------------- \newpage %----------------------------------------------------------------------------- \subsection{Parameter setting} @@ -1085,36 +1107,53 @@ MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2) MCat(c,d)(....) : - mposition:=(c,d); - MC(....) + mposition:=(c,d); MC(....) - c: x axis position - d: y axis position + c: x axis position d: y axis position - beginfont() defaultsize:=5bp; - fsize:=(75mm,75mm); - fmargin:=(3mm,3mm); - blength:=0.07; - sw_fframe:=1; + fsize:=(40mm,40mm); fmargin:=(3mm,3mm); + blength:=0.1; sw_fframe:=1; mangle:=0; - for i=1 step -0.25 until 0: - for j=0 step 0.25 until 1: - %---------------- + for i=1 step -0.5 until 0: + for j=0 step 0.5 until 1: MCat(j,i)(Ph,4:N) - %---------------- - add( - drawarrow((A1+A1up**aw)..A1); - label(decimal(mangle), - p0+(0.5w,0.5h)); + add(drawarrow((A1+A1up**aw)..A1); + label(decimal(mangle), + p0+(0.5w,0.5h)); ) - mangle:=mangle+15; + mangle:=mangle+30; endfor endfor - endfont \end{verbatim} \MCFgraph +%----------------------------------------------------------------------------- +\subsection{Function check\_mc()} +\index{check\_mc()}% +\begin{verbatim} + (immediately compile) + + beginfont("EN:Pyridine") + MC(Ph,<30,2:N) + endfont + + (check mcf and compile) + + beginfont("EN:Pyridine",":<30,Ph,2:N") + if check_mc(mc)=0: MC(scantokens(mc)) fi + endfont + + ** error in mcf check_mc(mc)=1 + beginfont("EN:Pyridine",":<30,Ph,2):N") + if check_mc(mc)=0: MC(scantokens(mc)) fi + endfont + +\end{verbatim} +\MCFgraph\hspace{15mm}\MCFgraph +\begin{verbatim} + check_mc(mc)=0 check_mc(mc)>=1 +\end{verbatim} %=============================================================================== \newpage \subsection{Function add()} @@ -1380,44 +1419,51 @@ endfont \section{MCF example} %----------------------------------------------------------------------------- \subsection{Luciferin} -\begin{verbatim} -beginfont("EN:Luciferin","MW:280.33") - fsize:=(60mm,20mm); - MC( - <30,Ph,3=?5,@8,\,?5,{9,16}=dl, - {9,14}:N,{7,11}:S,1:/OH,-2:*/COOH - ) +\index{check\_mc()}% +\begin{verbatim} +beginfont("EN:Luciferin","MW:280.33", + %------------------------------------- + ": <30,Ph,3=?5,@8,\,?5,{9,16}=dl, ", + ": {9,14}:N,{7,11}:S,1:/OH,-2:*/COOH ") + %------------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} \MCFgraph %----------------------------------------------------------------------------- \subsection{Colchicine} \begin{verbatim} -beginfont("EN:Colchicine","MW:385.41") - fsize:=(60mm,25mm); - MC( - <30,Ph,{1,2,6}:/O!,-4=?7, - -5=?7,{-1,-4,-6}=dl, - -2://O,-3:/O!, - @9,\,NH,!,//O,! - ) +beginfont("EN:Colchicine","MW:385.41", + %------------------------------------- + ": <30,Ph,{1,2,6}:/O!,-4=?7,-5=?7, ", + ": {-1,-4,-6}=dl,-2://O,-3:/O!, ", + ": @9,\,NH,!,//O,! ") + %------------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} \MCFgraph %----------------------------------------------------------------------------- \subsection{Paclitaxel} \begin{verbatim} -beginfont("EN:Paclitaxel","MW:853.91") - MC( - ?6,5=dl,@3,#1,36,45,45,45,45,##, - &.$5,-4=?6,-4=?4,-1=wb,-3=wf,-1:O,||, - {4^35,4^-35,6}:/_,{3^-60,15}:*/OH, - 8:/*H^-60,9:*/_^60,10://O, - @1,\,O,!,//O,!,*/OH,!,/Ph, - 60~wf,NH,-60,//O,60,Ph, - @7,\*,O,-45,//O,60,Ph, - @11,*/OCO!>rl,12:/*OCO!^-15>lr - ) +beginfont("EN:Paclitaxel","MW:853.91", + %------------------------------------ + ": ?6,5=dl,@3,#1,36,45,45,45,45,##, ", + ": &.$5", ", + ": -4=?6,-4=?4,-1=wb,-3=wf,-1:O,||, ", + ": 4:??,6:/_,{3^-60,15}:*/OH, ", + ": 8:/*H^-60,", ", + ": 9:*/_^60,10://O, ", + ": @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf, ", + ": NH,-60,//O,60,Ph, ", + ": @7,\*,O,-45,//O,60,Ph, ", + ": @11,*\,O,-60,//O,60, ", + ": @12,\*^-15,O,60,//O,-60 ") + %------------------------------------ + fsize:=(50mm,25mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} \MCFgraph @@ -1425,27 +1471,30 @@ endfont \subsection{Lycorine} \begin{verbatim} beginfont("EN:Lycorine","MW:287.31") - fsize:=(60mm,25mm); - MC(<30, - Ph,-4=?6,-2=?6,6=?5,(9,12)=?5[3], - 13=dl,8:N,{15,17}:O, - 9:/*H^180,10:*/H^60,13:*/OH,14:/*OH - ) + %-------------------------------------- + ": Ph,-4=?6,-2=?6,6=?5,(9,12)=?5[3], ", + ": 13=dl,8:N,{15,17}:O, ", + ": 9:/*H^180,10:*/H^60, ", + ": 13:*/OH,14:/*OH ") + %-------------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} \MCFgraph %----------------------------------------------------------------------------- \subsection{Gibberellin} \begin{verbatim} -beginfont("EN:Gibberellin","MW:346.37"); - fsize:=(60mm,20mm); - MC( - <18,?5,3=?7,5=?6[12],@8,160`1.3,&3, - 13=dl,6=wf,8=wb, - @5,40~zf`1,O,50,//O^180,&14~zb, - 2:/COOH,7://_,13:*/OH,8:/*OH, - 14:*/_,{1,4}:*/H^60 - ) +beginfont("EN:Gibberellin A3","MW:346.37"); + %---------------------------------------- + ": <18,?5,3=?7,5=?6[12],@8,160`1.3,&3, ", + ": 13=dl,6=wf,8=wb, ", + ": @5,40~zf`1,O,50,//O^180,&14~zb, ", + ": 2:/COOH,7://_,13:*/OH,8:/*OH, ", + ": 14:*/_,{1,4}:*/H^60 ") + %---------------------------------------- + fsize:=(50mm,18mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} \MCFgraph @@ -1453,13 +1502,14 @@ endfont \subsection{Quinine} \begin{verbatim} beginfont("EN:Quinine","MW:324.42") - fsize:=(60mm,25mm); - MC( - <30,Ph,3=Ph,7:N,6:/O!, - @10,\,*/OH,/H~zf^-60,!, - |,?6,2:N,1:*/H^60,4:*/!!, - @2,165~zf,60,&5~zb - ) + %------------------------------- + ": <30,Ph,3=Ph,7:N,6:/O!, ", + ": @10,\,*/OH,/H~zf^-60,!, ", + ": |,?6,2:N,1:*/H^60,4:*/!!, ", + ": @2,165~zf,60,&5~zb ") + %------------------------------- + fsize:=(50mm,20mm); + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} \MCFgraph @@ -1486,33 +1536,45 @@ tag4:="fm"; > outputformat:="png"; hppp:=vppp:=0.1; > PNG output outputtemplate:="%j-%3c.png"; > %------------------------------------------------------------------------- -beginfont("N:1","EN:Ampicillin") > begin font(information) - MC(<45,?4,2:N,2=?5,-1:S, > begin MCF (1) - {3^45,4^-45}:/*H,1://O^15,5:/*COOH^-18,6:??, > - @4,75,NH,!,//O,!,/*NH,!,Ph) > end MCF +beginfont("EN:Ampicillin","MW:349.405", > information + %---------------------------------------- > + ": <45,?4,-3=?5,2:N,7:S, ", > mc1 + ": 3^45:/*H,1://O^15,5:/*COOH^-18,6:??, ", > mc2 + ": @4,*\^15,NH,!,//O,!,/*NH2,!,Ph ") > mc3 + %---------------------------------------- > + if check_mc(mc)=0: MC(scantokens(mc)) fi > mc=mc1&mc2&mc3 endfont > end font %------------------------------------------------------------------------ -beginfont("N:2","EN:Cholesterol") > begin font(information) - MC(<30,?6,{-4,-2}=?6,-4=?5,7=dl, > begin MCF (2) - 1:*/OH,{4,12}:*/_^60,9:*/H^60, > - 10:/*H^180,{11,-1}:/*H^-60, > - @-1,17,/*_,!4,?!) > end MCF +beginfont("EN:Cholesterol","MW:386.65", >information + %---------------------------------------- > + ": <30,?6,{-4,-2}=?6,-4=?5,7=dl, ", > mc1 + ": 10:/*H^180,11:/*H^-60,17:/*H^-54, ", > mc2 + ": {4,12}:*/_^60, ", > mc3 + ": @-1,18,/*_,-60,!3,?! ") > mc4 + %---------------------------------------- > + if check_mc(mc)=0: MC(scantokens(mc)) fi > mc=mc1&mc2&mc3 endfont > end font %------------------------------------------------------------------------ -beginfont("N:3","EN:Limonin") > begin font(information) - MC(<30,?6,{-3,-4}=?6, > begin MCF (3) - -5=?3,-2=wf,-1=wb,6=?5,-4=?6,-5=wf, > - {13,15,17,20}:O,{3,12,21}://O, > - {4~wf^60,8~zf^60,18^35,18^-35}:/_, > - {1^60,5^180,16^60}:/*H, > - @14,\*,|,?5,{1,4}=dl,3:O) > end MCF +beginfont("EN:Limonin", > information + %----------------------------------------- > + ": <30,?6,{-3,-4}=?6, ", > mc1 + ": -5=?3,-2=wf,-1=wb,6=?5,-4=?6,-5=wf, ", > mc2 + ": {13,15,17,20}:O,{3,12,21}://O, ", > mc3 + ": {4~wf^60,8~zf^60,18^35,18^-35}:/_, ", > mc4 + ": {1^60,5^180,16^60}:/*H, ", > mc5 + ": @14,\*,|,?5,{1,4}=dl,3:O) ") > mc6 + %----------------------------------------- > + if check_mc(mc)=0: MC(scantokens(mc)) fi > mc=mc1 - mc6 endfont > end font %------------------------------------------------------------------------ -beginfont("N:4","EN:beta-carotene) > begin font(information) - MC(<30,?6,3=dl,{3,5^35,5^-35}:/_, > begin MCF (4) - @4,\,|,!18,{1,3,5,7,9,11,13,15,17}=dr, > - {3,7,12,16}:/_, > - |,?6,6=dl,2:??,6:/_) > end MCF +beginfont("EN:beta-carotene", > information + %------------------------------------------ > + ": <30,?6,3=dl,{3,5^35,5^-35}:/_, ", > mc1 + ": @4,\,|,!18,{1,3,5,7,9,11,13,15,17}=dr, ", > mc2 + ": {3,7,12,16}:/_, ", > mc3 + ": |,?6,6=dl,2:??,6:/_) ") > mc4 + %------------------------------------------ > + if check_mc(mc)=0: MC(scantokens(mc)) fi > mc=mc1 - mc4 endfont > end font %------------------------------------------------------------------------ bye @@ -1718,60 +1780,64 @@ M END \subsection{LuaTeX file example} %############################################################################ \begin{verbatim} -%-------------------------------------------------------------------- \documentclass{article} \usepackage{luamplib}% +\usepackage[T1]{fontenc}% +\usepackage{textcomp}% \mplibcodeinherit{enable}% \mplibverbatim{enable}% -\everymplib{if unknown Ph1: - input mcf2graph.mf; - mp_log_name:="temp-info.aux"; - sw_aux_out:=1; - fi}% -%-------------------------------------------------------------------- +\mplibnumbersystem{double}% +\everymplib{% + if unknown Ph1: input mcf2graph.mf; fi + sw_calc:=1; sw_fframe:=4; max_blength:=4.5mm; + defaultfont:="uhvr8r"; defaultsize:=8bp; defaultscale:=1; +}% \begin{document} \noindent% %-------------------------------------------------------------------- \begin{mplibcode} fsize:=(50mm,50mm); - beginfont("NO:1","EN:Limonin","MW:470.51") - MC(<30, - ?6,{-3,-4}=?6, - -5=?3,-2=wf,-1=wb,6=?5,-4=?6,-5=wf, - {13,15,17,20}:O,{3,12,21}://O, - {4~wf^60,8~zf^60,18^35,18^-35}:/_, - {1^60,5^180,16^60}:/*H, - @14,\*,|,?5,{1,4}=dl,3:O - ) + beginfont("NO:1","EN:Limonin","MW:470.51", + %---------------------------------------- + ": <30,?6,{-3,-4}=?6, ", + ": -5=?3,-2=wf,-1=wb,6=?5,-4=?6,-5=wf, ", + ": {13,15,17,20}:O,{3,12,21}://O, ", + ": {4~wf^60,8~zf^60,18^35,18^-35}:/_, ", + ": {1^60,5^180,16^60}:/*H, ", + ": @14,\*,|,?5,{1,4}=dl,3:O ") + %---------------------------------------- + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{mplibcode}\\ %-------------------------------------------------------------------- \begin{mplibcode} fsize:=(80mm,50mm); - beginfont("NO:2","EN:beta-carotene","MW:536.87") - MC(<30, - ?6,3=dl,{3,5^35,5^-35}:/_, - @4,\,|,!18,{1,3,5,7,9,11,13,15,17}=dr, - {3,7,12,16}:/_, - |,?6,6=dl,{6,2^35,2^-35}:/_ - ) + beginfont("NO:2","EN:beta-carotene","MW:536.87", + %------------------------------------------ + ": <30,?6,3=dl,{3,5^35,5^-35}:/_, ", + ": @4,\,|,!18,{1,3,5,7,9,11,13,15,17}=dr, ", + ": {3,7,12,16}:/_, ", + ": |,?6,6=dl,{6,2^35,2^-35}:/_ ") + %------------------------------------------ + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{mplibcode}\\ %-------------------------------------------------------------------- \begin{mplibcode} fsize:=(50mm,50mm); - beginfont("NO:3","EN:Gibberellin A3","MW:346.37"); - MC(<18,?5,3=?7,5=?6[12], - @8,160`1.3,&3,13=dl,6=wf,8=wb, - @5,40~zf`1,O,60,//O^180,&14~zb, - 2:/COOH,7://_,13:*/OH,8:/*OH, - 14:*/_,{1^60,4^60}:*/H - ) + beginfont("NO:3","EN:Gibberellin A3","MW:346.37", + %------------------------------------ + ": <18,?5,3=?7,5=?6[12], ", + ": @8,160`1.3,&3,13=dl,6=wf,8=wb, ", + ": @5,40~zf`1,O,60,//O^180,&14~zb, ", + ": 2:/COOH,7://_,13:*/OH,8:/*OH, ", + ": 14:*/_,{1^60,4^60}:*/H ") + %------------------------------------ + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont; -\end{mplibcode}\\ %-------------------------------------------------------------------- +\end{mplibcode}\\ \end{document} -%-------------------------------------------------------------------- \end{verbatim}% %############################################################################ %------------------------------------------------------------------------ @@ -1801,16 +1867,16 @@ endfont; %-------------------------------------------------------------------- \begin{document} \unitlength=1mm% -\INFO{F:mcf_man_soc,C:139,NO:1,mw:349.40462,fm:C16H19N3O4S,EN:Ampicillin}% -\INFO{F:mcf_man_soc,C:140,NO:2,mw:386.6532,fm:C27H46O,EN:Cholesterol}% +\INFO{F:mcf_man_soc,C:141,NO:1,mw:349.40462,fm:C16H19N3O4S,EN:Ampicillin}% +\INFO{F:mcf_man_soc,C:142,NO:2,mw:386.6532,fm:C27H46O,EN:Cholesterol}% \end{document} %-------------------------------------------------------------------- \end{verbatim}% %############################################################################ %------------------------------------------------------------------------ -\INFO{F:mcf_man_soc,C:139,NO:1,mw:349.40462,fm:C16H19N3O4S,EN:Ampicillin}% -\INFO{F:mcf_man_soc,C:140,NO:2,mw:386.6532,fm:C27H46O,EN:Cholesterol}% +\INFO{F:mcf_man_soc,C:141,NO:1,mw:349.40462,fm:C16H19N3O4S,EN:Ampicillin}% +\INFO{F:mcf_man_soc,C:142,NO:2,mw:386.6532,fm:C27H46O,EN:Cholesterol}% %------------------------------------------------------------------------ -\printindex +\texttt{\printindex} %------------------------------------------------------------------------ \end{document} diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf Binary files differindex 71273591e41..473f7c635db 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex index edf96d8953f..84731a7e018 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2021.02.11 +% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2021.02.21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% mcf2graph.mf must be version 4.57 +%%% mcf2graph.mf must be version 4.58 \documentclass{article} %------------------------------------------------------------------------------ \usepackage{luamplib}% @@ -101,30 +101,32 @@ MC( \subsection{Chlorophyll a} \noindent% \begin{verbatim} -beginfont("NO:1","EN:Chlorophyll a","MW:893.49") +beginfont("NO:1","EN:Chlorophyll a","MW:893.49", + %----------------------------------------------------------------------- + ": <54,#1,?5,{2,5}=dl,4:N,@3,\,54~dl,|,?5,{2,4}=dl,5:N, ", + ": @-2,\,54~dl,|,?5,2=dl,5:N,@-2,\~dl,54,|,?5,5=dl,5:N,@-2,\~dl,&.$5, ", + ": @-1,24,/*COO!^15,72,//O,&.$1,##,||, ", + ": {2,9,15,20~zf}:/_,8:/!,14:/!!, ", + ": @4,\`1.45,Mg,&17,@-1,&11~vb,@-1,&23~vb, ", + ": @21,-6~wf,!2,//O,!,O,!2,!!,|,!13,{1,5,9,13}:/_ ") + %----------------------------------------------------------------------- fsize:=(100mm,50mm); - MC( - <54,#1,?5,{2,5}=dl,4:N,@3,\,54~dl,|,?5,{2,4}=dl,5:N, - @-2,\,54~dl,|,?5,2=dl,5:N,@-2,\~dl,54,|,?5,5=dl,5:N,@-2,\~dl,&.$5, - @-1,24,/*COO!^15,72,//O,&.$1,##,||, - {2,9,15,20~zf}:/_,8:/!,14:/!!, - @4,\`1.45,Mg,&17,@-1,&11~vb,@-1,&23~vb, - @21,-6~wf,!2,//O,!,O,!2,!!,|,!13,{1,5,9,13}:/_ - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} %------------------------------------------------------------------------------------ \begin{mplibcode} -beginfont("NO:1","EN:Chlorophyll a","MW:893.49") +beginfont("NO:1","EN:Chlorophyll a","MW:893.49", + %----------------------------------------------------------------------- + ": <54,#1,?5,{2,5}=dl,4:N,@3,\,54~dl,|,?5,{2,4}=dl,5:N, ", + ": @-2,\,54~dl,|,?5,2=dl,5:N,@-2,\~dl,54,|,?5,5=dl,5:N,@-2,\~dl,&.$5, ", + ": @-1,24,/*COO!^15,72,//O,&.$1,##,||, ", + ": {2,9,15,20~zf}:/_,8:/!,14:/!!, ", + ": @4,\`1.45,Mg,&17,@-1,&11~vb,@-1,&23~vb, ", + ": @21,-6~wf,!2,//O,!,O,!2,!!,|,!13,{1,5,9,13}:/_ ") + %----------------------------------------------------------------------- fsize:=(100mm,50mm); - MC( - <54,#1,?5,{2,5}=dl,4:N,@3,\,54~dl,|,?5,{2,4}=dl,5:N, - @-2,\,54~dl,|,?5,2=dl,5:N,@-2,\~dl,54,|,?5,5=dl,5:N,@-2,\~dl,&.$5, - @-1,24,/*COO!^15,72,//O,&.$1,##,||, - {2,9,15,20~zf}:/_,8:/!,14:/!!, - @4,\`1.45,Mg,&17,@-1,&11~vb,@-1,&23~vb, - @21,-6~wf,!2,//O,!,O,!2,!!,|,!13,{1,5,9,13}:/_ - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi ext( defaultscale:=0.8; label.lrt("FM(C): "&cal_FM,(0,h-5mm)); @@ -137,29 +139,32 @@ endfont \subsection{Gibberellin A3} \noindent% \begin{verbatim} -beginfont("NO:4","EN:Gibberellin A3","MW:346.37"); +beginfont("NO:4","EN:Gibberellin A3","MW:346.37", + %-------------------------------------------------------- + ": <18,?5,3=?7,5=?6[12],@8,160`1.3,&3,13=dl,6=wf,8=wb, ", + ": @5,40~zf`1,O,60,//O^180,&14~zb, ", + ": 2:/COOH,7://_,13:*/OH,8:/*OH,14:*/_,{1,4}:*/H^60 ") + %-------------------------------------------------------- fsize:=(120mm,20mm); - MC( - <18,?5,3=?7,5=?6[12],@8,160`1.3,&3,13=dl,6=wf,8=wb, - @5,40~zf`1,O,60,//O^180,&14~zb, - 2:/COOH,7://_,13:*/OH,8:/*OH,14:*/_,{1,4}:*/H^60 - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont; \end{verbatim} %---------------------------------------------------------------------------- \begin{mplibcode} -beginfont("NO:4","EN:Gibberellin A3","MW:346.37"); +beginfont("NO:4","EN:Gibberellin A3","MW:346.37", + %-------------------------------------------------------- + ": <18,?5,3=?7,5=?6[12],@8,160`1.3,&3,13=dl,6=wf,8=wb, ", + ": @5,40~zf`1,O,60,//O^180,&14~zb, ", + ": 2:/COOH,7://_,13:*/OH,8:/*OH,14:*/_,{1,4}:*/H^60 ") + %-------------------------------------------------------- fsize:=(120mm,20mm); - MC( - <18,?5,3=?7,5=?6[12],@8,160`1.3,&3,13=dl,6=wf,8=wb, - @5,40~zf`1,O,60,//O^180,&14~zb, - 2:/COOH,7://_,13:*/OH,8:/*OH,14:*/_,{1,4}:*/H^60) - ext( - defaultscale:=0.8; - label.lrt("FM(C): "&cal_FM,(0,h-5mm)); - label.lrt("MW(C): "&cal_MW,(0,h-9mm)); - label.lrt("MW(D): "&inf_MW,(0,h-13mm)); - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi + ext( + defaultscale:=0.8; + label.lrt("FM(C): "&cal_FM,(0,h-5mm)); + label.lrt("MW(C): "&cal_MW,(0,h-9mm)); + label.lrt("MW(D): "&inf_MW,(0,h-13mm)); + ) endfont; \end{mplibcode} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -167,60 +172,64 @@ endfont; \noindent% %---------------------------------------------------------------------------- \begin{verbatim} -beginfont("NO:5","EN:Erythromycin","MW:733.93"); +beginfont("NO:5","EN:Erythromycin","MW:733.93", + %------------------------------------------------------------------ + ": <30,#1,<-120,60,60,60,-60,60,60,-60,60,60,60,-60,60,60,##,&1, ", + ": 14:O,13:/*Et,{1,9}://O,{2,10}:*/_,{4,6^-35,8,12^35}:/*_, ", + ": {6^35,11,12^-35}:*/OH, ", + ": @.$3,\*,O,30,|,?6`.7,2:O,{3,5^35}:/_,4:/OH,5^-35:/O!, ", + ": @.$5,\*^30`1.7,O,!,|,?6`.7,6:O,5:/_,2:/OH,3:/N?! ") + %------------------------------------------------------------------ fsize:=(120mm,35mm); - MC( - <30,#1,<-120,60,60,60,-60,60,60,-60,60,60,60,-60,60,60,##,&1, - 14:O,13:/*Et,{1,9}://O,{2,10}:*/_,{4,6^-35,8,12^35}:/*_, - {6^35,11,12^-35}:*/OH, - @.$3,\*,O,30,|,?6`.7,2:O,{3,5^35}:/_,4:/OH,5^-35:/O!, - @.$5,\*^30`1.7,O,!,|,?6`.7,6:O,5:/_,2:/OH,3:/N?! - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont; \end{verbatim} %---------------------------------------------------------------------------- \begin{mplibcode} -beginfont("NO:5","EN:Erythromycin","MW:733.93"); +beginfont("NO:5","EN:Erythromycin","MW:733.93", + %------------------------------------------------------------------ + ": <30,#1,<-120,60,60,60,-60,60,60,-60,60,60,60,-60,60,60,##,&1, ", + ": 14:O,13:/*Et,{1,9}://O,{2,10}:*/_,{4,6^-35,8,12^35}:/*_, ", + ": {6^35,11,12^-35}:*/OH, ", + ": @.$3,\*,O,30,|,?6`.7,2:O,{3,5^35}:/_,4:/OH,5^-35:/O!, ", + ": @.$5,\*^30`1.7,O,!,|,?6`.7,6:O,5:/_,2:/OH,3:/N?! ") + %------------------------------------------------------------------ fsize:=(120mm,35mm); - MC( - <30,#1,<-120,60,60,60,-60,60,60,-60,60,60,60,-60,60,60,##,&1, - 14:O,13:/*Et,{1,9}://O,{2,10}:*/_,{4,6^-35,8,12^35}:/*_, - {6^35,11,12^-35}:*/OH, - @.$3,\*,O,30,|,?6`.7,2:O,{3,5^35}:/_,4:/OH,5^-35:/O!, - @.$5,\*^30`1.7,O,!,|,?6`.7,6:O,5:/_,2:/OH,3:/N?! - ) - ext( - defaultscale:=0.8; - label.lrt("FM(C): "&cal_FM,(0,h-5mm)); - label.lrt("MW(C): "&cal_MW,(0,h-9mm)); - label.lrt("MW(D): "&inf_MW,(0,h-13mm)); - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi + ext( + defaultscale:=0.8; + label.lrt("FM(C): "&cal_FM,(0,h-5mm)); + label.lrt("MW(C): "&cal_MW,(0,h-9mm)); + label.lrt("MW(D): "&inf_MW,(0,h-13mm)); + ) endfont; \end{mplibcode} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Paclitaxel} \noindent% \begin{verbatim} -beginfont("EN:Paclitaxel","MW:853.918") +beginfont("EN:Paclitaxel","MW:853.918", + %--------------------------------------------------------------------- + ": ?6,5=dl,@3,#1,36,45,45,45,45,##,&5,-4=?6,-4=?4,-1=wb,-3=wf,-1:O, ", + ": 4:??,6:/_,{3^-60,15}:*/OH,8:/*H^-60,9:*/_^60,10://O, ", + ": @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf,NH,-60,//O,60,Ph, ", + ": @7,\*,O,-45,//O,60,Ph,11:*/OCO!>rl,12:/*OCO!^-15>lr ") + %--------------------------------------------------------------------- fsize:=(120mm,35mm); - MC( - ?6,5=dl,@3,#1,36,45,45,45,45,##,&5,-4=?6,-4=?4,-1=wb,-3=wf,-1:O, - 4:??,6:/_,{3^-60,15}:*/OH,8:/*H^-60,9:*/_^60,10://O, - @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf,NH,-60,//O,60,Ph, - @7,\*,O,-45,//O,60,Ph,11:*/OCO!>rl,12:/*OCO!^-15>lr - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi endfont \end{verbatim} %---------------------------------------------------------------------------- \begin{mplibcode} -beginfont("EN:Paclitaxel","MW:853.918") +beginfont("EN:Paclitaxel","MW:853.918", + %--------------------------------------------------------------------- + ": ?6,5=dl,@3,#1,36,45,45,45,45,##,&5,-4=?6,-4=?4,-1=wb,-3=wf,-1:O, ", + ": 4:??,6:/_,{3^-60,15}:*/OH,8:/*H^-60,9:*/_^60,10://O, ", + ": @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf,NH,-60,//O,60,Ph, ", + ": @7,\*,O,-45,//O,60,Ph,11:*/OCO!>rl,12:/*OCO!^-15>lr ") + %--------------------------------------------------------------------- fsize:=(120mm,35mm); - MC( - ?6,5=dl,@3,#1,36,45,45,45,45,##,&5,-4=?6,-4=?4,-1=wb,-3=wf,-1:O, - 4:??,6:/_,{3^-60,15}:*/OH,8:/*H^-60,9:*/_^60,10://O, - @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf,NH,-60,//O,60,Ph, - @7,\*,O,-45,//O,60,Ph,11:*/OCO!>rl,12:/*OCO!^-15>lr - ) + if check_mc(mc)=0: MC(scantokens(mc)) fi ext( defaultscale:=0.8; label.lrt("FM(C): "&cal_FM,(0,h-5mm)); diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf index 0ebece8405f..4a3f4a766ab 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 4.57 Copyright (c) 2013-2021 Akira Yamaji +% mcf2graph ver 4.58 Copyright (c) 2013-2021 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, @@ -37,29 +37,55 @@ % Set to use plain.mp (label,arrow,atom) : mpost -s labeloffset=2 FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tracingstats:=1; -message "* This is mcf2graph ver 4.57 2021.02.11"; +message "* This is mcf2graph ver 4.58 2021.02.21"; %------------------------------------------------------------------------------------------------- newinternal cntA,cntB,cntM,minX,minY,maxX,maxY,sftX,sftY,com,par,envT,envB,lenT,lineT,angT,rotT, - crR,nA,nB,nC,nD,nE,nF,nN,nP,nU,nP,nL,nR,nS,nW,xpos,ypos,markA,markB,saveA,saveB,bondL; + crR,nA,nB,nC,nD,nE,nF,nS,nL,nR,nU,nP,xpos,ypos,markA,markB,saveA,saveB,bondL; numeric save_num[],comD[][],parD[][],adrD[][],cntD[],tbl_atom[],tbl_group[][],f_char[], tbl_atom_wt[],tbl_atom_mi[],tbl_char_wd[],tbl_char_ht[],addA[],add_rot[],chargeA[], com_group[][],par_group[][],cnt_group[],colorA[],colorB[],sumA[],bondC[],hideH[], lineB[],sB[],eB[],angB[],angA[],lenB[],angX[],numS[],wdM[],htM[],wdA[],dxA[]; -string info[],save_str[],tbl_atom_str[],strD[],tag[],out_file_name,out_file_aux, - out_file_rep,out_file_mpc,aux_delimiter,atomfont,mpfont,s_tag,s_var, - cal_FM,cal_MW,cal_MI,inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB,inf_MW; +string info[],mc[],save_str[],tbl_atom_str[],strD[],tag[],out_file_name,out_file_aux, + out_file_rep,out_file_mpc,aux_delimiter,atomfont,mpfont,s_tag,s_var,cal_FM,cal_MW,cal_MI, + inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB,inf_MW,mc,blank_str; pair save_pair[],posA[],posM[][],msize,mposition,fsize,fmargin,save_mposition,posBs,posBe; picture mol_stru[],atom_picture,save_picture,temp_picture; path arrow_path,dottedline_path,line_path,arrow_head; %------------------------------------------------------------------------------------------------- char_num:=str_cnt:=tbl_cnt:=proc_end:=mangle:=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_emu:=0; +sw_rep_out:=sw_mol_out:=sw_group_off:=sw_single:=sw_arrow_emu:=sw_indent_off:=0; numberA_start:=numberB_start:=1; numberA_end:=numberB_end:=4095; %------------------------------------------------------------------------------------------------- aux_max:=max_inf_num:=20; aux_delimiter:=";"; for i=1 upto aux_max: tag[i]:=""; endfor +blank_str:= " "; +%------------------------------------------------------------------------------------------------- +a_paren_s:=ASCII("("); a_paren_e:=ASCII(")"); a_brace_s:=ASCII("{"); a_brace_e:=ASCII("}"); +a_bracket_s:=ASCII("["); a_bracket_e:=ASCII("]"); a_comma:=ASCII(","); a_equal:=ASCII("="); +a_colon:=ASCII(":"); a_atmark:=ASCII("@"); a_zero:=ASCII("0"); a_nine:=ASCII("9"); +%-------------------------------------------------------------------------------------------------- +let DIV= /; let MUL= *; let LT= <; let GT= >; let AND= &; let :: = : ; let == = =; let ef=elseif; +def ]]]=] ] ] enddef; +%-------------------------------------------------------------------------------------------------- +primarydef a at b = fat(a,b) enddef; +def fat(expr a,b)= mposition:=b; a enddef; +def ext(text TXT)= sw_ext_all:=1; def EXT_ALL = TXT enddef; enddef; +def ext_clear= sw_ext_all:=0; def EXT_ALL = enddef; enddef; +%-------------------------------------------------------------------------------------------------- +vardef iif(expr a,b,c)=if a: b else: c fi enddef; +vardef subc(expr i,s)= substring(i-1,i) of s enddef; +vardef sfrt(expr a,b,c)= a shifted ((b,0) rotated c) enddef; +def wpcs expr n= withpen pencircle scaled n enddef; +def ppcs expr n= pickup pencircle scaled n enddef; +def sbp(expr m,n)expr p=subpath(m*length(p),n*length(p)) of p enddef; +%------------------------------------------------------------------------------------------------- +vardef fsr(expr n)(expr s)= (substring(0,n-length(s)) of blank_str)&s enddef; +vardef fsl(expr n)(expr s)= s&(substring(0,n-length(s)) of blank_str) enddef; +vardef fdr(expr n)(expr s)= fsr(n)(decimal(s)) enddef; +vardef fdl(expr n)(expr s)= fsl(n)(decimal(s)) enddef; +def warning(expr s)= message "% "&decimal(char_num)&fdr(3)(incr warning_cnt)&")"&s; enddef; %================================================================================================= if (known green)and(known ahlength): f_MP:=1; @@ -74,8 +100,8 @@ if (known green)and(known ahlength): def out_file_mol= jobname&"-"&fit_zero(char_num)&"-"&inf_EN&".mol" enddef; %--default ahangle=45--------------------------------------------------------------------- if ahangle=0: outputformat:="eps"; % eps format(.mps) - elseif ahangle=1: outputformat:="png"; hppp:=vppp:=0.12; % png format(600dpi) elseif ahangle=11: outputformat:="png"; hppp:=vppp:=0.24; % png format(300dpi) + elseif ahangle=1: outputformat:="png"; hppp:=vppp:=0.12; % png format(600dpi) elseif ahangle=12: outputformat:="png"; hppp:=vppp:=0.10; % png format(720dpi) elseif ahangle=13: outputformat:="png"; hppp:=vppp:=0.06; % png format(1200dpi) elseif ahangle=14: outputformat:="png"; hppp:=vppp:=0.04; % png format(1800dpi) @@ -154,13 +180,6 @@ if f_MP=1: message "* defaultfont="&defaultfont; fi %-------------------------------------------------------------------------------------------------- -let DIV= /; let MUL= *; let LT= <; let GT= >; let AND= &; let :: = : ; let == = =; let ef=elseif; -%-------------------------------------------------------------------------------------------------- -primarydef a at b = fat(a,b) enddef; -def fat(expr a,b)= mposition:=b; a enddef; -def ext(text TXT)= sw_ext_all:=1; def EXT_ALL = TXT enddef; enddef; -def ext_clear= sw_ext_all:=0; def EXT_ALL = enddef; enddef; -%-------------------------------------------------------------------------------------------------- ?3:=?20:=Ph:=Ph1:=Ph2:=hz:=0; vt:=1; ratio_chain_ring:=0.66; ratio_atom_bond:=0.36; ratio_thickness_bond:=0.015; ratio_thickness_char:=0.1; ratio_char_bond:=1.5; ratio_bondgap_bond:=0.15; @@ -190,14 +209,14 @@ parts_int_start:=3000; % 3001 => 4000 for internal parts (max 1000) def def_com(expr n)(text tx)= nA:=n; forsuffixes list=tx:: list:=nA; nA:=nA+1; endfor enddef; def_com(-4090)(_com,_jp_atom,_jp_absA,_jp_bond,_cyc,_cyc_sB,_cyc_eB,_set_line,_tmp_line, _chg_len,_get_len,_ring_len,_tmp_len,_rot_ang,_adj_ang,_chg_env,_tmp_env,_set_colorA,_set_colorB, - _group_si,_set_adr,_mk_bond,_set_atom,_arg_ang,_chg_atom,_tmp_rot,_fuse,_size_atom,_numeric, + _group_si,_set_adr,_mk_bond,_set_atom,_arrange_ang,_chg_atom,_tmp_rot,_fuse,_size_atom,_numeric, _jump_at,_set_add,_chg_add,_nop,_mark,_moff,_term,_len_s,_len_e,_len_ss,_len_ee, _group_s,_group_e,_rest,_charge, - si,dl,dr,db,dm,tm,wf,wb,bd,bz,zf,zb,dt,wv,nl,vf,vb,nb,si_,dl_,dr_,dm_,wf_,wb_,zf_,zb_,wv_,bd_); + si,dl,dl_,dr,dr_,db,dm,dm_,tm,wf,wb,bd,bz,zf,zb,dt,wv,nl,vf,vb,nb,si_,wf_,wb_,zf_,zb_,wv_,bd_); %-------------------------------------------------------------------------------------------------- def parameter_list= sw_rep_out,sw_numberA,sw_numberB,sw_mframe,sw_aux_out,sw_expand,sw_mol_out,sw_calc, - sw_single,sw_ext_all,sw_aframe,sw_fframe,sw_group_off,sw_trimming,sw_arrow_emu, + sw_single,sw_ext_all,sw_aframe,sw_fframe,sw_group_off,sw_trimming,sw_arrow_emu,sw_indent_off, ratio_atom_bond,ratio_thickness_bond,ratio_char_bond,ratio_chain_ring,ratio_bondgap_bond, ratio_zebra_black,ratio_zebragap_bond,ratio_thickness_char,ratio_wedge_bond,ratio_atomgap_atom, lonepairdiam,lonepairspace,blength,offset_atom,offset_wedge,max_blength,offset_zebra_gap, @@ -207,14 +226,6 @@ def parameter_list= Me,Et,CH3,NH,NH2,NO,NO2,OH,CHO,COOH,CN,SH,!CH3,!NH2,!NO2,!OH,!CHO,!COOH,!CN,!SH enddef; %-------------------------------------------------------------------------------------------------- -def ]]]=] ] ] enddef; -vardef iif(expr a,b,c)=if a: b else: c fi enddef; -vardef subc(expr i,s)= substring(i,i+1) of s enddef; -vardef sfrt(expr a,b,c)= a shifted ((b,0) rotated c) enddef; -def wpcs expr n= withpen pencircle scaled n enddef; -def ppcs expr n= pickup pencircle scaled n enddef; -def sbp(expr m,n)expr p=subpath(m*length(p),n*length(p)) of p enddef; -%-------------------------------------------------------------------------------------------------- def init_par(text t)= nA:=nB:=nC:=0; for list=t: @@ -247,29 +258,42 @@ enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% def beginfont(text s)= begingroup - save ',f_beginchar,f_ext,blen,ext,add,ang_br; + save ',f_beginchar,f_ext,blen,ext,add,ang_br,s_fw,s_bw,s_len,at_colon; %------------------------------------------------------------------------------------------------ def ext=ext_to_font enddef; def add=add_to_molecule enddef; - vardef '(text TXT)== read_mcf(incr parts_cnt)((_com,_mark),TXT,(_com,_rest)); parts_cnt enddef; + def '=read_ud enddef; %------------------------------------------------------------------------------------------------ inf_NO:=inf_EN:=inf_JN:=inf_MW:=inf_FM:=inf_CAS:=inf_USE:=inf_EXA:=inf_EXB:="-"; - cal_MW:=cal_MI:=cal_FM:=""; + mc:=cal_MW:=cal_MI:=cal_FM:=""; %------------------------------------------------------------------------------------------------ parts_cnt:=parts_usr_start; parts_int:=parts_int_start; %------------------------------------------------------------------------------------------------ char_num:=char_num+1; store_par(parameter_list); - for i:=1 upto max_inf_num: info[i]:=":"; endfor - f_ext:=inf_num:=cntM:=0; + for i:=1 upto max_inf_num: info[i]:=":"; mc[i]:=""; endfor + f_ext:=inf_num:=cntM:=mc_low:=0; for list=s: inf_num:=inf_num+1; info[inf_num]:=list; endfor %------------------------------------------------------------------------------------------------ for j=1 upto inf_num: - nA:=0; for i=0 upto length(info[j]): if subc(i,info[j])=":": nA:=i; fi exitif nA>0; endfor - if nA>0: - s_tag:=substring (0,nA) of info[j]; - s_var:=substring (nA+1,length(info[j])) of info[j]; + at_colon:=0; + for i=1 upto 9: if subc(i,info[j])=":": at_colon:=i; fi exitif at_colon>0; endfor + s_len:=length(info[j]); + if at_colon=1: + s_fw:=0; for k=2 upto s_len: if subc(k,info[j])<>" ": s_fw:=k; fi exitif s_fw>0; endfor + s_bw:=0; for k=s_len downto 2: if subc(k,info[j])<>" ": s_bw:=k; fi exitif s_bw>0; endfor + mc_low:=mc_low+1; + if sw_indent_off=0: + mc[mc_low]:=substring (2,s_len) of info[j]; + mc:=mc&substring (s_fw-1,s_bw) of info[j]; + else: + mc[mc_low]:=substring (s_fw-1,s_len) of info[j]; + mc:=mc&mc[mc_low]; + fi + ef at_colon>=1: + s_tag:=substring (0,at_colon-1) of info[j]; + s_var:=substring (at_colon,s_len) of info[j]; if known scantokens("inf_"&s_tag): scantokens("inf_"&s_tag):=s_var; fi fi endfor @@ -278,35 +302,46 @@ def beginfont(text s)= enddef; %================================================================================================== def endfont= - if sw_ext_all=1: ext_to_font(EXT_ALL); fi - if sw_trimming>=1: - nA:=nC:=4095; nB:=nD:=-4095; - for i=1 upto cntM: - if xpart(posM[1][i])<nA: nA:=xpart(posM[1][i]); fi - if xpart(posM[2][i])>nB: nB:=xpart(posM[2][i]); fi - if ypart(posM[1][i])<nC: nC:=ypart(posM[1][i]); fi - if ypart(posM[2][i])>nD: nD:=ypart(posM[2][i]); fi - endfor - font_wd:=nB-nA+2margin_lr; - font_ht:=nD-nC+2margin_tb; - fsize:=(font_wd,font_ht); + if cntM>=1: + %----------------------------------------------------------------------------------------- + if sw_ext_all=1: ext_to_font(EXT_ALL); fi + if sw_trimming>=1: + nA:=nC:=4095; nB:=nD:=-4095; + for i=1 upto cntM: + if xpart(posM[1][i])<nA: nA:=xpart(posM[1][i]); fi + if xpart(posM[2][i])>nB: nB:=xpart(posM[2][i]); fi + if ypart(posM[1][i])<nC: nC:=ypart(posM[1][i]); fi + if ypart(posM[2][i])>nD: nD:=ypart(posM[2][i]); fi + endfor + font_wd:=nB-nA+2margin_lr; + font_ht:=nD-nC+2margin_tb; + fsize:=(font_wd,font_ht); + for i=1 upto cntM: + posM[0][i]:=posM[0][i]+(margin_lr-nA,margin_tb-nC); + posM[1][i]:=posM[1][i]+(margin_lr-nA,margin_tb-nC); + endfor + fi + %---------------------------------------------------------------------------------------- + if f_MP=0: beginchar(char_num,font_wd/bp*bp#,font_ht/bp*bp#,0) + else: beginfig(char_num) w:=charwd:=font_wd; h:=charht:=font_ht; chardp:=0; + fi + if (sw_fframe=1)or(sw_fframe=3): ext(draw_frame((0,0),w,h,thickness_fframe);) fi + if (sw_fframe=2)or(sw_fframe=3): ext(draw_frame(p0,w0,h0,thickness_fframe);) fi + if sw_fframe=4: ext(draw_corner((0,0),w,h,0.2bp);) fi for i=1 upto cntM: - posM[0][i]:=posM[0][i]+(margin_lr-nA,margin_tb-nC); - posM[1][i]:=posM[1][i]+(margin_lr-nA,margin_tb-nC); + addto currentpicture also mol_stru[i] shifted posM[0][i]; mol_stru[i]:=nullpicture; + if sw_mframe=1: ext(draw_frame(p[i],w[i],h[i],thickness_mframe)) fi endfor + if f_ext=1: addto currentpicture also mol_stru[0]; mol_stru[0]:=nullpicture; fi + %----------------------------------------------------------------------------------------- + else: + font_wd:=xpart(fsize); font_ht:=ypart(fsize); + if f_MP=0: beginchar(char_num,font_wd/bp*bp#,font_ht/bp*bp#,0) + else: beginfig(char_num) w:=charwd:=font_wd; h:=charht:=font_ht; + fi + draw (0,h)--(0,0)--(w,0)--(w,h)--(0,h)--(w,0) wpcs 0.2bp; fi - %----------------------------------------------------------------------------------------------- - if f_MP=0: beginchar(char_num,font_wd/bp*bp#,font_ht/bp*bp#,0) - else: beginfig(char_num) w:=charwd:=font_wd; h:=charht:=font_ht; chardp:=0; - fi - if (sw_fframe=1)or(sw_fframe=3): ext(draw_frame((0,0),w,h,thickness_fframe);) fi - if (sw_fframe=2)or(sw_fframe=3): ext(draw_frame(p0,w0,h0,thickness_fframe);) fi - if sw_fframe=4: ext(draw_corner((0,0),w,h,0.2bp);) fi - for i=1 upto cntM: - addto currentpicture also mol_stru[i] shifted posM[0][i]; mol_stru[i]:=nullpicture; - if sw_mframe=1: ext(draw_frame(p[i],w[i],h[i],thickness_mframe)) fi - endfor - if f_ext=1: addto currentpicture also mol_stru[0]; mol_stru[0]:=nullpicture; fi + %----------------------------------------------------------------------------------------- endchar; clearit; restore_par(parameter_list); @@ -321,28 +356,36 @@ enddef; def set_def_MC= save /,//,/*,*/,**,*/*,~,^,',`,<,>,&,:,=,\,\\,*\,\*,*\*,@,$,&,#,##,{,},|,||,_,inside_def_MC; inside_def_MC:=1; - _:=Me; - tertiarydef a=b == if (known a)and(known b):: change_bond(a,b) else:: _nop fi enddef; - tertiarydef a:b == if (known a)and(known b):: change_atom(a,b) else:: _nop fi enddef; - def { == read_number( enddef; let } == ); def <primary n == (_rot_ang,n) enddef; - tertiarydef a^b == if known b:: (_tmp_rot,b),a else:: _nop,a fi enddef; - tertiarydef a`b == if known b:: (_tmp_len,b),a else:: _nop,a fi enddef; - tertiarydef a~b == if known b:: (_tmp_line,b),a else:: _nop,a fi enddef; - tertiarydef a>b == if known b:: (_tmp_env,b),a else:: _nop,a fi enddef; - def @primary n == (_jp_atom,n) enddef; def &primary n == (_cyc,n) enddef; - def \ == 0 enddef; def \\ == \~dm enddef; def *\ == \~wf enddef; def \* == \~zf enddef; - def *\* == \~wv enddef; - def | == (_com,_mark) enddef; def || == (_com,_moff) enddef; - def #primary n == (_com,_len_s),(_chg_len,n) enddef; def ## == (_com,_len_e) enddef; - def /secondary n == if known n:: (_group_si,n) else:: _nop fi enddef; - def //secondary n == /n~dm enddef; def */secondary n == /n~wf enddef; - def /*secondary n == /n~zf enddef; def */*secondary n == /n~wv enddef; - def **secondary n == /n~nb enddef; vardef $primary a == a-4095 enddef; - vardef '(text TXT)==read_mcf(incr parts_cnt)(|,#crR,TXT,##,(_com,_rest)); parts_cnt enddef; + pair |,||,##; + | :=(_com,_mark); || := (_com,_moff); ##:=(_com,_len_e); + _:=Me; \:=0; \\:=zero_dm; *\:=zero_wf; \*:=zero_zf; *\*:=zero_wv; + let = ==op_equ; let : ==op_col; let ^ ==op_hat; let ~ ==op_til; let > ==op_lt; let ` ==op_bq; + def { == read_number( enddef; let } == ); def '==read_id enddef; + def < == rot_angle enddef; def @ == jump_atom enddef; def & == cyc_atom enddef; + def # == chg_length enddef; def $ == abs_adress enddef; + def / == group_si enddef; def // == group_dm enddef; def */ == group_wf enddef; + def /* == group_zf enddef; def */* == group_wv enddef; def ** == group_nb enddef; enddef; %------------------------------------------------------------------------------------------------- -def CP == com_par enddef; def CPe == com_par_ex(0) enddef; def CPx == com_par_ex(1) enddef; vardef '(text TXT)= parts_cnt:=parts_cnt+1; read_mcf(parts_cnt)(TXT); parts_cnt enddef; +vardef read_id(text TXT)=read_mcf(incr parts_cnt)(|,#crR,TXT,##,(_com,_rest)); parts_cnt enddef; +vardef read_ud(text TXT)=read_mcf(incr parts_cnt)(|,TXT,(_com,_rest)); parts_cnt enddef; +tertiarydef a op_equ b = if (known a)and(known b):: change_bond(a,b) else:: _nop fi enddef; +tertiarydef a op_col b = if (known a)and(known b):: change_atom(a,b) else:: _nop fi enddef; +tertiarydef a op_hat b = if known b:: (_tmp_rot,b),a else:: _nop,a fi enddef; +tertiarydef a op_til b = if known b:: (_tmp_line,b),a else:: _nop,a fi enddef; +tertiarydef a op_lt b = if known b:: (_tmp_env,b),a else:: _nop,a fi enddef; +tertiarydef a op_bq b = if known b:: (_tmp_len,b),a else:: _nop,a fi enddef; +def rot_angle primary n = (_rot_ang,n) enddef; def jump_atom primary n = (_jp_atom,n) enddef; +def cyc_atom primary n = (_cyc,n) enddef; +def chg_length primary n = (_com,_len_s),(_chg_len,n) enddef; +def group_si secondary n == if known n:: (_group_si,n) else:: _nop fi enddef; +def group_dm secondary n == /n~dm enddef; def group_wf secondary n == /n~wf enddef; +def group_zf secondary n == /n~zf enddef; def group_wv secondary n == /n~wv enddef; +def group_nb secondary n == /n~nb enddef; +vardef abs_adress primary n == n-4095 enddef; +%------------------------------------------------------------------------------------------------- +def CP = com_par enddef; def CPe = com_par_ex(0) enddef; def CPx = com_par_ex(1) enddef; %================================================================================================= def read_mcf(expr n)(text TXT)= begingroup @@ -362,12 +405,8 @@ def read_mcf(expr n)(text TXT)= else:: nCP:=nCP+1; comD[n][nCP]:=_mk_bond; parD[n][nCP]:=list; fi elseif string list:: - if (list=="+")or(list=="-"):: - nCP:=nCP+1; comD[n][nCP]:=_set_add; parD[n][nCP]:=ASCII(list); - else:: - str_cnt:=str_cnt+1; strD[str_cnt]:=list; - nCP:=nCP+1; comD[n][nCP]:=_set_atom; parD[n][nCP]:=str_cnt; - fi + str_cnt:=str_cnt+1; strD[str_cnt]:=list; + nCP:=nCP+1; comD[n][nCP]:=_set_atom; parD[n][nCP]:=str_cnt; fi else:: message "unknown command in "AND decimal(n); fi @@ -378,20 +417,20 @@ enddef; %------------------------------------------------------------------------------------------------- vardef read_number(text TXT)= parts_int:=parts_int+1; - nN:=0; + nA:=0; for list==TXT:: if known list:: if numeric list:: if list==_nop:: message "unknown command in "AND decimal(parts_int); - else:: nN:=nN+1; comD[parts_int][nN]:=_numeric; parD[parts_int][nN]:=list; + else:: nA:=nA+1; comD[parts_int][nA]:=_numeric; parD[parts_int][nA]:=list; fi elseif pair list:: - nN:=nN+1; comD[parts_int][nN]:=xpart(list); parD[parts_int][nN]:=ypart(list); + nA:=nA+1; comD[parts_int][nA]:=xpart(list); parD[parts_int][nA]:=ypart(list); fi else:: message "unknown command in "AND decimal(parts_int); fi endfor - cntD[parts_int]:=nN; + cntD[parts_int]:=nA; parts_int %------- Retern value ------- enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -465,9 +504,10 @@ vardef change_atom(expr a,b)= CP(_tmp_line,dm) CP(_tmp_rot,-35) CPx(a)(_group_si,O) CP(_com,_group_e) ef b==SO:: CPe(a)(_chg_atom,S) CP(_com,_group_s) CP(_tmp_line,dm) CPx(a)(_group_si,O) CP(_com,_group_e) + ef b==n_:: CP(_com,_group_s) CP(_set_add,ASCII("-")) CP(_chg_add,a) CP(_com,_group_e) + ef b==p_:: CP(_com,_group_s) CP(_set_add,ASCII("+")) CP(_chg_add,a) CP(_com,_group_e) fi ef pair b:: CP(_com,_group_s) CPx(a)(xpart(b),ypart(b)) CP(_com,_group_e) - ef string b:: CP(_com,_group_s) CP(_set_add,ASCII(b)) CP(_chg_add,a) CP(_com,_group_e) ef color b:: color_list[incr cntC]:=b; CPe(a)(_set_colorA,cntC) fi cntD[parts_int]:=nCP; @@ -495,13 +535,13 @@ def puts(expr POS)(expr STR)= temp_p:=POS; nC:=defaultscale*defaultsize; if (defaultfont="draw")or(f_MP=0): - for i=0 upto length(STR)-1: + for i=1 upto length(STR): temp_c:=subc(i,STR); draw_char(temp_c,temp_p,nC,ratio_thickness_char*nC,0); temp_p:=temp_p+(nC*tbl_char_wd[ASCII(temp_c)],0); endfor else: - for i=0 upto length(STR)-1: + for i=1 upto length(STR): temp_c:=subc(i,STR); temp_picture:=temp_c infont defaultfont scaled defaultscale; addto currentpicture also temp_picture shifted temp_p; @@ -554,11 +594,11 @@ def add_to_molecule(text TXT)= lonepairspace:=.7aw; circlediam:=.6aw; circlepen:=.2bp; - for i=1 upto An: + for i=1 upto cntA: A[i]:=posA[i]; A[i]ang:=angX[i]; A[i]up:=dir(angX[i]); A[i]left:=dir(angX[i]+90); A[i]right:=dir(angX[i]-90); A[i]down:=dir(angX[i]+180); endfor - for i=1 upto Bn: + for i=1 upto cntB: B[i]s:=posA[sB[i]]; B[i]e:=posA[eB[i]]; B[i]m:=0.5[B[i]s,B[i]e]; B[i]:=B[i]s--B[i]e; B[i]ang:=angB[i]; B[i]up:=dir(angB[i]); @@ -652,18 +692,18 @@ vardef lone_pair_add expr ANG= enddef; %-------------------------------------------------------------------------------------------------- vardef label_emu@#(expr OBJ,POS) = %% modified 'thelabel@#(expr s,z)' of plain.mp - save oft,fx,fy,wds,pA,pB,pC,pD,sC; + save oft,fx,fy,wd_s,wd_c,pA,pB,pC,pD,sC; pair oft,oft.lft,oft.rt,oft.top,oft.bot,oft.ulft,oft.llft,oft.urt,oft.lrt,pA,pB,pC,pD; - wds:=0; - nC:=defaultscale*defaultsize; + wd_s:=0; + wd_c:=defaultscale*defaultsize; %--------------------------------------------------------------- if string OBJ: if (defaultfont="draw")or(f_MP=0): - for i=0 upto length(OBJ)-1: wds:=wds+nC*tbl_char_wd[ASCII(subc(i,OBJ))]; endfor + for i=1 upto length(OBJ): wd_s:=wd_s+wd_c*tbl_char_wd[ASCII(subc(i,OBJ))]; endfor else: - for i=0 upto length(OBJ)-1: + for i=1 upto length(OBJ): temp_picture:=subc(i,OBJ) infont defaultfont scaled defaultscale; - wds:=wds+xpart(lrcorner temp_picture-llcorner temp_picture); + wd_s:=wd_s+xpart(lrcorner temp_picture-llcorner temp_picture); endfor fi fi @@ -679,7 +719,7 @@ vardef label_emu@#(expr OBJ,POS) = %% modified 'thelabel@#(expr s,z)' of plain.m oft.lrt:= ( .7,-.7); fx.lrt:=0; fy.lrt:=1; %--------------------------------------------------------------- if string OBJ: - puts(POS+(labeloffset*oft@#)-(wds*fx@#,nC*fy@#))(OBJ); + puts(POS+(labeloffset*oft@#)-(wd_s*fx@#,wd_c*fy@#))(OBJ); elseif picture OBJ: pA:=llcorner(OBJ); pB:=urcorner(OBJ); @@ -730,8 +770,8 @@ enddef; def MC(text TXT)= begingroup save f_bra,strAT,cnt_group,temp_lenE,temp_lenF,temp_cntB,f_term,f_at,f_lineT,f_rotT, - f_lenT,f_envT,sA,factor,m_wd,m_ht,temp_p,defaultsize,defaultscale; - string sA; + f_lenT,f_envT,temp_c,factor,m_wd,m_ht,temp_p,defaultsize,defaultscale; + string temp_c; pair temp_p; %----------------------------------------------------------------------------------------------- if (sw_numberA>=1)or(sw_numberB>=1): ratio_atom_bond:=0.25; fi @@ -775,13 +815,13 @@ def MC(text TXT)= %-draw add to atom------------------------------------------------------------------------------ for i=1 upto cntA: if addA[i]<>0: - sA:=char(addA[i]); nA:=angX[i]+add_rot[i]; nC:=nA mod 90; - if sA="+": chargeA[i]:=1; elseif sA="-": chargeA[i]:=-1; else: chargeA[i]:=0; fi + temp_c:=char(addA[i]); nA:=angX[i]+add_rot[i]; nC:=nA mod 90; + if temp_c="+": chargeA[i]:=1; elseif temp_c="-": chargeA[i]:=-1; else: chargeA[i]:=0; fi if numS[i]=0: nB:=.5atom_wd; else: nB:=.85wdA[i]+iif(nC<45,sind(nC),cosd(nC))*.5wdA[i]; fi temp_p:=sfrt(posA[i]-(.35atom_wd,.35atom_wd),nB,nA); - draw_char(sA,temp_p,atom_wd,bond_pen_wd*ratio_char_bond,0); + draw_char(temp_c,temp_p,atom_wd,bond_pen_wd*ratio_char_bond,0); else: chargeA[i]:=0; fi endfor @@ -885,8 +925,10 @@ def draw_corner(expr PS,LX,LY,PN)= enddef; %------------------------------------------------------------------------------------------------- def proc_size_setup= - if (blen*ratio_atom_bond+offset_atom)<.8blen: atom_wd:=blen*ratio_atom_bond+offset_atom; - else: atom_wd:=.8blen; ratio_chain_ring:= .5; + if (blen*ratio_atom_bond+offset_atom)<.8blen: + atom_wd:=blen*ratio_atom_bond+offset_atom; + else: + atom_wd:=.8blen; ratio_chain_ring:= .5; fi wedge_wd:= blen*ratio_wedge_bond+offset_wedge; zebra_gap:= blen*ratio_zebragap_bond+offset_zebra_gap; @@ -902,11 +944,11 @@ def proc_scaling= ypos:=ypart(posA[i]); if numS[i]<>0: nU:=nD:=nP:=nL:=nR:=0; - for j=0 upto length(strD[numS[i]])-1: - sA:=subc(j,strD[numS[i]]); - if (sA="^"): nU:=.5atom_wd; - elseif (sA="_"): nD:=.5atom_wd; - elseif (sA<>"{")and(sA<>"}"): nP:=nP+atom_wd*tbl_char_wd[ASCII(sA)]; + for j=1 upto length(strD[numS[i]]): + temp_c:=subc(j,strD[numS[i]]); + if (temp_c="^"): nU:=.5atom_wd; + elseif (temp_c="_"): nD:=.5atom_wd; + elseif (temp_c<>"{")and(temp_c<>"}"): nP:=nP+atom_wd*tbl_char_wd[ASCII(temp_c)]; fi endfor if (angX[i]<=90)or(angX[i]>=270): nR:=nP; else: nL:=nP; fi @@ -923,12 +965,11 @@ enddef; %------------------------------------------------------------------------------------------------- def char_use_check= for i=1 upto 128: f_char[i]:=0; endfor - if (sw_numberA<>0)or(sw_numberB<>0): - for j=ASCII("0") upto ASCII("9"): f_char[j]:=1; endfor + if (sw_numberA<>0)or(sw_numberB<>0): for j=a_zero upto a_nine: f_char[j]:=1; endfor else: for i=1 upto cntA: if numS[i]<>0: - for j=0 upto length(strD[numS[i]])-1: f_char[ASCII(subc(j,strD[numS[i]]))]:=1; endfor + for j=1 upto length(strD[numS[i]]): f_char[ASCII(subc(j,strD[numS[i]]))]:=1; endfor fi endfor fi @@ -1012,10 +1053,9 @@ def proc_skeleton(expr a)= ef com=_jp_atom: termB; adrT:=getA(par); posBs:=posA[adrT]; angT:=angX[adrT]; f_bra:=1; rotT:=0; ef com=_jp_absA: adrT:=par; posBs:=posA[adrT]; angT:=angX[adrT]; f_bra:=1; rotT:=0; temp_cntB:=cntB; - ef com=_adj_ang: if (angT<40)or(angT>320): angT:=0; - ef angT<140: angT:=90; ef angT<220: angT:=180; else: angT:=270; fi - ef com=_rot_ang: angT:=(angT+par) mod 360; - ef com=_tmp_rot: rotT:=par; + ef com=_adj_ang: angT:=adjust_ang(angT); + ef com=_rot_ang: angT:=(angT+par) mod 360; + ef com=_tmp_rot: rotT:=par; ef com=_group_si: rotT:=0; ef com=_chg_env: envB:=par; ef com=_tmp_env: envT:=par; @@ -1028,7 +1068,7 @@ def proc_skeleton(expr a)= enddef; %------------------------------------------------------------------------------------------------- def add_bond(expr ROT,FLG)= - if ROT=_arg_ang: nA:=arrange_ang(angT mod 360); else: nA:=ROT; fi + if ROT=_arrange_ang: nA:=arrange_ang(angT mod 360); else: nA:=ROT; fi if f_bra=0: adrT:=cntA:=cntA+1; posA[cntA]:=posBs; angA[cntA]:=angT; angX[cntA]:=(angT+nA/2+iif(nA>=0,-90,90)) mod 360; @@ -1052,12 +1092,14 @@ vardef arrange_ang(expr n)= if cntB=0: angT:=(angT-180) mod 360; 180 else: if envB>=parts_emb_start: parD[envB][cntB-temp_cntB+2] - else: if envB=hz: if n=0: 60 ef n<=90:-60 ef n<=180: 60 ef n<270: -60 else: 60 fi - ef envB=vt: if n=0:-60 ef n<90: 60 ef n<=180:-60 ef n<=270: 60 else:-60 fi + else: if envB=hz: if n=0: 60 ef n<=90: -60 ef n<=180: 60 ef n<270: -60 else: 60 fi + ef envB=vt: if n=0: -60 ef n<90: 60 ef n<=180: -60 ef n<=270: 60 else: -60 fi ef abs(envB)<=180: envB fi fi fi enddef; +%------------------------------------------------------------------------------------------------- +vardef adjust_ang(expr n)= if (n<40)or(n>320): 0 ef n<140: 90 ef n<220: 180 else: 270 fi enddef; %================================================================================================= vardef getA(expr n)= if n>=0: markA+n ef n>=-999: cntA+n+1 else: n+4095 fi enddef; vardef getB(expr n)= if n>=0: markB+n ef n>=-999: cntB+n+1 else: n+4095 fi enddef; @@ -1085,44 +1127,45 @@ enddef; def draw_atom(expr NUM)= begingroup if numS[NUM]<>0: - save slen,f_wd,f_ht,r_ff,pA,pB,sA,sB,dx; - string sA,sB; - pair pA,pB; + save slen,f_wd,f_ht,r_ff,pos_a,pos_c,temp_c,temp_s,dir_str; + string temp_c,temp_s; + pair pos_a,pos_c; %------------------------------------------------------- - sA:=strD[numS[NUM]]; slen:=length(sA)-1; nA:=angX[NUM]; - dxA[NUM]:=dx:=iif((nA<=90)or(nA>=270),1,-1); - wdA[NUM]:=nC:=0; pB:=(0,0); - pA:=posA[NUM]-(.5atom_wd*dx,.5atom_wd); + temp_s:=strD[numS[NUM]]; slen:=length(temp_s); nA:=angX[NUM]; + dxA[NUM]:=dir_str:=iif((nA<=90)or(nA>=270),1,-1); + wdA[NUM]:=nC:=0; pos_c:=(0,0); + pos_a:=posA[NUM]-(.5atom_wd*dir_str,.5atom_wd); if (atomfont<>"draw")and(f_MP=1): atom_picture:="C" infont atomfont; r_ff:=atom_wd/(ypart(ulcorner atom_picture)-ypart(llcorner atom_picture)); fi - for i=0 upto slen: + for i=1 upto slen: if nC=0: - sB:=subc(i,sA); - if (dx=-1)and(sB="{"): - nD:=i+1; nC:=0; for j=nD upto slen: nC:=nC+1; exitif subc(j,sA)="}"; endfor + temp_c:=subc(i,temp_s); + if (dir_str=-1)and(temp_c="{"): + nD:=i; nC:=0; for j=nD upto slen: nC:=nC+1; exitif subc(j,temp_s)="}"; endfor fi - else: nC:=nC-1; sB:=subc(nD+nC,sA); + else: nC:=nC-1; temp_c:=subc(nD+nC,temp_s); fi - if sB="_": pB:=iif(pB=(0,0),(0,-.5atom_wd),(0,0)); - elseif sB="^": pB:=iif(pB=(0,0),(0, .5atom_wd),(0,0)); - elseif (sB<>"{")and(sB<>"}"): + if temp_c="_": pos_c:=iif(pos_c=(0,0),(0,-.5atom_wd),(0,0)); + elseif temp_c="^": pos_c:=iif(pos_c=(0,0),(0, .5atom_wd),(0,0)); + elseif (temp_c<>"{")and(temp_c<>"}"): if (atomfont="draw")or(f_MP=0): - f_wd:=atom_wd*tbl_char_wd[ASCII(sB)]; - if dx=-1: pA:=pA-(f_wd,0); fi - draw_char(sB,pA+pB,atom_wd,bond_pen_wd*ratio_char_bond,NUM); - if sw_aframe=1: draw_frame(pA+pB,f_wd,atom_wd,thickness_aframe); fi - if dx=1: pA:=pA+(f_wd,0); fi + f_wd:=atom_wd*tbl_char_wd[ASCII(temp_c)]; + if dir_str=-1: pos_a:=pos_a-(f_wd,0); fi + draw_char(temp_c,pos_a+pos_c,atom_wd,bond_pen_wd*ratio_char_bond,NUM); + if sw_aframe=1: draw_frame(pos_a+pos_c,f_wd,atom_wd,thickness_aframe); fi + if dir_str=1: pos_a:=pos_a+(f_wd,0); fi else: - atom_picture:=sB infont atomfont; + atom_picture:=temp_c infont atomfont; f_wd:=(xpart(lrcorner atom_picture)-xpart(llcorner atom_picture))*r_ff; f_ht:=(ypart(urcorner atom_picture)-ypart(llcorner atom_picture))*r_ff; - if dx=-1: pA:=pA-(f_wd,0); fi + if dir_str=-1: pos_a:=pos_a-(f_wd,0); fi addto currentpicture also atom_picture scaled (r_ff*(1-2ratio_atomgap_atom)) - shifted (pA+pB+(f_wd*ratio_atomgap_atom,f_ht*ratio_atomgap_atom)) Cp(colorA[NUM]); - if sw_aframe=1: draw_frame(pA+pB,f_wd,f_ht,thickness_aframe); fi - if dx=1: pA:=pA+(f_wd,0); fi + shifted (pos_a+pos_c+(f_wd*ratio_atomgap_atom,f_ht*ratio_atomgap_atom)) + Cp(colorA[NUM]); + if sw_aframe=1: draw_frame(pos_a+pos_c,f_wd,f_ht,thickness_aframe); fi + if dir_str=1: pos_a:=pos_a+(f_wd,0); fi fi wdA[NUM]:=wdA[NUM]+f_wd; fi @@ -1219,7 +1262,7 @@ vardef frame_str(expr NUM)= enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% def char_size_set(expr WD)(expr HT)(expr STR)= - for j=0 upto length(STR)-1: + for j=1 upto length(STR): nA:=ASCII(subc(j,STR)); tbl_char_wd[nA]:=WD; tbl_char_ht[nA]:=HT; endfor enddef; @@ -1227,7 +1270,7 @@ enddef; char_size_set( 1)( 1)("CGHMNOQW"); char_size_set( .9)( 1)("ABDFIJKPRSTUVXY/><#\%@"); char_size_set( .8)( 1)("ELZ&"); -char_size_set( .7)( 1)(" ()[]0123456789nh=tfg?~^"); +char_size_set( .7)( 1)(" ()[]{}0123456789nh=tfg?~^"); char_size_set( .7)( .9)("$"); char_size_set( .7)( .7)("-+*_"); char_size_set(.45)(.95)("l"); @@ -1254,10 +1297,10 @@ def dwvs (expr n)expr p= def dwh expr p=draw (p) withpen penrazor rotated 90 scaled fP shifted pos Cp(colorA[NUM]) enddef; def cdw expr p=cutdraw (p) shifted pos Cp(colorA[NUM]) enddef; %------------------------------------------------------------------------------------------------- -sC:=CHR; fP:=PEN; hP:=0.5fP; nW:=WD; -aW:=nW*tbl_char_wd[ASCII(sC)]*(1-2ratio_atomgap_atom); -aH:=nW*tbl_char_ht[ASCII(sC)]*(1-2ratio_atomgap_atom); -pos:=POS+(nW*ratio_atomgap_atom,nW*ratio_atomgap_atom); +sC:=CHR; fP:=PEN; hP:=0.5fP; +aW:=WD*tbl_char_wd[ASCII(sC)]*(1-2ratio_atomgap_atom); +aH:=WD*tbl_char_ht[ASCII(sC)]*(1-2ratio_atomgap_atom); +pos:=POS+(WD*ratio_atomgap_atom,WD*ratio_atomgap_atom); %------------------------------------------------------------------------------------------------- fW:=aW-hP; hW:=.5aW; fH:=aH-hP; hH:=.5aH; Z01:=( 0,hP); Z02:=(hP, 0); Z03:=(hP,hP); Z04:=(aW,hP); Z05:=(fW, 0); Z06:=(hW,aH); Z07:=(hW, 0); @@ -1350,8 +1393,10 @@ ef sC="(": dw Z19...Z09...Z14; ef sC=")": dw Z19...Z10...Z14; ef sC="[": dwv Z07--Z06; dwh Z14--Z22; dwh Z19--Z21; ef sC="]": dwv Z07--Z06; dwh Z14--Z13; dwh Z03--Z19; -ef sC="<": cdw Z01--Z17--Z12; -ef sC=">": cdw Z16--Z08--Z04; +ef sC="{": dw Z19..(.3aW,.2aH)..(.3aW,.45aH)..(.2aW,.5aH)..(.3aW,.55aH)..(.3aW,.8aH)..Z14; +ef sC="}": dw Z19..(.7aW,.2aH)..(.7aW,.45aH)..(.8aW,.5aH)..(.7aW,.55aH)..(.7aW,.8aH)..Z14; +ef sC="<": cdw Z16--Z08--Z04; +ef sC=">": cdw Z01--Z17--Z12; ef sC="-": dwh Z09--Z10; ef sC="=": dwh (hP,.3aH)--(fW,.3aH); dwh (hP,.6aH)--(fW,.6aH); ef sC="/": dw Z22..Z01; @@ -1372,31 +1417,24 @@ ef sC="&": cdw Z21..(hW,.35aH)..(.25aW,.75aH)..(hW,.fH)..(.75aW,.75fH)..(hP,.3aH ef sC="@": cdw sbp(0,.7)zO; dwv (fW,hH)--(fW,0); dw (fW,.45aH)..(.7aW,.75aH)..(.3aW,.45aH)..(.7aW,.15aH)..cycle; ef sC="_": dwh Z01--Z04; -ef sC="^": dwv (hP,.6aH)..(.5aW,.7aH)..(fW,.6aH); +ef sC="^": dw (hP,.6aH)--(.5aW,fH)--(fW,.6aH); else: fi endgroup enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -def blank_str:= " " enddef; -vardef fixed_r(expr n)(expr s)= (substring(0,n-length(s)) of blank_str)&s enddef; -vardef fixed_l(expr n)(expr s)= s&(substring(0,n-length(s)) of blank_str) enddef; -vardef fdr(expr n)(expr s)=fixed_r(n)(decimal(s)) enddef; -vardef fdl(expr n)(expr s)=fixed_l(n)(decimal(s)) enddef; -def warning(expr s)= message "% "&decimal(char_num)&fdr(3)(incr warning_cnt)&")"&s; enddef; -%------------------------------------------------------------------------------------------------- def warning_bond(expr a)= if addA[a]=0: - warning("A"&decimal(a)&" ( "&fixed_l(8)(strD[numS[a]])&") has"&fdr(2)(bond_cnt)&" bonds"); + warning("A"&decimal(a)&" ( "&fsl(8)(strD[numS[a]])&") has"&fdr(2)(bond_cnt)&" bonds"); fi enddef; %------------------------------------------------------------------------------------------------- -vardef cut_paren(expr ATOM)= +vardef erase_brace(expr ATOM)= save temp_c,temp_s; string temp_c,temp_s; temp_s:=""; if (length(ATOM)>=4)and(ATOM<>"COOH"): - for i=0 upto length(ATOM)-1: + for i=1 upto length(ATOM): temp_c:=subc(i,ATOM); if (temp_c<>"{")and(temp_c<>"}")and(temp_c<>"_")and(temp_c<>"^") and(temp_c<>"+")and(temp_c<>"-"): @@ -1417,11 +1455,11 @@ def proc_calc= knownA:=bond_cnt:=0; nS:=numS[i]; for j=1 upto cntB: - if (lineB[j]>=dl)and(lineB[j]<=dm): bondC[j]:=2; - ef lineB[j]=tm: bondC[j]:=3; - ef (lineB[j]=vf)or(lineB[j]=vb): bondC[j]:=0; - ef lineB[j]=0: bondC[j]:=0; - else: bondC[j]:=1; + if (lineB[j]>=dl)and(lineB[j]<=dm_): bondC[j]:=2; + ef lineB[j]=tm: bondC[j]:=3; + ef (lineB[j]=vf)or(lineB[j]=vb): bondC[j]:=0; + ef lineB[j]=0: bondC[j]:=0; + else: bondC[j]:=1; fi if (sB[j]=i)or(eB[j]=i): bond_cnt:=bond_cnt+bondC[j]; fi endfor @@ -1464,15 +1502,13 @@ def proc_calc= if (tbl_atom_max=1)and(sumA[2]>0): tbl_atom_max:=2; fi for i=1 upto tbl_atom_max: if sumA[i]>=1: - nA:=tbl_atom_wt[i]/100*sumA[i]; - nB:=tbl_atom_mi[i]/100*sumA[i]; - cen_MW:=cen_MW+nA; - cen_MI:=cen_MI+nB; + nA:=tbl_atom_wt[i]/100*sumA[i]; nB:=tbl_atom_mi[i]/100*sumA[i]; + cen_MW:=cen_MW+nA; cen_MI:=cen_MI+nB; if (cen_MW<40)and(cen_MI<40): num_MW:= num_MW+tbl_atom_wt[i]*sumA[i]; num_MI:= num_MI+tbl_atom_mi[i]*sumA[i]; fi - cal_FM:=cal_FM&cut_paren(tbl_atom_str[i]) if sumA[i]>=2: &decimal(sumA[i]) fi; + cal_FM:=cal_FM&erase_brace(tbl_atom_str[i]) if sumA[i]>=2: &decimal(sumA[i]) fi; fi endfor %------------------------------------------------------------------------------------- @@ -1520,6 +1556,7 @@ def proc_auxfile_out= ef tag[i]="USE": & inf_USE ef tag[i]="EXA": & inf_EXA ef tag[i]="EXB": & inf_EXB + ef tag[i]="MC": & inf_MC fi endfor if sw_aux_out=3: for i=1 upto inf_num: &aux_delimiter&info[i] endfor; fi @@ -1544,7 +1581,7 @@ def proc_report_out= printf "------------------------------------------------------------------"; printf "< NO. ><atom(s) >( x axis , y axis )<bond><hideH><chg>"; for i=1 upto cntA: - printf " A"&fdl(6)(i)&fixed_l(8)(cut_paren(strD[numS[i]]))& + printf " A"&fdl(6)(i)&fsl(8)(erase_brace(strD[numS[i]]))& " ("&fdr(10)(round_auto(xpart(posA[i])/blen))&" , "& fdr(10)(round_auto(ypart(posA[i])/blen))&" ) "&fdr(4)(Bcnt[i])& iif(hideH[i]>0,fdr(6)(hideH[i])," ") @@ -1567,14 +1604,14 @@ def proc_report_out= if sumA[i]>=1: nA:=tbl_atom_wt[i]/100*sumA[i]; nB:=tbl_atom_mi[i]/100*sumA[i]; printf " "& - fixed_l(5)(cut_paren(tbl_atom_str[i]))& + fsl(5)(erase_brace(tbl_atom_str[i]))& "("&fdr(9)(tbl_atom_wt[i])&")"&"["&fdr(9)(tbl_atom_mi[i])&"]"&" * "&fdr(4)(sumA[i]) if nA<40: &fdr(15)(tbl_atom_wt[i]*sumA[i])&"["&fdr(12)(tbl_atom_mi[i]*sumA[i])&"]"; else: &fdr(11)(nA)&"*100"&"["&fdr(9)(nB)&"*100"&"]"; fi fi endfor - printf " Molecular Weight [Mono Isotopic] = "&fixed_r(12)(cal_MW)&"["&fixed_r(12)(cal_MI)&"]"; + printf " Molecular Weight [Mono Isotopic] = "&fsr(12)(cal_MW)&"["&fsr(12)(cal_MI)&"]"; printf "------------------------------------------------------------------"; printf " Weight Calc: " &cal_MW &" / Input: " if inf_MW<>"-": &inf_MW &" / weight gap= " &decimal(num_MW-scantokens(inf_MW)) fi; @@ -1588,11 +1625,11 @@ def proc_mol_out= out_file_name:=out_file_mol; %-V2000--------------------------------------------------------------------------------------- if sw_mol_out=1: - printf ""; printf " -MCFtoMOL- "&fixed_l(20)(info[1]); printf ""; + printf ""; printf " -MCFtoMOL- "&fsl(20)(info[1]); printf ""; printf fdr(3)(cntA)&fdr(3)(cntB)&" 0 0 0 0 0 0 0 0999 V2000"; for i=1 upto cntA: printf fdr(10)(xpart(posA[i])/blen)& fdr(10)(ypart(posA[i])/blen)&fdr(10)(0)&" "& - fixed_l(2)(cut_paren(strD[numS[i]]))&" 0"&fdr(3)(bond_charge(chargeA[i]))&" 0 0"; + fsl(2)(erase_brace(strD[numS[i]]))&" 0"&fdr(3)(bond_charge(chargeA[i]))&" 0 0"; endfor for i=1 upto cntB: if lineB[i]<>0: @@ -1603,13 +1640,13 @@ def proc_mol_out= printf "M END"; %-V3000--------------------------------------------------------------------------------------- elseif sw_mol_out=2: - printf ""; printf " -MCFtoMOL- "&fixed_l(20)(info[1]); printf ""; + printf ""; printf " -MCFtoMOL- "&fsl(20)(info[1]); printf ""; printf " 0 0 0 0 0 999 V3000"; printf "M V30 BEGIN CTAB"; printf "M V30 COUNTS "&decimal(cntA)&" "&decimal(cntB)&" 0 0 0"; printf "M V30 BEGIN ATOM"; for i=1 upto cntA: - printf "M V30 "&decimal(i)&" "&cut_paren(strD[numS[i]])&" "& + printf "M V30 "&decimal(i)&" "&erase_brace(strD[numS[i]])&" "& decimal(xpart(posA[i])/blen)&" "&decimal(ypart(posA[i])/blen)&" 0 0" if chargeA[i]<>0: &" CHG="&decimal(chargeA[i]) fi; endfor @@ -1697,11 +1734,13 @@ parts_atom_end:=parts_cnt; for i==3 upto 20: ?[i]:='((_com,_len_ss),(_get_len,_ring_len),<((-180 DIV i)-90) for j==2 upto i:: ,(360 DIV i) endfor,(_cyc_sB,1-i),(_com,_len_ee)); endfor Ph:=Ph1:='(?6,-2=dl,-4=dl,-6=dl); Ph2:='(?6,-1=dl,-3=dl,-5=dl); -!:=!1:='((_mk_bond,_arg_ang)); !!:='(!~db); !!!:='(!~tm); +!:=!1:='((_mk_bond,_arrange_ang)); !!:='(!~db); !!!:='(!~tm); for i==2 upto 20: ![i]:='((_com,_len_ss),(_get_len,_tmp_len),! for j==2 upto i::,! endfor ,(_com,_len_ee)); endfor Me:='(); Et:='(!); iPr:=?!:='(/_,!); tBu:=??!:='(/_,/_^60,60); !?!:='(!,?!); !??!:='(!,??!); +n_:='((_set_add,ASCII("-"))); p_:='((_set_add,ASCII("+"))); +zero_wf:='(0~wf); zero_zf:='(0~zf); zero_dm:='(0~dm); zero_wv:='(0~wv); %------------------------------------------------------------------------------------------------- NH:='(N,/H~nl); N!:='(N,/_); N!2:='(N,/!); SO:='(S,//O); SOO:='(S,//O^-35,//O^35); O!:='(O,!); O!2:='(O,!,!); O!3:='(O,!,!,!); O!?!:='(O,!,?!); O!??!:='(O,!,??!); @@ -1744,4 +1783,27 @@ def expand_set= !CH3:='(!,CH3); !OH:='(!,OH); !NH2:='(!,NH2); !CHO:='(!,CHO); !COOH:='(!,COOH); !CN:='(!,CN); !SH:='(!,SH); !NO2:='(!,NO2); enddef; -%------------------------------------------------------------------------------------------------- +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +vardef check_mc(expr s)= %%%%% prototype version %%%%%% + save mc_char,mc_char,temp_c,err_cnt,char_cnt; + string temp_c; + numeric mc_char[]; + err_cnt:=char_cnt:=nA:=nB:=nC:=nD:=nE:=nF:=0; + %----------------------------------------------------------------------------------------------- + for i=1 upto length(s): + temp_c:=subc(i,s); if temp_c<>" ": char_cnt:=char_cnt+1; mc_char[char_cnt]:=ASCII(temp_c); fi + endfor + %-- check brackets ----------------------------------------------------------------------------- + for i=1 upto char_cnt: + if mc_char[i]=a_paren_s: nA:=nA+1; ef mc_char[i]=a_paren_e: nB:=nB+1; + ef mc_char[i]=a_brace_s: nC:=nC+1; ef mc_char[i]=a_brace_e: nD:=nD+1; + ef mc_char[i]=a_bracket_s: nE:=nE+1; ef mc_char[i]=a_bracket_e: nF:=nF+1; + fi + endfor + if nA<>nB: err_cnt:=err_cnt+1; fi if nC<>nD: err_cnt:=err_cnt+1; fi + if nE<>nF: err_cnt:=err_cnt+1; fi + %----------------------------------------------------------------------------------------------- + if err_cnt>=1: message "* "&decimal(err_cnt)&"fatal error"; fi + err_cnt +enddef; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |