diff options
author | Norbert Preining <norbert@preining.info> | 2023-01-30 03:04:17 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-01-30 03:04:17 +0000 |
commit | 326add29024271cbd541ac55448e616e833ae5fa (patch) | |
tree | 3a7301e802591c20575b65b94b21291641e7641f /graphics/mcf2graph | |
parent | dab4e7c261c34234f9d9f1ac92923d6f903046ef (diff) |
CTAN sync 202301300304
Diffstat (limited to 'graphics/mcf2graph')
-rw-r--r-- | graphics/mcf2graph/CHANGELOG | 10 | ||||
-rw-r--r-- | graphics/mcf2graph/README | 46 | ||||
-rw-r--r-- | graphics/mcf2graph/mcf2graph.mp | 59 | ||||
-rw-r--r-- | graphics/mcf2graph/mcf_exa_code.pdf | bin | 78844 -> 0 bytes | |||
-rw-r--r-- | graphics/mcf2graph/mcf_exa_code.tex | 119 | ||||
-rw-r--r-- | graphics/mcf2graph/mcf_exa_soc.mp | 14 | ||||
-rw-r--r-- | graphics/mcf2graph/mcf_example.pdf | bin | 449779 -> 500192 bytes | |||
-rw-r--r-- | graphics/mcf2graph/mcf_example.tex | 114 | ||||
-rw-r--r-- | graphics/mcf2graph/mcf_library.mcf | 10 | ||||
-rw-r--r-- | graphics/mcf2graph/mcf_manual.pdf | bin | 321662 -> 321635 bytes | |||
-rw-r--r-- | graphics/mcf2graph/mcf_manual.tex | 15 |
11 files changed, 183 insertions, 204 deletions
diff --git a/graphics/mcf2graph/CHANGELOG b/graphics/mcf2graph/CHANGELOG index 04139ae9ce..65a2715286 100644 --- a/graphics/mcf2graph/CHANGELOG +++ b/graphics/mcf2graph/CHANGELOG @@ -1,6 +1,14 @@ ******************************************************************************* - Changelog of mcf2graph software package by Akira Yamaji 2023-01-09 + Changelog of mcf2graph software package by Akira Yamaji 2023-01-29 ******************************************************************************* +[ver. 4.92 / 2023-01-29] + -change default output + eps => svg + -update MCFexample + include mcf_exa_code.tex + -delete mcf_exa_code.tex + -delete mcf_exa_code.pdf + [ver. 4.91 / 2023-01-09] -update MCF manual from this version typeset with LuaTeX diff --git a/graphics/mcf2graph/README b/graphics/mcf2graph/README index c896fb17aa..bbd31a8f59 100644 --- a/graphics/mcf2graph/README +++ b/graphics/mcf2graph/README @@ -1,7 +1,7 @@ ******************************************************************************** mcf2graph : Convert Molecular Coding Format to graphics with MetaPost Author : Akira Yamaji - version : 4.91 2023-01-09 + version : 4.92 2023-01-29 E-mail : mcf2graph@gmail.com Located at : http://www.ctan.org/pkg/mcf2graph ******************************************************************************** @@ -11,39 +11,37 @@ chemical structure diagrams. This Coding is named from programing technique such as operator, array, scope, macro, adressing, etc. - mcf2graph convert from MCF to PNG, SVG, EPS, MOL file. + mcf2graph convert from MCF to SVG, PNG, EPS, MOL file. It is also able to calculate molecular weight, exact mass, molecular formula. 2. The distribution of software - ( 1) README This file - ( 2) CHANGELOG Changelog file of mcf2graph - ( 3) mcf2graph.mp Main macro of Metapost - ( 4) mcf_library.mcf Molecular data library - ( 5) mcf_exa_soc.mp Molecular difinition file example - ( 6) mcf_manual.tex MCF syntax manual - ( 7) mcf_manual.pdf PDF of ( 6) typeset with LuaLaTeX,makeindex - ( 8) mcf_example.tex MCF example - ( 9) mcf_example.pdf PDF of ( 8) typeset with LuaLaTeX - (10) mcf_exa_code.tex MCF example include code - (11) mcf_exa_code.pdf PDF of (10) typeset with LuaLaTeX + (1) README This file + (2) CHANGELOG Changelog file of mcf2graph + (3) mcf2graph.mp Main macro of Metapost + (4) mcf_library.mcf Molecular data library + (5) mcf_exa_soc.mp Molecular difinition file example + (6) mcf_manual.tex MCF syntax manual + (7) mcf_manual.pdf PDF of (6) typeset with LuaLaTeX,makeindex + (8) mcf_example.tex MCF example + (9) mcf_example.pdf PDF of (8) typeset with LuaLaTeX 3. How to use mcf2graph with MetaPost Minimum requirement to use mcf2graph : mpost.exe,mpost.dll,mpost.mp,plain.mp - ( 1) >mpost filename => output eps(.mps) file - ( 2) >mpost -s ahangle=1 filename => output png file (600dpi) - ( 3) >mpost -s ahangle=11 filename => output png file (1200dpi) - ( 4) >mpost -s ahangle=2 filename => output svg file - ( 5) >mpost -s ahangle=3 filename => output eps(.eps) file - ( 6) >mpost -s ahlength=1 filename => output information-aux file(for tex) - ( 7) >mpost -s ahlength=2 filename => output information-aux file - (for spread sheet) - ( 8) >mpost -s ahlength=3 filename => output library-aux file - ( 9) >mpost -s ahlength=5 filename => output mol file(V2000) + (1) >mpost filename => output svg file + (2) >mpost -s ahangle=1 filename => output png file (600dpi) + (3) >mpost -s ahangle=11 filename => output png file (1200dpi) + (4) >mpost -s ahangle=2 filename => output eps(.mps) file + (5) >mpost -s ahangle=3 filename => output eps(.eps) file + (6) >mpost -s ahlength=1 filename => output information-aux file(for tex) + (7) >mpost -s ahlength=2 filename => output information-aux file + (for spread sheet) + (8) >mpost -s ahlength=3 filename => output library-aux file + (9) >mpost -s ahlength=5 filename => output mol file(V2000) (10) >mpost -s ahlength=6 filename => output mol file(V3000) (11) >mpost -s ahlength=7 filename => output report file 4. License - mcf2graph ver 4.91 Copyright (c) 2013-2023 Akira Yamaji + mcf2graph ver 4.92 Copyright (c) 2013-2023 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 diff --git a/graphics/mcf2graph/mcf2graph.mp b/graphics/mcf2graph/mcf2graph.mp index 87238a2132..2dd08fb804 100644 --- a/graphics/mcf2graph/mcf2graph.mp +++ b/graphics/mcf2graph/mcf2graph.mp @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 4.91 Copyright (c) 2013-2023 Akira Yamaji +% mcf2graph ver 4.92 Copyright (c) 2013-2023 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, @@ -17,23 +17,23 @@ % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % mcf2graph is MetaPost macro package convert Molecular Coding Format(MCF) to graphic file -% eps/sgv/png/mdl molfile +% sgv/eps/png/mdl molfile %-------------------------------------------------------------------------------------------------- % This package is located at : http://www.ctan.org/pkg/mcf2graph % Suggestion or request mail to : mcf2graph@gmail.com %-------------------------------------------------------------------------------------------------- -% Set outputformat to "eps" (.mps) : mpost FILENAME -% Set outputformat to "png" (.png) : mpost -s ahangle=1 FILENAME -% Set outputformat to "svg" (.svg) : mpost -s ahangle=2 FILENAME -% Set outputformat to "eps" (.eps) : mpost -s ahangle=3 FILENAME -% Set output information aux file (for TeX) : mpost -s ahlength=1 FILENAME -% Set output information aux file (for spread sheet) : mpost -s ahlength=2 FILENAME -% Set output aux library file : mpost -s ahlength=3 FILENAME -% Set output MOL file (V2000) : mpost -s ahlength=5 FILENAME -% Set output MOL file (V3000) : mpost -s ahlength=6 FILENAME -% Set output report : mpost -s ahlength=7 FILENAME +% Set outputformat to "svg" (.svg) : mpost FILENAME *default +% Set outputformat to "png" (.png) : mpost -s ahangle=1 FILENAME +% Set outputformat to "eps" (.eps) : mpost -s ahangle=2 FILENAME +% Set outputformat to "eps" (.mps) : mpost -s ahangle=3 FILENAME +% Set output information aux file (for TeX) : mpost -s ahlength=1 FILENAME +% Set output information aux file (for spread sheet) : mpost -s ahlength=2 FILENAME +% Set output aux library file : mpost -s ahlength=3 FILENAME +% Set output MOL file (V2000) : mpost -s ahlength=5 FILENAME +% Set output MOL file (V3000) : mpost -s ahlength=6 FILENAME +% Set output report : mpost -s ahlength=7 FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -message "* This is mcf2graph ver 4.91 2023.01.09"; +message "* This is mcf2graph ver 4.92 2023.01.29"; tracingstats:=1; prologues:=3; warningcheck:=0; %------------------------------------------------------------------------------------------------- newinternal string EN_; @@ -43,8 +43,8 @@ string save_str[],tbl_atom_str[],str_tbl[],tag[],info_s[],arg_s[],aux_delimiter file_input,file_output,default_temp_file,mpfont,atomfont,tempc,temps,blanks; pair save_pair[],msize,mposition,fsize,fmargin,dum,save_mposition; %------------------------------------------------------------------------------------------------- -fig_num:=str_cnt:=tbl_cnt:=mangle:=sw_expand:=sw_frame:=sw_trimming:=sw_ext_all:=0; -sw_abbreviate:=sw_numbering:=sw_output:=0; numbering_start:=1; numbering_end:=4095; +fig_num:=str_cnt:=tbl_cnt:=mangle:=sw_expand:=sw_frame:=sw_trimming:=sw_ext_all:=sw_abbreviate:=0; +sw_numbering:=sw_output:=0; numbering_start:=1; numbering_end:=4095; %------------------------------------------------------------------------------------------------- aux_max:=max_inf_num:=20; aux_delimiter:=";"; blanks:= " "; dum:=(-4091,0); for i=1 upto aux_max: tag[i]:=""; endfor @@ -83,18 +83,17 @@ def warning(expr s)= message "% "&decimal(fig_num)&fdr(3)(incr warning_cnt)&")"& default_library:="mcf_library.mcf"; default_temp_file:="temp.mcf"; mpfont:="uhvr8r"; atomfont:="draw"; defaultfont:=mpfont; %--default ahangle=45--------------------------------------------------------------------- -if ahangle=0: outputformat:="eps"; % eps format(.mps) -ef ahangle=1: outputformat:="png"; hppp:=vppp:=0.12; % png format(600dpi) +if ahangle=1: outputformat:="png"; hppp:=vppp:=0.12; % png format(600dpi) ef ahangle=11: outputformat:="png"; hppp:=vppp:=0.06; % png format(1200dpi) -ef ahangle=2: outputformat:="svg"; % svg format -ef ahangle=3: outputformat:="eps"; % eps format(.eps) -ef ahangle=45: outputformat:="eps"; % eps format(.mps) *default +ef ahangle=2: outputformat:="eps"; % eps format(.eps) +ef ahangle=3: outputformat:="eps"; % eps format(.mps) +ef ahangle=45: outputformat:="svg"; % svg format *default fi %--default ahlength=4--------------------------------------------------------------------- if ahlength=1: sw_output:=Info; % output aux file ef ahlength=2: sw_output:=Info+Table; % output aux file(Table mode) ef ahlength=3: sw_output:=Info+Mcode; % output aux library -ef ahlength=4: sw_output:=Fig; % *default +ef ahlength=4: sw_output:=Fig; % output figure *default ef ahlength=5: sw_output:=MOL2k; % output MOL(V2000) ef ahlength=6: sw_output:=MOL3k; % output MOL(V3000) ef ahlength=7: sw_output:=Report; % output report @@ -104,11 +103,11 @@ if bboxmargin=3: ext(defaultfont:=mpfont; defaultscale:=.3; label.rt(inf_EN,(0,0 ef bboxmargin=4: sw_output:=Fig+Calc; ext(defaultfont:=mpfont; defaultscale:=.3; label.rt(inf_EN&" / "&cal_MW&" / "&decimal(num_MW-scantokens(inf_MW)),(0,0));) fi -%--default outputtemplate:="%j-%3c."&"mps"------------------------------------------------ -if (outputformat="eps")and(ahangle<>3): outputtemplate:="%j-%3c."&"mps"; -ef outputformat="svg": outputtemplate:="s%3c-%{EN_}.svg"; -ef outputformat="png": outputtemplate:="p%3c-%{EN_}.png"; -else: outputtemplate:="%j-%3c."&outputformat; fi +%--default outputtemplate:="%j-%3c."&"svg"------------------------------------------------ +if outputformat="svg": outputtemplate:="s%3c-%{EN_}.svg"; +ef outputformat="png": outputtemplate:="p%3c-%{EN_}.png"; +ef (outputformat="eps")and(ahangle=3): outputtemplate:="%j-%3c.mps"; +else: outputtemplate:="%j-%3c."&outputformat; fi %----------------------------------------------------------------------------------------- if sw_output>=Info: message "* jobname="&jobname; message "* numbersystem="&numbersystem; @@ -119,11 +118,9 @@ if sw_output>=Info: message "* library file name="&jobname&"-lib.aux"; ef ahlength=5: message "* output MOL file(V2000)"; message "* "&jobname&"-nnn-"&"inf_EN"&".mol"; ef ahlength=6: message "* output MOL file(V3000)"; message "* "&jobname&"-nnn-"&"inf_EN"&".mol"; - ef ahlength=7: message "* output report file"; message "* file name="&jobname&"-report.txt"; fi - message "* outputformat="&outputformat; - if outputformat="png": message "* hppp="&decimal(hppp)&"/vppp="&decimal(vppp); fi - message "* outputtemplate="&outputtemplate; - message "* atomfont="&atomfont; message "* defaultfont="&defaultfont; fi + ef ahlength=7: message "* output report file"; message "* file name="&jobname&"-report.txt"; + fi +fi clearit; %-------------------------------------------------------------------------------------------------- ?3:=?20:=Ph:=Ph1:=Ph2:=hz:=0; vt:=1; diff --git a/graphics/mcf2graph/mcf_exa_code.pdf b/graphics/mcf2graph/mcf_exa_code.pdf Binary files differdeleted file mode 100644 index 46afc3a048..0000000000 --- a/graphics/mcf2graph/mcf_exa_code.pdf +++ /dev/null diff --git a/graphics/mcf2graph/mcf_exa_code.tex b/graphics/mcf2graph/mcf_exa_code.tex deleted file mode 100644 index d55a0e5e79..0000000000 --- a/graphics/mcf2graph/mcf_exa_code.tex +++ /dev/null @@ -1,119 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Print out mcf data list by A.Yamaji 2023.01.09 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% ** mcf2graph.mf must be version 4.91 -% ** use mcf_library.mcf -% ** typeset by LuaLaTeX(luamplib) -\documentclass{article} -\usepackage{luamplib}% -\usepackage[T1]{fontenc}% -\mplibcodeinherit{enable}% -\mplibnumbersystem{double}% -\mpliblegacybehavior{disabled}% -%------------------------------------------------------------------------- -\everymplib{% - if unknown Ph1: - input mcf2graph; - outputformat:="eps"; - sw_output:=Fig+Calc; - fsize:=(35mm,34mm); - fmargin:=(1mm,1mm); - max_blength:=4mm; - row_h:=3.8mm; - header_h:=3.8mm; - def make_frame= - draw (0,0)--(185mm,0)--(185mm,h)--(0,h)--cycle wpcs thickness_frame; - draw (w,h-header_h)--(185mm,h-header_h) wpcs thickness_frame; - draw (w,h)--(w,0) wpcs thickness_frame; - for col_w=75mm,105mm,130mm,155mm: - draw (col_w,h)--(col_w,h-header_h) wpcs thickness_frame; - endfor - enddef; - fi -}% -%------------------------------------------------------------------------- -\pagestyle{empty} -\topmargin=-25mm -\oddsidemargin=-12mm -\textwidth=192mm -\textheight=280mm -\parindent=0mm -\makeatletter -%------------------------------------------------------------------------- -\newcount \fig@num% -\newif\ifCONT@% -\edef\one{1}% -\fig@num=0% -%------------------------------------------------------------------------- -\begin{document} -\noindent% -\begin{mplibcode} - beginfigm(":<0,0~nb") - if mc_check(mc)=0: - MC(scantokens(mc)) - ext( - defaultfont:="cmtt9"; - label.lrt("[(No)]",(0,h)); - label.llft("(EXA)",(w,h)); - label.lrt("(Structure)",(8mm,18mm)); - label.lrt("(Name)",(w,h)); - label.lrt("(Category)",(75mm,h)); - label.lrt("(MW)*1",(105mm,h)); - label.lrt("(mw)*2",(130mm,h)); - label.lrt("(fm)*3",(155mm,h)); - label.lrt("(Molecular_Coding_Format)",(46mm,18mm)); - label.lrt("*1_(MW):Molecular_weight(data)",(105mm,26mm)); - label.lrt("*2_(mw):Molecular_weight(calculated)",(105mm,21mm)); - label.lrt("*3_(fm):Molecular_formula(calculated)",(105mm,16mm)); - make_frame; - ) - fi - endfigm - fig_num:=0; -\end{mplibcode}\vspace{-1.2pt}\\ -%------------------------------------------------------------------------ -\CONT@true% -\loop% -\advance\fig@num\@ne\relax% -\begin{mplibcode}% -%%%%%% beginfigm("t:EXA","v+:*") -%%%%%% beginfigm("t:EXA","v+:1") -%%%%%% beginfigm("t:EXA","v+:9") - beginfigm("t:EXA","v+:2") - if mc_check(mc)=0: - MC(scantokens(mc)) - ext( - defaultfont:="cmtt9"; - label.lrt("["&decimal(fig_num)&"]",(0,h)); - label.llft(inf_EXA,(w,h)); - if length(inf_EN)>23: - nA:=defaultscale; - defaultscale:=23/length(inf_EN); label.lrt(inf_EN, (w,h)); - defaultscale:=nA; - else: - label.lrt(inf_EN, (w,h)); - fi - label.lrt(inf_Cat,(75mm,h)); - label.lrt(inf_MW,(105mm,h)); - label.lrt(cal_MW,(130mm,h)); - label.lrt(cal_FM,(155mm,h)); - make_frame; - if mc_row>12: defaultscale:=0.6; row_h:=5.25; - ef mc_row>8: defaultscale:=0.8; row_h:=6.5; - else: row_h:=10; - fi - for i=1 upto mc_row: - label.lrt(mc[i],(w+mc_indent[i]*4.25,h-(i-1)*row_h-11.5)); - endfor - ) - VerbatimTeX("\gdef\EN{"&inf_EN&"}"); - fi - endfigm - VerbatimTeX("\gdef\EOF{"&decimal(f_EOF)&"}"); -\end{mplibcode}\vspace{-1.2pt}\\ -%------------------------------------------------------------------------ -\ifx\EOF\one \CONT@false \fi% -\message{[\the\fig@num:\EN]}% -\ifCONT@ \repeat% -%------------------------------------------------------------------------------ -\end{document} diff --git a/graphics/mcf2graph/mcf_exa_soc.mp b/graphics/mcf2graph/mcf_exa_soc.mp index f983c24ec6..b09d05209d 100644 --- a/graphics/mcf2graph/mcf_exa_soc.mp +++ b/graphics/mcf2graph/mcf_exa_soc.mp @@ -1,8 +1,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format by Akira Yamaji 2023.01.09 +% Molecular Coding Format by Akira Yamaji 2023.01.29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -if unknown Ph1: input mcf2graph; fi %%% it must be version 4.91 -message "* mcf_exa_soc 2023.01.09"; +if unknown mcftograph: input mcf2graph; fi %%% it must be version 4.92 +message "* mcf_exa_soc 2023.01.29"; message ""; %------------------------------------------------------------------------------ %%%%sw_frame:=Outside; @@ -13,7 +13,7 @@ message ""; tag1:="J"; tag2:="C"; tag3:="fm"; tag4:="mw"; tag5:="EN"; tag6:="MW"; %------------------------------------------------------------------------------ %% outputformat:="png"; hppp:=vppp:=0.1; outputtemplate:="p%3c-%{EN_}.png"; -%% outputformat:="svg"; outputtemplate:="s%3c-%{EN_}.svg"; +%% outputformat:="eps"; outputtemplate:="%j-%3c.eps"; %------------------------------------------------------------------------------ %ext(defaultscale:=.3; label.rt(inf_EN,(0,0));) %------------------------------------------------------------------------------ @@ -30,6 +30,12 @@ fsize:=(35mm,24mm); max_blength:=4mm; mc_length:=20; %------------------------------------------------------------------------------ +message "* outputformat="&outputformat; +message "* outputtemplate="&outputtemplate; +if outputformat="png": message "* hppp="&decimal(hppp)&"/vppp="&decimal(vppp); fi +message "* atomfont="&atomfont; message "* defaultfont="&defaultfont; +message ""; +%------------------------------------------------------------------------------ %%%% beginfigm("t:EN","v:Caffeine") % select EN=Caffeine forever: %%%% beginfigm("f:mcf_library","v+:*") % 'mcf_library.mcf'(default) diff --git a/graphics/mcf2graph/mcf_example.pdf b/graphics/mcf2graph/mcf_example.pdf Binary files differindex 3fe7e90c23..fcd65061ca 100644 --- a/graphics/mcf2graph/mcf_example.pdf +++ b/graphics/mcf2graph/mcf_example.pdf diff --git a/graphics/mcf2graph/mcf_example.tex b/graphics/mcf2graph/mcf_example.tex index aedff395a3..76eae436e4 100644 --- a/graphics/mcf2graph/mcf_example.tex +++ b/graphics/mcf2graph/mcf_example.tex @@ -1,25 +1,22 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Example of MCF Typeset with LuaLaTeX(luamplib) by A.Yamaji 2023.01.09 +% Example of MCF Typeset with LuaLaTeX(luamplib) by A.Yamaji 2023.01.29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% ** mcf2graph.mf must be version 4.91 +% ** mcf2graph.mf must be version 4.92 % ** use mcf_library.mcf % ** typeset by LuaLaTeX(luamplib) +%------------------------------------------------------------------------- \documentclass{article} \usepackage{luamplib} \usepackage[T1]{fontenc} \mplibcodeinherit{enable} \mplibnumbersystem{double} \mpliblegacybehavior{disabled} -%------------------------------------------------------------------------- -\everymplib{ - if unknown Ph1: - input mcf2graph; - outputformat:="eps"; - sw_output:=Fig+Calc; - fsize:=(35mm,24mm); - max_blength:=4mm; - fi -}% +\begin{mplibcode} + input mcf2graph; + sw_output:=Fig+Calc; + fsize:=(35mm,24mm); + max_blength:=4mm; +\end{mplibcode} %------------------------------------------------------------------------- \pagestyle{empty} \topmargin=-24mm @@ -88,7 +85,98 @@ \CONT@false% \fi% %------------------------------------------------------------------------ -%%%%%%%%\ifnum\fig@num=10 \CONT@false \fi% +\message{[\the\fig@num:\EN]}% +\ifCONT@ \repeat% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% MCF example with Mcode +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{mplibcode} + fsize:=(35mm,34mm); + fmargin:=(1mm,1mm); + max_blength:=4mm; + row_h:=3.8mm; + header_h:=3.8mm; + def make_frame= + draw (0,0)--(185mm,0)--(185mm,h)--(0,h)--cycle wpcs thickness_frame; + draw (w,h-header_h)--(185mm,h-header_h) wpcs thickness_frame; + draw (w,h)--(w,0) wpcs thickness_frame; + for col_w=75mm,105mm,130mm,155mm: + draw (col_w,h)--(col_w,h-header_h) wpcs thickness_frame; + endfor + enddef; +\end{mplibcode} +%------------------------------------------------------------------------- +\newcount \fig@num% +\edef\one{1}% +\fig@num=0% +%------------------------------------------------------------------------- +\noindent% +\begin{mplibcode} + beginfigm(":<0,0~nb") + if mc_check(mc)=0: + MC(scantokens(mc)) + ext( + defaultfont:="cmtt9"; + label.lrt("[(No)]",(0,h)); + label.llft("(EXA)",(w,h)); + label.lrt("(Structure)",(8mm,18mm)); + label.lrt("(Name)",(w,h)); + label.lrt("(Category)",(75mm,h)); + label.lrt("(MW)*1",(105mm,h)); + label.lrt("(mw)*2",(130mm,h)); + label.lrt("(fm)*3",(155mm,h)); + label.lrt("(Molecular_Coding_Format)",(46mm,18mm)); + label.lrt("*1_(MW):Molecular_weight(data)",(105mm,26mm)); + label.lrt("*2_(mw):Molecular_weight(calculated)",(105mm,21mm)); + label.lrt("*3_(fm):Molecular_formula(calculated)",(105mm,16mm)); + make_frame; + ) + fi + endfigm + fig_num:=0; +\end{mplibcode}\vspace{-1.2pt}\\ +%------------------------------------------------------------------------ +\CONT@true% +\loop% +\advance\fig@num\@ne\relax% +\begin{mplibcode}% +%%%%%% beginfigm("t:EXA","v+:*") +%%%%%% beginfigm("t:EXA","v+:1") +%%%%%% beginfigm("t:EXA","v+:9") + beginfigm("t:EXA","v+:2") + if mc_check(mc)=0: + MC(scantokens(mc)) + ext( + defaultfont:="cmtt9"; + label.lrt("["&decimal(fig_num)&"]",(0,h)); + label.llft(inf_EXA,(w,h)); + if length(inf_EN)>23: + nA:=defaultscale; + defaultscale:=23/length(inf_EN); label.lrt(inf_EN, (w,h)); + defaultscale:=nA; + else: + label.lrt(inf_EN, (w,h)); + fi + label.lrt(inf_Cat,(75mm,h)); + label.lrt(inf_MW,(105mm,h)); + label.lrt(cal_MW,(130mm,h)); + label.lrt(cal_FM,(155mm,h)); + make_frame; + if mc_row>12: defaultscale:=0.6; row_h:=5.25; + ef mc_row>8: defaultscale:=0.8; row_h:=6.5; + else: row_h:=10; + fi + for i=1 upto mc_row: + label.lrt(mc[i],(w+mc_indent[i]*4.25,h-(i-1)*row_h-11.5)); + endfor + ) + VerbatimTeX("\gdef\EN{"&inf_EN&"}"); + fi + endfigm + VerbatimTeX("\gdef\EOF{"&decimal(f_EOF)&"}"); +\end{mplibcode}\vspace{-1.2pt}\\ +%------------------------------------------------------------------------ +\ifx\EOF\one \CONT@false \fi% \message{[\the\fig@num:\EN]}% \ifCONT@ \repeat% %------------------------------------------------------------------------------ diff --git a/graphics/mcf2graph/mcf_library.mcf b/graphics/mcf2graph/mcf_library.mcf index bf01583d62..1902fd44ef 100644 --- a/graphics/mcf2graph/mcf_library.mcf +++ b/graphics/mcf2graph/mcf_library.mcf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% molecular library file mcf_library.mcf by Akira Yamaji 2022.11.12 +% molecular library file mcf_library.mcf by Akira Yamaji 2023.01.29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % tag1:var1;tag2:var2;tag3:var3 ..... % first character of line "%" comment out @@ -25,7 +25,7 @@ Cat:Category;EN:Example;MW:100.00;EXA:% label.top("A9",A9) withcolor red; ; %============================================================================== -% molecular data for mcf_example.tex EXA:1[155] EXA:2[7] +% molecular data for mcf_example.tex EXA:1[155] EXA:2[7] EXA:*[525] %============================================================================== Cat:biological;EN:Adenine;MW:135.13;EXA:1 : @@ -1262,7 +1262,7 @@ Cat:antibiotics;EN:Tiamulin;MW:493.74;EXA:1 @1,15,O,!,//O,!2,S,60,60,-60,N!2,60,-60 ; %------------------------------------------------------------------------------ -Cat:antibiotics;EN:Rifampicin;MW:822.94;EXA:1 +Cat:antibiotics;EN:Rifampicin;MW:822.94;EXA:2 : <30,Ph,6:/_^30,5:/OH,-6=?5,-3:O,-8=?6,{-2,-4}=dl,{-1,-4}:/OH, #1,@-2,\,NH,60,-60,60~dl,60,60~dl,-60, @@ -2789,7 +2789,7 @@ Cat:antibacterial;EN:Famphur;MW:325.3;EXA:- <-30,!,O,!,P,//S,/O!^160,!,O,!,Ph,@-3,\,SOO,!,N!,! ; %------------------------------------------------------------------------------ -Cat:antibacterial;EN:Lincomycin;MW:406.54;EXA:- +Cat:antibacterial;EN:Lincomycin;MW:406.54;EXA:1 : <6,?5,5:N,5:*/_,2:*/!2, @3,\*,//O,!,NH,!,!~wb,?6,-1:O,{-3',-4,-5}:*/OH,-2:/*S!,@8,-30,/_,60,OH @@ -2844,7 +2844,7 @@ Cat:antibiotics;EN:Vancomycin;MW:1449.25;EXA:2 @-1,\*,O,!~wb,|,?6`.7,6:O,{3'^35,5}:*/_,3^-35:/NH2,4:/*OH, ; %------------------------------------------------------------------------------ -Cat:biological;EN:Maitotoxin;MW:3425.86;EXA:2 +Cat:biological;EN:Maitotoxin;MW:3425.86;EXA:- : <55.8,?6,-4=?7 ,{-4,-3,-3,-3}=?6,@-3,\,!3,?6,{-4,-3,-3,-3}=?6,@-3,\,?6,-3=?6, @-3,\,!3,60,<-30,?6,-3=?6,@-3,30,<30,?6,{-3,-3}=?6,-3=?7,{-4,-3,-3}=?6, diff --git a/graphics/mcf2graph/mcf_manual.pdf b/graphics/mcf2graph/mcf_manual.pdf Binary files differindex c304a18391..2ffe96738f 100644 --- a/graphics/mcf2graph/mcf_manual.pdf +++ b/graphics/mcf2graph/mcf_manual.pdf diff --git a/graphics/mcf2graph/mcf_manual.tex b/graphics/mcf2graph/mcf_manual.tex index 18ccd9827f..834a6516f8 100644 --- a/graphics/mcf2graph/mcf_manual.tex +++ b/graphics/mcf2graph/mcf_manual.tex @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Molecular Coding Format manual by Akira Yamaji 2023.01.09 +% Molecular Coding Format manual by Akira Yamaji 2023.01.29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% ** mcf2graph.mf must be version 4.91 +% ** mcf2graph.mf must be version 4.92 % ** use mcf_library.mcf % ** typeset by LuaLaTeX(luamplib) %---------------------------------------------------------------------------- @@ -18,11 +18,12 @@ \mplibcodeinherit{enable}% \mplibverbatim{enable}% \mpliblegacybehavior{disabled}% +\begin{mplibcode} + input mcf2graph; +\end{mplibcode} \everymplib{% - if unknown Ph1: input mcf2graph; fi sw_output:=Fig+Calc; tag1:="J"; tag2:="C"; tag3:="fm"; tag4:="mw"; tag5:="EN"; tag6:="MW"; - outputformat:="eps"; fsize:=(60mm,35mm); blength:=0mm; max_blength:=10mm; @@ -3482,11 +3483,11 @@ M END \mplibcodeinherit{enable}% \mplibverbatim{enable}% \mplibnumbersystem{double}% -\everymplib{% - if unknown Ph1: input mcf2graph; fi +\begin{mplibcode} + input mcf2graph; sw_output:=Fig; max_blength:=4.5mm; defaultfont:="uhvr8r"; defaultsize:=8bp; defaultscale:=1; -}% +\end{mplibcode} \begin{document} \noindent% %-------------------------------------------------------------------- |