%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2015.9.22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{article} %------------------------------------------------------------------------------- \usepackage{luamplib}% \mplibcodeinherit{enable}% \mplibverbatim{enable}% \everymplib{if unknown Ph1: input mcf2graph.mf; mp_log_name:="temp-info.aux"; sw_logout:=sw_info_lenx:=sw_info_weight:=sw_info_formula:=1; fi}% \everyendmplib{write EOF to mp_log_name;}% %------------------------------------------------------------------------------- \makeatletter% \newdimen \MOLwidth% %------------------------------------------------------------------------------- \def\@fst@param#1:#2;{#1}\def\@sec@param#1:#2;{#2}% \def\mol@sel#1{% \if#1\empty\relax\else% \edef\@fst{\expandafter\@fst@param#1;}% \edef\@sec{\expandafter\@sec@param#1;}% \ifx\@fst\@F\edef\MOLfile{\@sec}\fi \ifx\@fst\@C\edef\MOLchar{\@sec}\fi% \ifx\@fst\@Lx\edef\MOLlenx{\@sec}\fi \ifx\@fst\@Ly\edef\MOLleny{\@sec}\fi% \ifx\@fst\@EN\edef\MOLnameE{\@sec}\fi \ifx\@fst\@JN\edef\MOLnameJ{\@sec}\fi% \ifx\@fst\@CAS\edef\MOLcas{\@sec}\fi \ifx\@fst\@USE\edef\MOLuse{\@sec}\fi% \ifx\@fst\@FM\edef\MOLfm{\@sec}\fi \ifx\@fst\@FMc\edef\CALfm{\@sec}\fi% \ifx\@fst\@MW\edef\MOLmw{\@sec}\fi \ifx\@fst\@MWc\edef\CALmw{\@sec}\fi% \ifx\@fst\@logP\edef\MOLlogP{\@sec}\fi \ifx\@fst\@EXA\edef\MOLextA{\@sec}\fi% \ifx\@fst\@EXB\edef\MOLextB{\@sec}\fi \ifx\@fst\@NO\edef\MOLnum{\@sec}\fi\fi}% %------------------------------------------------------------------------------- \def\@F{F}\def\@C{C}\def\@EN{EN}\def\@JN{JN}\def\@CAS{CAS}% \def\@MW{MW}\def\@MWc{MWc}\def\@FM{FM}\def\@FMc{FMc}\def\@Lx{Lx}\def\@Ly{Ly}% \def\@NO{NO}\def\@USE@{USE}\def\@logP@{logP}\def\@EXA@{EXA}\def\@EXB@{EXB}% %------------------------------------------------------------------------------- \def\INFO#1{% \edef\MOLnum{}\edef\MOLnameE{}\edef\MOLlenx{}\edef\MOLmw{}% \@tfor\@temp:=#1\do{\mol@sel{\@temp}} }% %-------------------------------------------------------------------------------- \newdimen\MOLwidth% \newdimen\heightCap% \def\MOLcaption#1#2{\input temp-info.aux\relax % \MOLwidth=\MOLlenx pt% \advance\MOLwidth -#1\relax% \heightCap=#2% \llap{\makebox[\MOLwidth][l]{\raisebox{\heightCap}{\sf NO.\MOLnum{ }\MOLnameE{ }}}}% \advance\heightCap -5mm\relax% \llap{\makebox[\MOLwidth][l]{\raisebox{\heightCap}{\small\tt FM(C):\CALfm}}}% \advance\heightCap -4mm\relax% \llap{\makebox[\MOLwidth][l]{\raisebox{\heightCap}{\small\tt MW(C):\CALmw}}}% \advance\heightCap -4mm\relax% \llap{\makebox[\MOLwidth][l]{\raisebox{\heightCap}{\small\tt MW(D):\MOLmw}}}% }% \makeatother% %------------------------------------------------------------------------------------ \pagestyle{empty} \topmargin=-25mm \oddsidemargin=0mm \textwidth=180mm \textheight=280mm \unitlength=1mm %------------------------------------------------------------------------------------ \begin{document} {\Large\bf MCF example for luamplib(LuaLaTeX) }% \hspace{10mm} by Akira Yamaji 2015.9.22\vspace{6mm}\\ %------------------------------------------------------------------------------------ {{\small {\tt FM(C) :} molecular formula calculated by mcf2graph}\\ {{\small {\tt MW(C) :} molecular weight calculated by mcf2graph}\\ {{\small {\tt MW(D) :} molecular weight from literature data}\\ \begin{mplibcode} font_wd:=100mm; font_ht:=50mm; beginfont("NO:1","EN:Chlorophyll a","MW:893.49") MCf(<54, {,``1,?5,$(2,5)d,4:N,3\,54~dl,|,?5,$(2,4)d,5:N, -2\,54~dl,|,?5,2=d,5:N,-2\~dl,54,|,?5,5=d,5:N,-2\~dl,&(#5), -1*,24,/*COOMe^15,72,//O,&(#1),}, 4\`1.45,Mg,&17,-1*,&11~vb,-1*,&23~vb, @(2,9,15,20~zf)/Me,8:/Et,14\,!~dr, 21*,-6~wf,!2,//O,!,O,!2,!~dl,|,!13,@(1,5,9,13)/Me, ) endfont \end{mplibcode} \input{temp-info.aux}% \MOLcaption{0mm}{40mm}\hspace{8mm}% %---------------------------------------------------------------------------- \begin{mplibcode} font_wd:=60mm; font_ht:=35mm; beginfont("NO:2","EN:Limonin","MW:470.51") MCf(<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)/Me,@(1^60,5^180,16^60)/*H, 14\*,|,?5,$(1,4)dl,3:O ) endfont \end{mplibcode} \input{temp-info.aux}% \MOLcaption{0mm}{48mm}\vspace{6mm}\\% %---------------------------------------------------------------------------- \begin{mplibcode} font_wd:=90mm; font_ht:=30mm; beginfont("NO:3","EN:beta-carotene","MW:536.87") MCf(<30, ?6,3=dl,@(3,5^35,5^-35)/Me, 4\,|,!18,$(1,3,5,7,9,11,13,15,17)dr,@(3,7,12,16)/Me, |,?6,6=dl,@(6,2^35,2^-35)/Me ) endfont \end{mplibcode} \input{temp-info.aux}% \MOLcaption{0mm}{35mm}\hspace{8mm}% %---------------------------------------------------------------------------- \begin{mplibcode} font_wd:=50mm; font_ht:=40mm; beginfont("NO:4","EN:Gibberellin A3","MW:346.37"); MCf(<12, ?6`1.3,3=?5,9=?7,12\^160`1.6,&8, 4\^155~zf`1.2,O,55,//O^180`1,&2~zb, 5=dl,11=wf,13=wb,7:/COOH,11://Me,1:*/OH,12:/*OH,2:*/Me, @(3^-60,9^60)*/H ) endfont; \end{mplibcode} \input{temp-info.aux}% \MOLcaption{0mm}{38mm}\vspace{5mm}\\% %---------------------------------------------------------------------------- \begin{mplibcode} font_wd:=60mm; font_ht:=70mm; beginfont("NO:5","EN:Erythromycin","MW:733.93"); 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,|,?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; \end{mplibcode} \input{temp-info.aux}% \MOLcaption{20mm}{56mm}\hspace{8mm}% %---------------------------------------------------------------------------- \begin{mplibcode} font_wd:=90mm; font_ht:=55mm; beginfont("NO:6","EN:Vancomycin","MW:1449.25"); MCf(<30, {,``1,!12,$(1,3,12)zf,7=wf,/H^-60,60,*/OH,60, Ph,-4:/Cl,-3\,O,!,Ph,-4\,O,!,Ph,-1^15:/Cl,-3\,/*OH,*/H^-60,&(#1), #7*,&(#26),#1\^120,//O,60,NH,60,/*H,*/COOH^180,-60, Ph,@(-2,-4)/OH,-1\,Ph,-5:/OH,-2*,&(#4),}, @(3^40,6,9,12)//O,@(2,5,8,11)NH, @(1^180,4^180)*/H,@(7^-60,10^60,14^60)/*H, #10*\^-60,60,//O,!,NH2, #13*\,NH,!,//O,!,/'(!,iPr)^-35>60,*/H^60,!~zf,NH,!, #23\,O,!,|,?6`.7,2:O,3^10:/'(!,OH),@(4,5)/OH,, -1\,O,!,|,?6`.7,6:O,@(3^35,5)/Me,3^-35:/NH2,4:/OH ) endfont; \end{mplibcode} \input{temp-info.aux}% \MOLcaption{52mm}{58mm}\vspace{6mm}\\% %---------------------------------------------------------------------------- \begin{mplibcode} font_wd:=150mm; font_ht:=80mm; beginfont("NO:7","EN:Maitotoxin","MW:3425.86") MCf(<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, -2\,?6,-3=?6,-3=?7,$(-3,-3)?6,-3=?8,-3=dl,$(-5,-3,-3,-3)?6, @(5,7,15,16,23,24,32,40,41,48,49,58,59,72,73,82,83,90,91,99, 100,107,113,114,122,123,130,131,140,141,148,149)O, @(1^60,2,26,28,29,51,54,61,63,68,75^60,78,109)*/OH, @(11,20,35,45,52,55,65,69,86)/*OH,@(47,57,71)/*H^60, @(3,8,13,17,21,33,38,42,56,70,84,92,101,106,111,128,138,142,146,150)/*H^-60, @(4,14,22,34,39,43,81,89,98,102,116,121,125,129,133)*/H^60, @(6,46,50,53,60,67,74)*/H^-60, @(9,18,85,93,112,139,143,147)*/Me`1^60, @(80,88,97,115,120,124)/*Me`1^-60,108:*/Me`1^-60, @(36~zf^-45>30)/'(O,!,SOO,!,"O{Na}"), #6\,|,!11,60~dr,-60,60,OH,2:/*OH,@(7,10)*/OH,@(1,3)*/Me,@(8~zf,11~dm,12)/Me, @(6>30)/'(O,!,SOO,!,"O{Na}"), #150\,|,!7,@(1,2)/*OH,4:*/Me,5:/*Me,7=dl ) endfont \end{mplibcode} \input{temp-info.aux}% \MOLcaption{0mm}{53mm}\\% %---------------------------------------------------------------------------- \end{document}