From b5403930021ed0f7f3968516d34f2d29606c3d97 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 20 Jul 2015 22:07:53 +0000 Subject: mcf2graph (20jul15) git-svn-id: svn://tug.org/texlive/trunk@37906 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/metapost/mcf2graph/README | 142 +++++++++------------ .../doc/metapost/mcf2graph/mcf_exa_soc.mf | 34 ++--- .../doc/metapost/mcf2graph/mcf_example.pdf | Bin 284895 -> 255197 bytes .../doc/metapost/mcf2graph/mcf_example.tex | 2 +- .../doc/metapost/mcf2graph/mcf_man_soc-030.eps | 14 +- .../doc/metapost/mcf2graph/mcf_man_soc.mf | 6 +- .../doc/metapost/mcf2graph/mcf_manual.pdf | Bin 187999 -> 188181 bytes .../doc/metapost/mcf2graph/mcf_manual.tex | 33 +++-- Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 19 +-- 9 files changed, 121 insertions(+), 129 deletions(-) diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/README b/Master/texmf-dist/doc/metapost/mcf2graph/README index 66dbc7dfcf2..def4b21389e 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/README +++ b/Master/texmf-dist/doc/metapost/mcf2graph/README @@ -1,98 +1,72 @@ ******************************************************************************* - mcf2graph : Metapost/Metafont macro convert Molecular Coding Format to graphic + mcf2graph : Convert Molecular Coding Format to graphic with Metafont/Metapost Author : Akira Yamaji - DATE : 2015/07/11 + version : 3.52 / 2015-07-20 E-mail : akira.yamaji5@gmail.com Web site : http://molecoding.cocolog-nifty.com/blog/ ******************************************************************************* 1. Introduction - Molecular Coding Format(MCF) is new linear notation represent chmical - structure diagram. - mcf2graph(metapost/metafont macro) convert MCF file to - graphic file(pk font/PNG/SVG/EPS) or MDL MOL file(V2000). - The software, MCF syntax manual,TeX example can get from authors web site. + structure diagram.This 'Coding' is from coding(programing) technique like + adressing,grouping,macro. There are no commands of Meta language in MCF. + mcf2graph.mf(metapost/metafont macro) convert MCF file to + graphic file(pk font/PNG/SVG/EPS) or MDL MOL file(V2000). + The software,MCF manual,TeX example can get from authors web site. 2. The distribution of software - -( 1) README This file - -( 2) mcf_graph.mf Macro of Metapost / Metafont - -( 3) mcf_manual.tex MCF syntax manual(LaTeX file) -( 4) mcf_man_soc.mf MCF file for mcf_manual.tex -( 5) mcf_man_soc-030.eps No.30 EPS(with color) file from (4) -( 6) mcf_manual.pdf PDF file of mcf_manual.tex - -( 7) mcf_example.tex LaTeX example -( 8) mcf_exa_soc.mf MCF file for mcf_example.tex -( 9) mcf_exa_soc-info.log Infomation file from (8) -(10) mcf_example.pdf PDF file of mcf_example.tex - - -3. Use mcf2graph.mf - -(1) mpost -s ahangle=1 FILENAME output PNG file. (default value is eps) -(2) mpost -s ahangle=2 FILENAME output SVG file. -(3) mpost -s ahangle=3 FILENAME output MDL Molfile(V2000) -(4) mpost -s ahangle=0 FILENAME output no graphic file. -(5) mpost -s ahlength=1 FILENAME output first definition only (for test) -(6) mpost -s ahlength=2 FILENAME output checklist. -(7) Large number of molecular structures can be gathering by using TEX. - mcf_example.tex is example of use LaTeX. - - -4. Molecular Coding Format example - -input mcf2graph.mf; % input main system -font_wd#:=30mm#; % font width -font_ht#:=20mm#; % font height -max_bond_width:=0.2; % max fond length/font width -sw_logout:=1; % log file out -sw_frame:=0; % add frame -sw_expand:=0; % expand substituent mode -sw_start_vecor:=0; % start vector mode -sw_numberingA:=0; % atom adress mode -sw_numberingB:=0; % bond adress mode -%%sw_checklist:=1; % check list mode -%%sw_MOLfile:=1; % Mdl molfile(V2000) -%*********************************************************************** -beginfont("EN:Acetamiprid") % Molecular name 1 - MCf(^^30,Ph,4\,!,NH,!,!~dr,N,!,CN)% % Molecular Coding Format -endfont -%*********************************************************************** -bye - -5. Use TeX(latex) - - -\documentclass[a4paper]{article} -\usepackage{graphicx} -\pagestyle{empty} - -% insert part of info LOG file - -%------------------------------------------------------------------------- -\MOLinfo{EN:Acetamiprid}{:}{:}{:}% -{:}{:}{:}{:}% -{:}{:}{:}{:}% -\MCFinfo{MCF_SOC2}{0}{MCF_SOC2-000.eps}{419.14972}{145.32037}{159.04236}{12}{0}{}% -%------------------------------------------------------------------------- - -%% filename of souce file : mcf_exa_soc.mf - -\input mcf_exa_soc-info.log - -\end{document} - -\end{verbatim} -%---------------------------------------------------------------------------- - + (1) README This file + (2) mcf_graph.mf Macro of Metafont / Metapost + (3) mcf_manual.tex MCF syntax manual(LaTeX file) + (4) mcf_man_soc.mf Molecular difinition file for mcf_manual.tex + (5) mcf_man_soc-030.eps No.30 EPS(with color) file of (4) + (6) mcf_manual.pdf PDF of (3) (used LaTeX,dvipdfmx) + (7) mcf_example.tex LaTeX example, + Make 'mcf_exa_soc-info.log' before typeset + mpost -s ahangle=0 mcf_exa_soc.mf + (8) mcf_exa_soc.mf Molecular difinition file for mcf_example.tex + (9) mcf_example.pdf PDF of (7) (used LaTeX,dvipdfmx) + +3. How to use mcf2graph with Metapost + (1) mpost -s ahangle=1 FILENAME output PNG file. (default value is eps) + (2) mpost -s ahangle=2 FILENAME output SVG file. + (3) mpost -s ahangle=3 FILENAME output MDL Molfile(V2000) + (4) mpost -s ahangle=0 FILENAME output no graphic file. + (5) mpost -s ahlength=1 FILENAME output first definition only (for test) + (6) mpost -s ahlength=2 FILENAME output checklist. + +4. Molecular definition file example + input mcf2graph.mf; % input main system + font_wd#:=30mm#; % font width + font_ht#:=20mm#; % font height + max_bond_width:=0.2; % max fond length/font width + sw_logout:=1; % log file out + %*********************************************************************** + beginfont("EN:Acetamiprid") % Molecular name 1 + MCf(^^30,Ph,4\,!,NH,!,!~dr,N,!,CN)% % Molecular Coding Format + endfont + %*********************************************************************** + bye + +5. How to use mcf2graph with TeX(latex) + Large number of molecular structures can be gathering by using TEX. + mcf_example.tex is example of using LaTeX. + + \documentclass[a4paper]{article} + \usepackage[dvipdfmx]{graphicx}% Change option depend on your tex system + + % insert part of info LOG file + %------------------------------------------------------------------------- + \MOLinfo{EN:Acetamiprid}{:}{:}{:}% + {:}{:}{:}{:}% + {:}{:}{:}{:}% + \MCFinfo{MCF_SOC2}{0}{MCF_SOC2-000.eps}{419.14972}{145.32037}{159.04236}{12}{0}{}% + %------------------------------------------------------------------------- + % or insert next line + \input mcf_exa_soc-info.log % filename of souce file : mcf_exa_soc.mf 6. License - 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, including without limitation the rights @@ -111,3 +85,7 @@ bye OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +7. Changelog + ver. 3.50 / 2015-07-11 first version uploaded to ctan. + ver. 3.51 / 2015-07-19 '?6`2' can use as '{,``2,?6,}' + ver. 3.52 / 2015-07-20 '!4`2' can use as '{,``2,!4,}' 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 2c73bcf67c3..fafa3585a76 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf @@ -1,6 +1,6 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format souce No.2 by Akira Yamaji 2015.5 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Molecular Coding Format for mcf_example.tex by Akira Yamaji 2015.7.19 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% input mcf2graph.mf; %------------------------------------------------------------------------- font_wd#:=35mm#; @@ -15,7 +15,7 @@ sw_expand:=0; sw_start_vector:=0; %%%%sw_checklist:=1; %%%%sw_MOLfile:=1; -%*********************************************************************** +%********************************************************************** beginfont("EN:Acetamiprid") MCf(^^30, Ph,4\,!,NH,!,!~dr,N,!,CN @@ -123,7 +123,7 @@ endfont %*********************************************************************** beginfont("EN:Endosulfan"); MCf(^^30, - {,``1.3,?6,3=?7,},2*,210~wf`1.45,&5~wb,6=d, + ?6`1.3,3=??7,2*,210~wf`1.45,&5~wb,6=d, @(1,2,5,6,12^-210,12^-150)/Cl,@(8,10)O,9:S,9://O ) endfont; @@ -272,7 +272,7 @@ endfont %*********************************************************************** beginfont("EN:Wortmanin") MCf(^^30, - {,?6,-4=?6,-2=?6,-4=?5,(#2,#7)=?5[3],}, + ?6,$(-4,-2)??6,-4=??5,(2,7)=??5[3], 6:O,1://O,$(7,10)dl,8://O,17://O,-3=d,-1:O, @(4,12)*/Me^60,11:/*H^-60, #5\*,60,O,!,#14\*^-25,//O,!,O,! @@ -321,7 +321,7 @@ endfont %********************************************************************** beginfont("EN:Gibberellin"); MCf(^^12, - {,``1.3,?6,3=??5,9=??7,},12\^160`1.6,&8, + ?6`1.3,3=??5,9=??7,12\^160`1.6,&8, 4\^155~zf`-1.2,O,55,//O^180`1,&(#2)~zb, 3=dr,11=wf,13=wb,7:/COOH,11://Me,1:*/OH,12:/*OH,2:*/Me, @(3^-60,9^60)*/H) @@ -388,8 +388,8 @@ endfont %********************************************************************** beginfont("EN:Emetine") MCf(^^30, - {,Ph,-4=?6,2:N,-4=?6,},@(1,6)/OMe,-2:/*Et,@(7^-60,12^-60)/*H, - -3\,!~zb,^^-60,?6,5=d,2:NH,-6^-60:*/H,-2=?6,$(2,4)dl + Ph,$(-4,-4)??6,8:N,@(1,6)/OMe,-2:/*Et,@(7^-60,12^-60)/*H, + -3\,!~zb,^^-60,?6,5=d,2:NH,-6^-60:*/H,-2=?6,$(2,4)dl ) endfont %*********************************************************************** @@ -471,7 +471,7 @@ endfont; %*********************************************************************** beginfont("EN:Reserpine"); MCf(^^30, - {,Ph,-4=?5,3=d,-2=?6,2:N,-4=?6,-3=?6,},7:NH,10:*/H^-60, + Ph,-4=??5,-2=??6,-4=??6,-3=??6,9=dl,11:N,7:NH,10:*/H^-60, @(15^-60,16^60)/*H, #20*\,O,!,//O,!,Ph,@(-2,-3,-4)/OMe,@(#1,#19~zf>rl)/OMe, #18*\,//O,!,O,! @@ -499,8 +499,8 @@ MCf(^^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)*/Me,@(4,6^-35,8,12^35)/*Me, @(6^35,11,12^-35)*/OH, - #3\*,O,30,{,``.7,?6,},2:O,@(3,5^35)/Me,4:/OH,5^-35:/OMe, - #5\*^30`1.7,O,!,{,``.7,?6,},6:O,5:/Me,2:/OH,3:/NMeMe + #3\*,O,30,?6`.7,2:O,@(3,5^35)/Me,4:/OH,5^-35:/OMe, + #5\*^30`1.7,O,!,?6`.7,6:O,5:/Me,2:/OH,3:/NMeMe ) endfont; %********************************************************************** @@ -546,11 +546,11 @@ beginfont("EN:Capsaicin") endfont %*********************************************************************** beginfont("EN:Quinine") - MCf(^^30, - {,Ph,3=Ph,},7:N,6:/OMe, - 10\,*/OH,/H~zf^-60,!, - ?6,2:N,1:*/H^60,4*\,!~dr,2*,165~zf,60,&5~zb - ) + MCf(^^30, + Ph,3=ph,7:N,6:/OMe, + 10\,*/OH,/H~zf^-60,!, + ?6,2:N,1:*/H^60,4*\,!~dr,2*,165~zf,60,&5~zb + ) endfont %*********************************************************************** beginfont("EN:Atoropin") diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf index bca1f0085dd..fc33cf1613d 100644 Binary files a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf and b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf differ diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex index f82dd499f38..dc4ef24a7aa 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format file for mcf_examples.tex by A.Yamaji 2015.7 +% Molecular Coding Format file for mcf_examples.tex by A.Yamaji 2015.7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper]{article} \usepackage{graphicx} diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc-030.eps b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc-030.eps index 566a268d63e..a8c40f49460 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc-030.eps +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc-030.eps @@ -1,8 +1,8 @@ -%!PS-Adobe-3.0 EPSF-3.0 +%!PS %%BoundingBox: 47 7 112 78 %%HiResBoundingBox: 47.18906 7.2196 111.88002 77.81963 %%Creator: MetaPost 1.999 -%%CreationDate: 2015.07.12:0850 +%%CreationDate: 2015.07.20:0717 %%Pages: 1 %%BeginProlog %%EndProlog @@ -11,17 +11,23 @@ [] 0 setdash 1 setlinecap 1 setlinejoin 10 setmiterlimit newpath 58.52762 27.21318 moveto 79.09938 15.33614 lineto stroke +newpath 63.62425 29.91786 moveto +81.5447 19.57155 lineto stroke newpath 90.97905 15.33603 moveto 111.55081 27.21318 lineto stroke - 1 0 0 setrgbcolor 0.65842 + 0 1 0 setrgbcolor 0.65842 0 dtransform exch truncate exch idtransform pop setlinewidth newpath 111.55081 27.21318 moveto 111.55081 57.82605 lineto stroke +newpath 106.66019 30.27466 moveto +106.66019 54.76457 lineto stroke 0 0 0 setrgbcolor 0 0.65842 dtransform truncate idtransform setlinewidth pop newpath 111.55081 57.82605 moveto 90.97905 69.7031 lineto stroke newpath 79.09938 69.7032 moveto 58.52762 57.82605 lineto stroke +newpath 81.5447 65.46779 moveto +63.62425 55.12137 lineto stroke 0.65842 0 dtransform exch truncate exch idtransform pop setlinewidth newpath 58.52762 57.82605 moveto 58.52762 27.21318 lineto stroke @@ -41,7 +47,7 @@ newpath 81.64258 16.59387 moveto 88.43585 7.2196 lineto 89.72635 7.2196 lineto closepath fill - 0 1 0 setrgbcolor + 0 0 1 setrgbcolor newpath 80.35208 68.44536 moveto 81.27386 68.44536 lineto 81.27386 77.81963 lineto 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 27e88b9ee1f..209747c69cc 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2015.2 +% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2015.7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% input mcf2graph.mf; %----------------------------------------------------------------------- @@ -154,7 +154,7 @@ endfont %*********************************************************************** beginfont("EN:substituent 5") sw_start_vector:=1; - MCf(^^30,{,``1,!7,},@(2,3)/*Me`2^30,5:*/Pr>lr,7:*/Pr>rl + MCf(^^30,!7`1,@(2,3)/*Me`2^30,5:*/Pr>lr,7:*/Pr>rl ) endfont %*********************************************************************** @@ -186,7 +186,7 @@ endfont %*********************************************************************** beginfont("EN:Change color") sw_start_vector:=1; - MCf(^^30,?6,@(2,5)N,2:red,5:green,3=red) + MCf(^^30,Ph,@(2,5)N,2:red,5:blue,3=green) endfont %*********************************************************************** beginfont("EN:Chain start multi characters") diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf index 6468b687ad7..c8c472981a1 100644 Binary files a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf and b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf differ diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex index 2b0c4e507c6..04aa16a1dc5 100644 --- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex +++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex @@ -1,8 +1,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format manual by Akira Yamaji 2015.7 +% Molecular Coding Format manual by Akira Yamaji 2015.7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper]{article} -\usepackage{graphicx} +\usepackage[dvipdfmx]{graphicx} +%%%%%\usepackage[pdftex]{graphicx} \pagestyle{empty} \topmargin=-17mm \textheight=27.5cm @@ -26,18 +27,18 @@ \advance\fontnum\@ne\relax\advance\tempnum\@ne\relax% }% %---------------------------------------------------------------------------- -\def\MCFstructureEPS{% - \makebox(75,0)[t]% - {\frame{\makebox(70,35){% - \ifnum\fontnum<10\includegraphics{mcf_man_soc-00\the\fontnum}% - \else\ifnum\fontnum<100\includegraphics{mcf_man_soc-0\the\fontnum}\fi\fi}}}% - \advance\fontnum\@ne\relax\advance\tempnum\@ne\relax% -}% +%%%\def\MCFstructure{% +%%% \makebox(75,0)[t]% +%%% {\frame{\makebox(70,35){% +%%% \ifnum\fontnum<10\includegraphics{mcf_man_soc-00\the\fontnum}% +%%% \else\ifnum\fontnum<100\includegraphics{mcf_man_soc-0\the\fontnum}\fi\fi}}}% +%%% \advance\fontnum\@ne\relax\advance\tempnum\@ne\relax% +%%%}% %---------------------------------------------------------------------------- \begin{document} \noindent% \begin{picture}(180,0) - \put(50,12){{\LARGE Molecular coding format manual}\hspace{20mm} + \put(45,12){{\LARGE Molecular Coding Format manual}\hspace{10mm} by Akira Yamaji 2015.7} \end{picture}\vspace{-6mm}\\ %---------------------------------------------------------------------------- @@ -358,7 +359,7 @@ Add substituent ~,^,`,> : change type,angle,length,enviroment of substituent - ^^30,{,``1,!7,}, + ^^30,!7`1, @(2,3)/*Me`2^30,5:*/Pr>lr,7:*/Pr>rl \end{verbatim} @@ -428,12 +429,16 @@ NH,SOO : inset hetero atom and substituent @(5)green : change color of A5 green $(3)red : change color of B3 red - ^^30,?6,@(2,5)N, - 2:red,5:green,3=red + ^^30,Ph,@(2,5)N, + 2:red,5:blue,3=green \end{verbatim} \end{minipage} -\MCFstructureEPS +%%%%\MCFstructure % for Metafont +\makebox(75,0)[t]{\frame{\makebox(70,35)% +{\includegraphics{mcf_man_soc-030.eps}}}}% for dvipdfmx +%%%%{\includegraphics[width=30mm]{mcf_man_soc-030.png}}}}% for pdfLaTeX +\advance\fontnum\@ne\relax\advance\tempnum\@ne\relax% \vspace{6mm}\\ %----------------------------------------------------------------------------- \begin{minipage}[t][38mm]{100mm} diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf index bd05e6e2a1d..05f69ae860b 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 3.50 Copyright (c) 2013,2014,2015 Akira Yamaji +% mcf2graph ver 3.52 Copyright (c) 2013-2015 Akira Yamaji % % Permission is hereby granted, free of charge, to any person obtaining a copy of this software % and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -18,10 +18,10 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % mcf2graph is METAFONT/METAPOST macro package convert % Molecular Coding Format(MCF) to font/eps/sgv/png/mdl molfile(V2000) -%--------------------------------------------------------------------------------------------- +%---------------------------------------------------------------------------------------------- % Web page of author: http://molecoding.cocolog-nifty.com/blog/ % Suggestion or request mail to: akira.yamaji5@gmail.com -%--------------------------------------------------------------------------------------------- +%---------------------------------------------------------------------------------------------- % Set outputformat to "png" : mpost -s ahangle=1 FILENAME % Set outputformat to "svg" : mpost -s ahangle=2 FILENAME % Set outputformat to MDL Molfile : mpost -s ahangle=3 FILENAME @@ -337,9 +337,12 @@ def proc_atom(expr n)= elseif com=0or_jp_atom: termA; sB[cntB+1]:=getA(par); f_Br:=1; elseif com=_jp_atom_abs: sB[cntB+1]:=par; f_Br:=1; temp_cntB:=cntB; elseif com=_chg_atom: strA[getA(adrT)]:=parMC[par][1]; - elseif com=_chg_len: if par=_ring_len: B_len:=ring_len; - elseif par=0: if B_len<0: B_len:=1; fi else: B_len:=par; fi - elseif com=_get_len: ring_len:=lenB[getB(par)]; + elseif com=_chg_len: if par=_ring_len: B_len:=ring_len; + elseif par=0: + if lenT<>ratio_cr: B_len:=lenT; else: if B_len<0: B_len:=1; fi fi + else: B_len:=par; fi + elseif com=_get_len: if par=0: if B_len=ratio_cr: B_len:=lenT; fi + else: ring_len:=lenB[getB(par)]; fi elseif com=_tmp_len: lenT:=par; elseif com=_set_line: lineB[getB(adrT)]:=par; elseif com=_dl: lineB[getB(par)]:=dl; @@ -516,7 +519,7 @@ enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mc_num:=first_def_number; lr:='(60 for i==1 upto 10:: ,-60,60 endfor); rl:='(-60,lr); -def ring expr n=^^((-180 DIV n)-90),(_chg_len,0) +def ring expr n=^^((-180 DIV n)-90),(_chg_len,0), for i==2 upto n:: ,(360 DIV n) endfor,(_cyc_sB,1-n) enddef; for i=3 upto 20: ??[i]:='({{,ring i,}}); endfor for i=3 upto 20: ?[i]:='({,ring i,}); endfor @@ -524,7 +527,7 @@ Ph:=Ph1:='( ?6,(_dl,-2),(_dl,-4),(_dl,-6)); Ph2:='( ?6,(_dl,-1),(_dl,-3),(_dl,-5 ph:=ph1:='(??6,(_dl,-2),(_dl,-4),(_dl,-6)); ph2:='(??6,(_dl,-1),(_dl,-3),(_dl,-5)); !:='((_mk_bond,_arg_ang)); !0:='(^^180,180); for i=1 upto 20: !![i]:='(! for j==2 upto i::,! endfor); endfor -for i=1 upto 20: ![i]:='({,!![i],}); endfor +for i=1 upto 20: ![i]:='({,(_get_len,0),!![i],}); endfor !!:=!!1; Me:='(); Et:=!; Pr:='(!,!); Bu:='(!,!,!); for i=4,5,6: for j=2 upto i-2: ?[i][j]:='((_fuse,i),(j,1)); endfor endfor for i=4,5,6: for j=2 upto i-2: ??[i][j]:='((_fuse,i),(j,0)); endfor endfor -- cgit v1.2.3