summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
blob: 3d31e5f4ed15da3aed0197f38a89aed7e556a5cc (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example of  MCF typest with LuaLaTeX(luamplib)     by A.Yamaji    2021.03.21
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% mcf2graph.mf must be version 4.61
\documentclass{article}
%------------------------------------------------------------------------------
\usepackage{luamplib}%
\usepackage[T1]{fontenc}%
\usepackage{textcomp}%
\mplibcodeinherit{enable}%
\mplibverbatim{enable}%
\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;
}%
%------------------------------------------------------------------------------
\pagestyle{empty}
\topmargin=-20mm
\oddsidemargin=0mm
\textwidth=170mm
\textheight=280mm
\unitlength=1mm
%------------------------------------------------------------------------------------
\begin{document}
\begin{center}
 {\Huge\sf MCF example for luamplib(Lua\LaTeX)}\vspace{5mm}\\
 Author : Akira Yamaji \quad Date : \today\\
 Located at : http://www.ctan.org/pkg/mcf2graph\vspace{2mm}\\
\end{center}
%------------------------------------------------------------------------------------
\section{MCF example}
\noindent%
%------------------------------------------------------------------------------------
{{\tt FM(C) :} molecular formula calculated by mcf2graph\\
{{\tt MW(C) :} molecular weight calculated by mcf2graph\\
{{\tt MW(D) :} molecular weight from literature data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Chlorophyll a}
\noindent%
\begin{verbatim}
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);
  if check(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
%------------------------------------------------------------------------------------
\begin{mplibcode}
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);
  if check(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{Gibberellin A3}
\noindent%
\begin{verbatim}
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,30mm);
  if check(mc)=0: MC(scantokens(mc)) fi
endfont;
\end{verbatim}
%----------------------------------------------------------------------------
\begin{mplibcode}
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,30mm);
  if check(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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\subsection{Erythromycin}
\noindent%
%----------------------------------------------------------------------------
\begin{verbatim}
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);
  if check(mc)=0: MC(scantokens(mc)) fi
