summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
blob: fdce25becf407371a71b883472345febfebffd5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example of  MCF typest with LuaLaTeX(luamplib)       by A.Yamaji   2015.8.7
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
%-------------------------------------------------------------------------------
\usepackage{luamplib}%
\mplibcodeinherit{enable}%
\mplibverbatim{enable}%
\everymplib{if unknown Ph1: input mcf2graph.mf; sw_logout:=1;%
                            mp_log_name:="temp-info.aux"; fi}%
\everyendmplib{write EOF to mp_log_name;}%
%-------------------------------------------------------------------------------
\makeatletter%
\newdimen \MOLwidth%
%-------------------------------------------------------------------------------
\def\mol@sel#1{%
  \if#1\empty\relax\else%
    \edef\@first{\expandafter\@first@param#1;}%
    \edef\@second{\expandafter\@second@param#1;}%
    \ifx\@first\@EN@    \edef\MOLnameE{\@second}\fi%
    \ifx\@first\@JN@    \edef\MOLnameJ{\@second}\fi%
    \ifx\@first\@NO@    \edef\MOLnumber{\@second}\fi%
    \ifx\@first\@CAS@   \edef\MOLcas{\@second}\fi%
    \ifx\@first\@MW@    \edef\MOLmw{\@second}\fi%
    \ifx\@first\@FM@    \edef\MOLfomura{\@second}\fi%
    \ifx\@first\@USE@   \edef\MOLuse{\@second}\fi%
    \ifx\@first\@XLogP@ \edef\MOLXLogP{\@second}\fi%
    \ifx\@first\@EXA@   \edef\MOLextA{\@second}\fi%
    \ifx\@first\@EXB@   \edef\MOLextB{\@second}\fi\fi}%
%-------------------------------------------------------------------------------
\def\@first@param#1:#2;{#1}\def\@second@param#1:#2;{#2}%
\def\@EN@{EN}\def\@JN@{JN}\def\@CAS@{CAS}\def\@NO@{NO}\def\@MW@{MW}\def\@FM@{FM}%
\def\@USE@{USE}\def\@XLogP@{XLogP}\def\@EXA@{EXA}\def\@EXB@{EXB}%
\def\MOL@info@aux#1#2#3{\mol@sel{#1}\mol@sel{#2}\mol@sel{#3}}%
\def\MOLinfo#1#2#3#4#5#6#7#8#9{%   %%%% max item number = 12  %%%%
  \edef\MOLnameE{}\edef\MOLnameJ{}\edef\MOLnumber{}\edef\MOLcas{}\edef\MOLmw{}%
  \edef\MOLfomura{}\edef\MOLuse{}\edef\MOLXLogP{}\edef\MOLextA{}\edef\MOLextB{}%
  \mol@sel{#1}\mol@sel{#2}\mol@sel{#3}\mol@sel{#4}\mol@sel{#5}\mol@sel{#6}%
  \mol@sel{#7}\mol@sel{#8}\mol@sel{#9}\MOL@info@aux}%
%--------------------------------------------------------------------------------
\def\MCFinfo#1#2#3#4#5#6#7#8#9{\MOLwidth#4pt\relax}%
\def\MOLcaption#1#2{\input temp-info.aux\relax\advance\MOLwidth -#1\relax%
\llap{\makebox[\MOLwidth][l]{\raisebox{#2}%
{\sf NO.\MOLnumber{ }\MOLnameE{ }\tiny (MW:\MOLmw)}}}}%
\makeatother%
%------------------------------------------------------------------------------------
\pagestyle{empty}
\topmargin=-25mm
\oddsidemargin=0mm
\textwidth=180mm
\textheight=280mm
\unitlength=1mm
%------------------------------------------------------------------------------------
\begin{document}
{\LARGE  MCF example for luamplib(LuaLaTeX) }%
   \hspace{20mm}by Akira Yamaji   2015.8.7\vspace{8mm}\\
%------------------------------------------------------------------------------------
\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}{35mm}\hspace{8mm}%
%----------------------------------------------------------------------------
\begin{mplibcode}
  font_wd:=60mm; font_ht:=40mm;
  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,25)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
     )
  endfont
\end{mplibcode}
\input{temp-info.aux}%
\MOLcaption{0mm}{43mm}\vspace{8mm}\\%
%----------------------------------------------------------------------------
\begin{mplibcode}
  font_wd:=90mm; font_ht:=30mm;
  beginfont("NO:3","EN:beta-Carotene","MW:536.87")
    MCf(^^30,
      ?6,3:d,@(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:d,@(6,2^35,2^-35)/Me
    )
  endfont
\end{mplibcode}
\input{temp-info.aux}%
\MOLcaption{0mm}{25mm}\hspace{8mm}%
%----------------------------------------------------------------------------
\begin{mplibcode}
font_wd:=50mm; font_ht:=40mm;
beginfont("NO:4","EN:Gibberellin","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,
     3=dr,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}{25mm}\vspace{10mm}\\%
%----------------------------------------------------------------------------
\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{0mm}{55mm}\hspace{8mm}%
%----------------------------------------------------------------------------
\begin{mplibcode}
font_wd:=100mm; font_ht:=70mm;
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{0mm}{70mm}\vspace{8mm}\\%
%----------------------------------------------------------------------------
\begin{mplibcode}
  font_wd:=160mm; font_ht:=90mm;
  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,@(^^60,47,57,71)/*H,
    @(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}{50mm}\\%
%----------------------------------------------------------------------------
\end{document}