endfont;
\end{verbatim}
%----------------------------------------------------------------------------
\begin{mplibcode}
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);
  if check(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",
  %---------------------------------------------------------------------
  ": ?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);
  if check(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
%----------------------------------------------------------------------------
\begin{mplibcode}
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);
  if check(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{Kekulene}
\noindent%
\begin{verbatim}
beginfont("EN:Kekulene","MW:600.7",
  %-----------------------------------------------------------------------
  ": <30,Ph,{3,-2,-3,-2,-3,-2,-3,-2,-3,-2}=?6,(-3,6)=?6[3],@-4,&6,      ",
  ": {8,12,14,16,18,22,24,26,28,32,34,36,38,42,44,46,48,52,54,56,58}=dl ")
  %-----------------------------------------------------------------------
  fsize:=(120mm,25mm);
  if check(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
%----------------------------------------------------------------------------
\begin{mplibcode}
beginfont("EN:Kekulene","MW:600.7",
  ": <30,Ph,{3,-2,-3,-2,-3,-2,-3,-2,-3,-2}=?6,(-3,6)=?6[3],@-4,&6,      ",
  ": {8,12,14,16,18,22,24,26,28,32,34,36,38,42,44,46,48,52,54,56,58}=dl ")
  fsize:=(120mm,25mm);
  if check(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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
%----------------------------------------------------------------------------
\subsection{Vancomycin}
\noindent%
%----------------------------------------------------------------------------
\begin{verbatim}
beginfont("NO:6","EN:Vancomycin","MW:1449.25");
fsize:=(150mm,50mm);
MC(<-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,60,//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,4^180}:*/H,{7^-60,10^60,14^60}:/*H,
  @10,*\^-60,60,//O,!,NH2,@13,*\,NH,!,//O,!,/??!,*/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}:/_,3^-35:/NH2,4:/OH)
endfont;
\end{verbatim}
%----------------------------------------------------------------------------
\begin{mplibcode}
beginfont("NO:6","EN:Vancomycin","MW:1449.25");
fsize:=(150mm,45mm);
MC(<-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,60,//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,4^180}:*/H,{7^-60,10^60,14^60}:/*H,
  @10,*\^-60,60,//O,!,NH2,@13,*\,NH,!,//O,!,/??!,*/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}:/_,3^-35:/NH2,4:/OH)
  ext(
    defaultscale:=0.8;
    label.lrt("FM(C): "&cal_FM,(0,h-4mm));
    label.lrt("MW(C): "&cal_MW,(0,h-8mm));
    label.lrt("MW(D): "&inf_MW,(0,h-12mm));
  )
endfont;
\end{mplibcode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Maitotoxin}
\noindent%
%--------------------------------------------------------------------------------
\begin{verbatim}
beginfont("NO:7","EN:Maitotoxin","MW:3425.86")
fsize:=(170mm,70mm);
MC(<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}:*/_`1^60,
   {80,88,97,115,120,124}:/*_`1^-60,108:*/_`1^-60,
   @6,\,|,!11,60~dr,-60,60,OH,2:/*OH,{7,10}:*/OH,{1,3}:*/_,{8~zf,11~dm,12}:/_,
     @6,\,O,30,SOO,30,"O{Na}",
   @36,-45~zf,O,30,SOO,30,"O{Na}",
   @150,\,|,!7,{1,2}:/*OH,4:*/_,5:/*_,7=dl)
endfont
\end{verbatim}
%--------------------------------------------------------------------------------
\begin{mplibcode}
fsize:=(170mm,60mm);
beginfont("NO:7","EN:Maitotoxin","MW:3425.86")
MC(<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}:*/_`1^60,
   {80,88,97,115,120,124}:/*_`1^-60,108:*/_`1^-60,
   @$6,\,|,!11,60~dr,-60,60,OH,2:/*OH,{7,10}:*/OH,{1,3}:*/_,{8~zf,11~dm,12}:/_,
            @6,\,O,30,SOO,30,"O{Na}",
   @$36,-45~zf,O,30,SOO,30,"O{Na}",
   @$150,\,|,!7,{1,2}:/*OH,4:*/_,5:/*_,7=dl
   )
   ext(
     defaultscale:=0.8;
     label.lrt("FM(C): "&cal_FM,(0,.8h-5mm));
     label.lrt("MW(C): "&cal_MW,(0,.8h-9mm));
     label.lrt("MW(D): "&inf_MW,(0,.8h-13mm));
   )
endfont
\end{mplibcode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\subsection{TCA cycle}
\noindent%
\begin{mplibcode}
beginfont("EN:TCA cycle")
fsize:=(160mm,75mm);
max_blength:=5mm;
%------------------------------------------------------------------------
COOH:='(//O,!,OH);
HOCO:='(OH,!,//O,);
MCat(0.33,   1)(<30,HOCO,!,//O,!2,COOH)
MCat(0.66,   1)(<30,HOCO,!4,COOH,@-4`1,\,COOH,4:/OH^-165)
MCat(1,      1)(<30,HOCO,!2,!~dr,!,COOH,@-4`1,\,COOH)
MCat(1,   0.55)(<30,HOCO,!4,COOH,@-4,\`1,COOH)
MCat(1,   0.05)(<30,HOCO,!3,//O,!,COOH,@-4,\`1,COOH)
MCat(0.66,0.05)(<30,HOCO,!3,//O,!,COOH)
MCat(0.33,0.05)(<30,HOCO,!3,//O,!,"{S-CoA}")
MCat(0,   0.05)(<30,HOCO,!3,COOH)
MCat(0,   0.55)(<30,HOCO,!,!~dr,!,COOH)
MCat(0,      1)(<30,HOCO,!3,COOH,3:/OH)
%-------------------------------------------------------------------------
ext(
defaultfont:="uhvr8r";
defaultscale:=0.75;
ext_setup;
def sel_dir(expr rot)=
  save tx; nA:=rot; if nA>=360: nA:=nA-360; fi
  if     (nA<30)or(nA>330):   def tx=top enddef; elseif (nA>=30)and(nA<=150):  def tx=lft enddef;
  elseif (nA>150)and(nA<210): def tx=bot enddef; elseif (nA>=210)and(nA<=330): def tx=rt enddef; fi
enddef;
def reaction_arrow(expr a)(expr r)(expr p)(expr sa,la)(expr sb,lb)(expr sc,lc)(expr sd,ld)=
  drawarrow ((0,0)..(a,0)) rotated r shifted p;
  if sa<>"": draw ((0.5a,0){dir 180}..{dir 90}(0,.5a*la)) rotated r shifted p;
             sel_dir(r); label.tx(sa,p+((0,0.5a*la) rotated r)); fi
  if sb<>"": draw ((0.5a,0){dir 0}..{dir 90}(a,.5a*lb)) rotated r shifted p;
             sel_dir(r); label.tx(sb,p+((a,0.5a*lb) rotated r)); fi
  if sc<>"": draw ((0.5a,0){dir 180}..{dir -90}(0,-.5a*lc)) rotated r shifted p;
             sel_dir(r+180); label.tx(sc,p+((0,-0.5a*lc) rotated r)); fi
  if sd<>"": draw ((0.5a,0){dir 0}..{dir -90}(a,-.5a*ld)) rotated r shifted p;
             sel_dir(r+180); label.tx(sd,p+((a,-0.5a*ld) rotated r)); fi
enddef;
def r_arrow(expr a)(expr r)(expr p)(expr sc,lc)(expr sd,ld)=
   reaction_arrow(a)(r)(p)("",0)("",0)(sc,lc)(sd,ld)
enddef;
%------------------------------------------------------------------------
save dx; pair dx; dx:=(12mm,0);
label.bot("Oxaloacetate",p1+dx);   label.bot("Citrate",p2+dx);
label.bot("cis-Aconitate",p3+dx);  label.bot("Isocitrate",p4+dx);
label.bot("Oxalosuccinate",p5+dx); label.bot("alfa-Ketoglutarate",p6+dx);
label.bot("Succinyl-CoA",p7+dx);   label.bot("Succinate",p8+dx);
label.bot("Fumarate",p9+dx);       label.bot("L-Malate",p10+dx);
sw_label_emu:=1;
ext_setup;
r_arrow(10mm)(  0)(p1+ ( 1.1w1, 0.3h1))("Acetyl-CoA",1.5)(" CoA-SH",1);
r_arrow(10mm)(  0)(p2+ ( 1.1w2, 0.4h2))("",0)("H2O",1);
r_arrow( 8mm)(270)(p3+ ( 0.5w3,-0.4h3))("H2O",1)("",0);
r_arrow( 8mm)(270)(p4+ ( 0.5w4,-0.4h4))("NAD+",1)("NADH2+",1);
r_arrow(10mm)(180)(p5+ (-0.1w5, 0.4h5))("",0)("CO2",1);
r_arrow(10mm)(180)(p6+ (-0.1w6, 0.5h6))("NAD+,CoA-SH",1.7)("NADH2+,CO2",1);
r_arrow(10mm)(180)(p7+ (-0.1w7, 0.5h7))("GDP,Pi",1.7)("GTP,CoA-SH",1);
r_arrow( 8mm)( 90)(p8+ ( 0.4w8, 1.2h8))("FAD",1)("FADH2",1);
r_arrow( 8mm)( 90)(p9+ ( 0.4w9, 1.2h9))("H2O",1)("",0);
r_arrow(10mm)(  0)(p10+( 1.1w10,0.3h10))("NAD+",1)("NADH2+",1.5);
defaultscale:=1.5;
label("TCA-cycle",(0.5w,0.5h));
)
endfont
\end{mplibcode}
%------------------------------------------------------------------------
\begin{verbatim}
beginfont("EN:TCA cycle")
fsize:=(160mm,75mm);
max_blength:=5mm;
COOH:='(//O,!,OH);
HOCO:='(OH,!,//O,);
MCat(0.33,   1)(<30,HOCO,!,//O,!2,COOH)
MCat(0.66,   1)(<30,HOCO,!4,COOH,@-4`1,\,COOH,4:/OH^-165)
MCat(1,      1)(<30,HOCO,!2,!~dr,!,COOH,@-4`1,\,COOH)
MCat(1,   0.55)(<30,HOCO,!4,COOH,@-4,\`1,COOH)
MCat(1,   0.05)(<30,HOCO,!3,//O,!,COOH,@-4,\`1,COOH)
MCat(0.66,0.05)(<30,HOCO,!3,//O,!,COOH)
MCat(0.33,0.05)(<30,HOCO,!3,//O,!,"{S-CoA}")
MCat(0,   0.05)(<30,HOCO,!3,COOH)
MCat(0,   0.55)(<30,HOCO,!,!~dr,!,COOH)
MCat(0,      1)(<30,HOCO,!3,COOH,3:/OH)
ext(
defaultfont:="uhvr8r";
defaultscale:=0.75;
ext_setup;
save dx; pair dx; dx:=(12mm,0);
label.bot("Oxaloacetate",p1+dx);   label.bot("Citrate",p2+dx);
label.bot("cis-Aconitate",p3+dx);  label.bot("Isocitrate",p4+dx);
label.bot("Oxalosuccinate",p5+dx); label.bot("alfa-Ketoglutarate",p6+dx);
label.bot("Succinyl-CoA",p7+dx);   label.bot("Succinate",p8+dx);
label.bot("Fumarate",p9+dx);       label.bot("L-Malate",p10+dx);
sw_label_emu:=1;
ext_setup;
r_arrow(10mm)(  0)(p1+ ( 1.1w1, 0.3h1))("Acetyl-CoA",1.5)(" CoA-SH",1);
r_arrow(10mm)(  0)(p2+ ( 1.1w2, 0.4h2))("",0)("H2O",1);
r_arrow( 8mm)(270)(p3+ ( 0.5w3,-0.4h3))("H2O",1)("",0);
r_arrow( 8mm)(270)(p4+ ( 0.5w4,-0.4h4))("NAD+",1)("NADH2+",1);
r_arrow(10mm)(180)(p5+ (-0.1w5, 0.4h5))("",0)("CO_2_",1);
r_arrow(10mm)(180)(p6+ (-0.1w6, 0.5h6))("NAD+,CoA-SH",1.7)("NADH2+,CO2",1);
r_arrow(10mm)(180)(p7+ (-0.1w7, 0.5h7))("GDP,Pi",1.7)("GTP,CoA-SH",1);
r_arrow( 8mm)( 90)(p8+ ( 0.4w8, 1.2h8))("FAD",1)("FADH2",1);
r_arrow( 8mm)( 90)(p9+ ( 0.4w9, 1.2h9))("H2O",1)("",0);
r_arrow(10mm)(  0)(p10+( 1.1w10,0.3h10))("NAD+",1)("NADH2+",1.5);
defaultscale:=1.5;
label("TCA-cycle",(0.5w,0.5h));
)
endfont
\end{verbatim}
%----------------------------------------------------------------------------
\end{document}