ppchtex.mkiv /size: 115 Kb    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=ppchtex,
3
%D version=1997.03.19,
4
%D title=\CONTEXT\ Extra Modules,
5
%D subtitle=\PPCHTEX\ (Plain Pictex Context cHemie \TEX),
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D suggestions={Tobias Burnus, Dirk Kuypers \& Ton Otten},
9
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
10
%C
11
%C This module is part of the \CONTEXT\ macro||package and is
12
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
13
%C details.
14 15
\endinput
16 17
% option=test => boxes
18
% dummy => file
19
% final => file / local run
20
%
21
% constante van phantom in definitie ONE: \setchemicaltextwidth 300
22
%
23
% it would be interesting to rewrite this module with todays
24
% experiences and new context functionality, maybe ...
25 26
% Deze module ondersteunt het zetten van chemische
27
% (structuur)formules. Hoewel de macro' zijn afgestemd op
28
% CONTEXT, zijn ze ook buiten deze zetomgeving te gebruiken.
29
%
30
% Dit is, afgezien van updates, de definitieve versie van
31
% PPCHTEX. Gebruikersgemak, eenvoud, flexibiliteit, en
32
% snelheid zijn inmiddels redelijk geoptimaliseerd. Dit neemt
33
% niet weg dat hier en daar nog verbetering mogelijk is. Dit
34
% zal dan ook nog gebeuren.
35
%
36
% Volgende versies zullen tenminste dezelfde functionaliteit
37
% hebben. We houden ons natuurlijk het recht voor de kwaliteit
38
% van de output te verbeteren. Daarnaast staan nog op het
39
% wensenlijstje:
40
%
41
% - optimaliseren in termen van proces-tijd
42
% - aanpassen naamgeving van interne macro's
43
% - toevoegen van functionaliteit
44
% - in \x!-vorm omzetten van GIVES, TB enz.
45
%
46
% De mix tussen engels en nederlands lijkt soms verwarrend.
47
% Meestal zijn verborgen macro's engels en zichtbare macro's
48
% nederlands. Het gebruik van [ ] en { } sluit aan op andere
49
% Context-macro's. Hetzelfde geldt voor instellingen en
50
% \start-\stop-constructies.
51
%
52
% De schijnbaar overbodige \bgroup-\egroup constructie
53
% garandeert aansluiting bij de Context-macro's voor het
54
% plaatsen van figuren, tabellen en andere floats.
55
%
56
% Binnen Context worden de macro's geladen met
57
% \gebruikextras[chemie]. Daarbij wordt een passende melding
58
% getoont. Buiten Context genereren we een melding:
59 60
\doifundefined
{
usemodule
}
61
{
\writestatus
{
loading
}
{
ConTeXt
Chemical
Macro
'
s
/
1
9
9
6
.
3
.
1
}
}
62 63
% Er kan gebruik worden gemaakt van PiCTeX of PStricks. Een
64
% van deze pakketten moet van te voren zijn geladen.
65
%
66
% \input prepictex.tex (i.g.v. LaTeX)
67
% \input pictex.tex
68
% \input postpictex.tex (i.g.v. LaTeX)
69
%
70
% of:
71
%
72
% \input multido.tex
73
% \input pstricks.tex
74
% \input pst-plot.tex
75
%
76
% In \CONTEXT\ kan men de modules m-pictex en m-pstricks
77
% gebruiken. De eerste module laad of efficiente wijze PiCTeX
78
% en de tweede module koppelt het PSTRICKS kleurmechanisme
79
% aan dat van \CONTEXT.
80 81
% PSTricks: {-\chemicalangle} instead of {*0}, which produces
82
% faulty ps code when \chemicalangle=0
83 84
\startcommands
dutch
english
german
85 86
gotochemical
:
naarchemie
gotochemical
zurchemie
87
setupchemical
:
stelchemiein
setupchemical
stellechemieein
88
startchemical
:
startchemie
startchemical
startchemie
89
stopchemical
:
stopchemie
stopchemical
stopchemie
90
definechemical
:
definieerchemie
definechemical
definierechemie
91
chemical
:
chemie
chemical
chemie
92
toptext
:
boventekst
toptext
textueber
93
bottext
:
ondertekst
bottext
textunter
94
midtext
:
middentekst
midtext
textmitte
95 96
\stopcommands
97 98
\doifundefined
{
fiverm
}
% In the more recent LaTeX versions
99
{
\font
\fiverm
=
cmr
5
}
% \fiverm is no longer (pre)defined.
100 101
\newconstant
\chemicaldrawingmode
102 103
\doifelsedefined
{
beginpicture
}
% PiCTeX
104
{
\doifelsedefined
{
startMPdrawing
}
105
{
\chemicaldrawingmode
\plustwo
}
% MetaPost
106
{
\chemicaldrawingmode
\zerocount
}
}
% raw
107
{
\doifelsedefined
{
psaxes
}
108
{
\chemicaldrawingmode
\plusone
}
% PSTricks
109
{
\chemicaldrawingmode
\plusthree
}
}
% unknown
110 111
\ifcase
\chemicaldrawingmode
112
\writestatus
{
ppchtex
}
{
using
PiCTeX
}
113
\or
114
\writestatus
{
ppchtex
}
{
using
PSTricks
(
still
experimental
)
}
115
\writestatus
{
ppchtex
}
{
automatic
sizing
not
(
yet
)
supported
}
116
\or
117
\writestatus
{
ppchtex
}
{
using
PiCTeX
and
MetaPost
}
118
\else
119
\writestatus
{
ppchtex
}
{
load
PiCTeX
(
+
pre
/
post
)
or
PSTricks
(
+
pst
_
plot
)
first
}
120
\bgroup
121
\read
1
6
to
\exit
122
\egroup
123
\expandafter
\endinput
124
\fi
125 126
%I n=Chemie
127
%I c=\stelchemiein,\chemie
128
%I
129
%I Chemische formules kunnen worden gezet met behulp van de
130
%I onderstaande commando's:
131
%I
132
%I buiten $ en $$ :
133
%I
134
%I \chemie[segmenten][symbolen]
135
%I
136
%I \startchemie[instellingen]
137
%I \chemie...
138
%I \chemie...
139
%I \stopchemie
140
%I
141
%I en binnen $ en $$:
142
%I
143
%I \chemie{}{}
144
%I
145
%I Voor tekst, uitleg en voorbeelde verwijzen we vooralsnog
146
%I naar de handleiding.
147
%P
148
%I Het gedrag van de macro's kan worden ingesteld met:
149
%I
150
%I \stelchemiein[breedte=,hoogte=,links=,rechts=,boven=,
151
%I onder=,korps=,schaal=,status=,assenstelsel=,kader=,
152
%I variant=,optie=,formaat=,tekstformaat=,resolutie=,
153
%I offset=,letter=]
154
%I
155
%I Structuren kunnen worden voorgedefinieerd met het commando
156
%I
157
%I \definieerchemie[naam]{\chemie...}
158 159
%S \startsetup
160
%S \command
161
%S [\!stelchemiein]
162
%S \type
163
%S [\c!vars!]
164
%S \variable
165
%S [\c!breedte]
166
%S [\c!number!,\v!passend]
167
%S [0]
168
%S \variable
169
%S [\c!hoogte]
170
%S [\c!number!,\v!passend]
171
%S [0]
172
%S \variable
173
%S [\c!links]
174
%S [\c!number!]
175
%S [0]
176
%S \variable
177
%S [\c!rechts]
178
%S [\c!number!]
179
%S [0]
180
%S \variable
181
%S [\c!boven]
182
%S [\c!number!]
183
%S [0]
184
%S \variable
185
%S [\c!onder]
186
%S [\c!number!]
187
%S [0]
188
%S \variable
189
%S [\c!resolutie]
190
%S [\c!number!]
191
%S [\outputresolution]
192
%S \variable
193
%S [\c!korps]
194
%S [10pt,11pt,12pt]
195
%S [\bodyfontsize]
196
%S \variable
197
%S [\c!schaal]
198
%S [\v!klein,\v!middel,\v!groot]
199
%S [\v!middel]
200
%S \variable
201
%S [\c!formaat]
202
%S [\v!klein,\v!middel,\v!groot]
203
%S [\v!groot]
204
%S \variable
205
%S [\c!tekstformaat]
206
%S [\v!klein,\v!middel,\v!groot]
207
%S [\v!groot]
208
%S \variable
209
%S [\c!status]
210
%S [\v!start,\v!stop]
211
%S [\v!start]
212
%S \variable
213
%S [\c!kader]
214
%S [\v!aan,\v!uit]
215
%S [\v!uit]
216
%S \variable
217
%S [\c!assenstelsel]
218
%S [\v!aan,\v!uit]
219
%S [\v!uit]
220
%S \variable
221
%S [\c!optie]
222
%S [\v!test]
223
%S []
224
%S \variable
225
%S [\c!variant]
226
%S [1,2]
227
%S [1]
228
%S \variable
229
%S [\c!offset]
230
%S [HIGH,LOW]
231
%S [LOW]
232
%S \variable
233
%S [\c!letter]
234
%S [\c!command!]
235
%S [\rm]
236
%S \stopsetup
237 238
%S \startsetup
239
%S \command
240
%S [\v!startchemie]
241
%S \type
242
%S [\c!vars!\c!stp!]
243
%S \inheritvariable
244
%S [\v!stelchemiein]
245
%S []
246
%S \stopsetup
247 248
%S \startsetup
249
%S \command
250
%S [\v!chemie]
251
%S \type
252
%S [\c!vals!\c!vals!]
253
%S \value
254
%S [\c!list!]
255
%S []
256
%S \value
257
%S [\c!list!]
258
%S []
259
%S \stopsetup
260 261
%S \startsetup
262
%S \command
263
%S [definieerchemie]
264
%S \type
265
%S [\c!val!\c!arg!]
266
%S \value
267
%S [\c!text!]
268
%S []
269
%S \stopsetup
270 271
\unprotect
272 273
% Om te voorkomen dat sub- en superscripts botsen passen we
274
% wat fontdimen's aan (Knuth, The TeXBook, p179). Helaas
275
% kunnen deze instellingen niet lokaal worden gehouden door
276
% groeperen, vandaar dat een en ander moet worden geset én
277
% gereset.
278
%
279
% Er dient een relatie te worden gelegd met de afmetingen
280
% van de letters. In een eerdere versie werden daartoe de
281
% \fontdimen's opgehoogd. Omdat dit problemen gaf bij
282
% scaled fonts, is bij nader inzien gekozen voor de
283
% onderstaande oplossing, waarbij de nieuwe waarden worden
284
% afgeleid van de x-height (\fontexheight). De factor 0.70
285
% is min of meer experimenteel vastgesteld. Soms worden de
286
% regels iets verder uit elkaar gezet. Jammer. Italic fonts
287
% hebben grotere cijfers en vallen min of meer uit de boot.
288 289
\newif
\ifloweredsubscripts
% this will be redone in the mkiv ways
290 291
\def
\setsubscripts
292
{
\def
\dosetsubscript
#
#
1
#
#
2
#
#
3
%
293
{
\dimen
0
=
#
#
3
\fontexheight
#
#
2
%
294
\setxvalue
{
@
@
\string
#
#
1
\string
#
#
2
}
{
\the
#
#
1
#
#
2
\relax
}
%
295
#
#
1
#
#
2
=
\dimen
0
\relax
}
%
296
\def
\dodosetsubscript
#
#
1
#
#
2
%
297
{
\dosetsubscript
{
#
#
1
}
{
\textfont
2
}
{
#
#
2
}
%
298
\dosetsubscript
{
#
#
1
}
{
\scriptfont
2
}
{
#
#
2
}
%
299
\dosetsubscript
{
#
#
1
}
{
\scriptscriptfont
2
}
{
#
#
2
}
}
%
300
%dodosetsubscript\mathsupnormal {?}%
301
\dodosetsubscript
\mathsubnormal
{
.
7
}
%
302
\dodosetsubscript
\mathsubcombined
{
.
7
}
%
303
\global
\loweredsubscriptstrue
}
304 305
\def
\resetsubscripts
306
{
\ifloweredsubscripts
307
\def
\doresetsubscript
#
#
1
#
#
2
%
308
{
\dimen
0
=
\getvalue
{
@
@
\string
#
#
1
\string
#
#
2
}
\relax
309
#
#
1
#
#
2
=
\dimen
0
}
%
310
\def
\dodoresetsubscript
#
#
1
%
311
{
\doresetsubscript
{
#
#
1
}
{
\textfont
2
}
%
312
\doresetsubscript
{
#
#
1
}
{
\scriptfont
2
}
%
313
\doresetsubscript
{
#
#
1
}
{
\scriptscriptfont
2
}
}
%
314
%dodoresetsubscript\mathsupnormal
315
\dodoresetsubscript
\mathsubnormal
316
\dodoresetsubscript
\mathsubcombined
317
\global
\loweredsubscriptsfalse
318
\fi
}
319 320
\ifx
\Umathchar
\undefined
\else
321
% for the moment we nil them, soon we will have a proper
322
% way to deal with this
323
\let
\setsubscripts
\relax
324
\let
\resetsubscripts
\relax
325
\fi
326 327
\def
\doresetsubscripts
328
{
\resetsubscripts
}
329 330
\def
\sethighsubscripts
331
{
\resetsubscripts
332
\let
\dosetsubscripts
=
\relax
}
333 334
\def
\setlowsubscripts
335
{
\def
\dosetsubscripts
{
\setsubscripts
}
}
336 337
\setlowsubscripts
338 339
\newcount
\horchemical
% t.z.t. \newcounter
340
\newcount
\verchemical
% t.z.t. \newcounter
341
\newcount
\txtchemical
% t.z.t. \newcounter
342
\newcount
\levchemical
% t.z.t. \newcounter
343 344
\newif
\ifinchemical
\inchemicalfalse
345
\newif
\iffixedchemical
\fixedchemicalfalse
346 347
\newbox
\chemicalsymbols
348 349
% Eigenlijk moeten de constanten en variabelen in cont-nl.tex
350
% staan. Dit pakket is echter relatief onafhankelijk van CONTEXT.
351 352
\definesystemvariable
{
chemical
}
353 354
\definesystemconstant
{
chemical
}
355 356
\definesystemconstant
{
translate
}
357
\definesystemconstant
{
distance
}
358
\definesystemconstant
{
mirror
}
359
\definesystemconstant
{
rotate
}
360
\definesystemconstant
{
substitute
}
361
\definesystemconstant
{
angle
}
362 363
\definesystemconstant
{
executechemical
}
364
\definesystemconstant
{
chemicaltextelement
}
365
\definesystemconstant
{
chemicallinesegment
}
366
\definesystemconstant
{
chemicalcircsegment
}
367 368
\def
\chemicalspace
{
\quad
}
369 370
% begin van experiment:
371
%
372
% De onderstaande twee macro's kunnen worden gebruikt voor
373
% bijvoorbeeld een interactiemechanisme.
374
%
375
% \localgotochemical {verwijzing} {tekst}
376
% \localthisischemical {verwijzing}
377 378
\def
\dowithchemical
%
379
{
}
380 381
\def
\localgotochemical
#
1
#
2
{
\gotobox
{
#
2
}
[
#
1
]
}
382
\def
\localthisischemical
#
1
{
\pagereference
[
#
1
]
}
383 384
% eind van experiment
385 386
\def
\setchemicalmaximum
#
1
387
{
\def
\maxchemical
{
#
1
}
}
388 389
\def
\doifchemicalnumber
#
1
#
2
#
3
%
390
{
\doifelsenumber
{
#
1
}
391
{
\ifnum
#
1
>
\maxchemical
\relax
392
\writestatus
{
ppchtex
}
{
number
#
1
is
skipped
}
%
393
\else
394
#
3
%
395
\fi
}
396
{
\unknownchemical
{
#
2
}
}
}
%
397 398
\newif
\ifsmallchemicaltext
399 400
\let
\@@localchemicalstyle
\empty
401 402
\unexpanded
\def
\setupchemicalformat
[
#
1
]
%
403
{
\processaction
404
[
\getvalue
{
#
1
\c!size
}
]
405
[
\v!small
=
>
\def
\@@localchemicalformat
{
\scriptscriptstyle
}
,
406
\v!medium
=
>
\def
\@@localchemicalformat
{
\ifsmallchemicaltext
\scriptscriptstyle
\else
\scriptstyle
\fi
}
,
407
\v!big
=
>
\def
\@@localchemicalformat
{
\ifsmallchemicaltext
\scriptstyle
\else
\textstyle
\fi
}
,
408
\s!unknown
=
>
\def
\@@localchemicalformat
{
\getvalue
{
#
1
\c!size
}
}
]
%
409
\processaction
410
[
\getvalue
{
#
1
\c!textsize
}
]
411
[
\v!small
=
>
\def
\@@localchemicalstyle
{
\scriptscriptstyle
}
,
412
\v!medium
=
>
\def
\@@localchemicalstyle
{
\ifsmallchemicaltext
\scriptscriptstyle
\else
\scriptstyle
\fi
}
,
413
\v!big
=
>
\def
\@@localchemicalstyle
{
\ifsmallchemicaltext
\scriptstyle
\else
\textstyle
\fi
}
,
414
\s!unknown
=
>
\def
\@@localchemicalstyle
{
\getvalue
{
#
1
\c!textsize
}
}
]
%
415
\processaction
416
[
\getvalue
{
#
1
\c!scale
}
]
417
[
\v!small
=
>
\def
\@@localchemicalscale
{
5
0
0
}
,
418
\v!medium
=
>
\def
\@@localchemicalscale
{
6
2
5
}
,
419
\v!big
=
>
\def
\@@localchemicalscale
{
7
5
0
}
,
420
\s!unknown
=
>
\def
\@@localchemicalscale
{
\getvalue
{
#
1
\c!scale
}
}
]
}
421 422
\def
\@@currentchemicalformat
423
{
\ifinchemical
424
\@@localchemicalformat
425
\else
426
\@@localchemicalstyle
427
\fi
}
428 429
\def
\dosetupchemical
[
#
1
]
%
430
{
\getparameters
[
\??chemical
\s!chemical
]
[
#
1
]
%
431
\doifelse
{
\@@chemicalchemicaloffset
}
{
LOW
}
432
{
\setlowsubscripts
}
433
{
\sethighsubscripts
}
%
434
\setupchemicalformat
[
\??chemical
\s!chemical
]
%
435
\ignorespaces
}
436 437
\unexpanded
\def
\setupchemical
438
{
\dosingleargument
\dosetupchemical
}
439 440
\def
\@@dochemicalstyle
% % default mapping
441
{
\@@chemicalstyle
}
442 443
\def
\@@dochemicalcolor
% % no mapping yet
444
{
}
445 446
\def
\@@chemicalstyle
% $inner-style$ % (overloaded)
447
{
\@@chemicalchemicalstyle
}
% $$outer-style$$
448 449
\def
\@@writechemicalstate
#
1
#
2
%
450
{
}
451 452
\def
\@@beginchemicallocalpicture
453
{
\ifcase
\chemicaldrawingmode
454
\beginpicture
455
\or
456
\pspicture
(
0
,
0
)
(
0
,
0
)
% is this permitted ?
457
\or
458
\pushMPdrawing
459
\startMPdrawing
460
%prologues := 1 ;
461
%input mp-tool ;
462
u
:
=
1
0
*
\@@chemicalunit
;
463
bboxmargin
:
=
0
pt
;
464
pickup
pencircle
scaled
2
u
;
% ???
465
\stopMPdrawing
466
\beginpicture
467
\fi
}
468 469
\def
\@@endchemicallocalpicture
#
1
#
2
%
470
{
\ifcase
\chemicaldrawingmode
471
\endpicture
472
\or
473
\endpspicture
474
\or
475
\resetchemicalcoordinates
476
\setbox
2
\hbox
{
\ignoreMPboxdepth
\getMPdrawing
}
%
477
\wd
2
\zeropoint
478
\ht
2
\zeropoint
479
\dp
2
\zeropoint
480
\put
{
\box
2
}
at
0
0
481
\endpicture
482
\popMPdrawing
483
\fi
}
484 485
\def
\@@beginchemicalpicture
#
1
#
2
#
3
#
4
%
486
{
\ifnum
\chemicaldrawingmode
=
1
487
\pspicture
(
#
1
,
#
3
)
(
#
2
,
#
4
)
%
488
\def
\account
#
#
1
#
#
2
{
}
%
489
\psaxes
[
axesstyle
=
none
,
labels
=
none
,
ticks
=
none
]
(
#
1
,
#
3
)
(
#
2
,
#
4
)
%
490
\else
491
\beginpicture
492
\setplotarea
493
x
from
{
#
1
}
to
{
#
2
}
,
494
y
from
{
#
3
}
to
{
#
4
}
495
\iffixedchemical
496
\accountingon
497
\def
\account
#
#
1
#
#
2
%
498
{
\put
{
}
at
{
#
#
1
}
{
#
#
2
}
}
%
499
\else
500
\accountingoff
501
\def
\account
#
#
1
#
#
2
{
}
%
502
\fi
503
\fi
504
\ignorespaces
}
505 506
\def
\@@endchemicalpicture
%
507
{
\ifcase
\chemicaldrawingmode
508
\put
{
\box
\chemicalsymbols
}
at
0
0
% elders
509
\endpicture
510
\or
511
\rput
(
0
,
0
)
{
\box
\chemicalsymbols
}
%
512
\endpspicture
513
\or
514
\put
{
\box
\chemicalsymbols
}
at
0
0
% elders
515
\ifMPdrawingdone
516
\resetchemicalcoordinates
517
\setbox
2
\hbox
{
\ignoreMPboxdepth
\getMPdrawing
}
%
518
\wd
2
\zeropoint
519
\ht
2
\zeropoint
520
\dp
2
\zeropoint
521
\put
{
\box
2
}
at
0
0
%
522
\fi
523
\endpicture
524
\fi
}
525 526
\def
\@@setchemicalcoordinatesystem
#
1
%
527
{
\edef
\@@chemicalunit
{
#
1
}
%
528
\ifcase
\chemicaldrawingmode
529
\setcoordinatesystem
units
<
\@@chemicalunit
,
\@@chemicalunit
>
%
530
\or
531
\psset
{
unit
=
\@@chemicalunit
}
%
532
\or
533
\setcoordinatesystem
units
<
\@@chemicalunit
,
\@@chemicalunit
>
%
534
\startMPdrawing
535
%input mp-tool ;
536
%prologues := 1 ;
537
u
:
=
1
0
*
#
1
;
538
bboxmargin
:
=
0
pt
;
539
pickup
pencircle
scaled
2
u
;
% ???
540
\stopMPdrawing
541
\fi
}
542 543
\ifx
\MPdivten
\undefined
% hack to prevent overflows in mp
544
\def
\MPdivten
[
#
1
]
{
\withoutpt
\the
\dimexpr
#
1
pt
/
1
0
\relax
}
545
\fi
546 547
\def
\@@setchemicalaxis
#
1
#
2
#
3
#
4
%
548
{
\ifcase
\chemicaldrawingmode
549
\axis
550
bottom
shiftedto
y
=
0
551
ticks
from
{
#
1
}
to
{
#
2
}
by
5
0
0
/
552
\axis
553
left
shiftedto
x
=
0
554
ticks
from
{
#
3
}
to
{
#
4
}
by
5
0
0
/
%
555
\or
556
\psaxes
[
labels
=
none
,
Dx
=
5
0
0
,
Dy
=
5
0
0
]
(
0
,
0
)
(
#
1
,
#
3
)
(
#
2
,
#
4
)
%
557
\or
558
\global
\MPdrawingdonetrue
559
% we need to div beforehand because of mp limitations
560
\startMPdrawing
561
x
1
:
=
\MPdivten
[
#
1
]
u
;
x
2
:
=
\MPdivten
[
#
2
]
u
;
562
y
1
:
=
\MPdivten
[
#
3
]
u
;
y
2
:
=
\MPdivten
[
#
4
]
u
;
563
draw
z
1
-
-
(
x
2
,
y
1
)
-
-
z
2
-
-
(
x
1
,
y
2
)
-
-
cycle
;
564
d
:
=
5
0
u
;
dd
:
=
1
0
u
;
565
draw
(
x
1
,
0
)
-
-
(
x
2
,
0
)
;
566
draw
(
0
,
y
1
)
-
-
(
0
,
y
2
)
;
567
for
i
=
d
step
-
d
until
x
1
:
draw
(
i
,
dd
)
-
-
(
i
,
-
dd
)
;
endfor
;
568
for
i
=
d
step
d
until
x
2
:
draw
(
i
,
dd
)
-
-
(
i
,
-
dd
)
;
endfor
;
569
for
i
=
d
step
-
d
until
y
1
:
draw
(
-
dd
,
i
)
-
-
(
dd
,
i
)
;
endfor
;
570
for
i
=
d
step
d
until
y
2
:
draw
(
-
dd
,
i
)
-
-
(
dd
,
i
)
;
endfor
;
571
\stopMPdrawing
572
\fi
}
573 574
\def
\@@setsecondchemicalplotsymbol
%
575
{
\ifcase
\chemicaldrawingmode
576
\!!widtha
=
5
0
.
8
mm
577
\divide
\!!widtha
by
\@@chemicalresolution
\relax
578
\plotsymbolspacing
=
\!!widtha
579
\setplotsymbol
(
{
\vrule
\s!height
\!!widtha
\s!width
\!!widtha
}
)
%
580
\fi
}
581 582
% Something for Dirk:
583 584
\newcount
\currentchemical
585 586
%\newif \ifskipchemical
587 588
\def
\setchemicaldimensions
#
1
#
2
#
3
%
589
{
\bgroup
590
\global
\advance
\currentchemical
by
1
591
\dimen
0
=
#
1
\relax
592
\dimen
2
=
#
2
\relax
593
\dimen
4
=
#
3
\relax
594
\setxvalue
{
chemical
:
:
\the
\currentchemical
}
%
595
{
\noexpand
\docommand
{
\the
\dimen
0
}
{
\the
\dimen
2
}
{
\the
\dimen
4
}
}
%
596
\egroup
}
597 598
\ifx
\normalchemicalframe
\undefined
599
\let
\normalchemicalframe
\hbox
% hook for educational purposes
600
\fi
601 602
\unexpanded
\def
\complexstartchemical
[
#
1
]
%
603
{
\copyparameters
604
[
\??chemical
]
[
\??chemical
\s!chemical
]
605
[
\c!width
,
\c!height
,
\c!left
,
\c!right
,
\c!top
,
\c!bottom
,
606
\c!bodyfont
,
\c!size
,
\c!scale
,
\c!state
,
\c!frame
,
\c!axis
,
\c!factor
,
607
\c!location
,
\c!option
,
\c!alternative
,
\c!resolution
,
\c!offset
,
\c!style
,
608
\c!color
,
\c!rulecolor
,
\c!rulethickness
]
%
609
\getparameters
610
[
\??chemical
]
611
[
#
1
]
%
612
%
613
\setupchemicalformat
[
\??chemical
]
%
614
%
615
\ifnum
\chemicaldrawingmode
=
2
616
\resetMPdrawing
617
\fi
618
%
619
\doif
{
\@@chemicalalternative
}
{
2
}
620
{
\@@setsecondchemicalplotsymbol
}
%
621
%
622
\doif
{
\@@chemicalaxis
}
\v!on
623
{
\let
\chemicalframe
\hbox
}
%
624
%
625
\!!counta
=
2
5
0
0
0
0
626
\divide
\!!counta
by
\@@localchemicalscale
627
\!!widtha
=
\@@chemicalbodyfont
628
\divide
\!!widtha
by
\!!counta
629
\@@setchemicalcoordinatesystem
{
\the
\!!widtha
}
%
630
%
631
% \!!counta = -x \!!countc = -y
632
% \!!countb = +x \!!countd = +y
633
%
634
\def
\calculateaxis
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
%
635
{
#
#
1
=
#
#
3
\relax
636
#
#
2
=
#
#
4
\relax
637
\ifnum
#
#
5
=
0
638
\ifnum
#
#
3
=
0
639
\ifnum
#
#
4
=
0
640
#
#
1
=
2
0
0
0
641
#
#
2
=
2
0
0
0
642
\fi
643
\fi
644
\else
645
\ifnum
#
#
3
=
0
646
\ifnum
#
#
4
=
0
647
#
#
1
=
#
#
5
\relax
648
\divide
#
#
1
by
2
649
#
#
2
=
#
#
1
\relax
650
\else
651
#
#
1
=
#
#
5
\relax
652
\advance
#
#
1
by
-
#
#
2
\relax
653
\fi
654
\else
655
\ifnum
#
#
4
=
0
656
#
#
2
=
#
#
5
\relax
657
\advance
#
#
2
by
-
#
#
1
\relax
658
\fi
659
\fi
660
\fi
}
%
661
\fixedchemicalfalse
662
\doif
\@@chemicalwidth
\v!fit
663
{
\edef
\@@chemicalwidth
664
{
\ifnum
\chemicaldrawingmode
=
1
2
0
0
0
\else
1
\fi
}
%
665
\fixedchemicaltrue
}
%
666
\doif
\@@chemicalheight
\v!fit
667
{
\edef
\@@chemicalheight
668
{
\ifnum
\chemicaldrawingmode
=
1
2
0
0
0
\else
1
\fi
}
%
669
\fixedchemicaltrue
}
%
670
\doifelse
\@@chemicallocation
\v!intext
671
{
\!!counta
=
0
\!!countb
=
0
672
\!!counta
=
0
\!!countd
=
0
}
673
{
\calculateaxis
674
\!!counta
\!!countb
675
\@@chemicalleft
\@@chemicalright
\@@chemicalwidth
676
\calculateaxis
677
\!!countc
\!!countd
678
\@@chemicalbottom
\@@chemicaltop
\@@chemicalheight
}
%
679
%
680
\edef
\@@chemheight
{
\the
\!!countc
}
%
681
\edef
\@@chemdepth
{
\the
\!!countd
}
%
682
\edef
\@@chemicaltop
{
\the
\!!countc
}
%
683
\edef
\@@chemicalbottom
{
\the
\!!countd
}
%
684
%
685
\doifelseinset
\v!on
{
\@@chemicalframe
,
\@@chemicalaxis
}
686
{
\def
\@@chemicalborder
{
\chemicalframe
}
}
687
{
\def
\@@chemicalborder
{
\normalchemicalframe
}
}
%
688
%
689
\setbox
0
=
\hbox
\bgroup
% this was a \vbox which took \hsize
690
%
691
\@@beginchemicalpicture
692
{
-
\the
\!!counta
}
{
\the
\!!countb
}
693
{
-
\the
\!!countc
}
{
\the
\!!countd
}
%
694
\doif
{
\@@chemicalstate
}
\v!start
695
{
\doif
\@@chemicalaxis
\v!on
696
{
\@@setchemicalaxis
697
{
-
\the
\!!counta
}
{
\the
\!!countb
}
698
{
-
\the
\!!countc
}
{
\the
\!!countd
}
}
}
%
699
\doifelse
\@@chemicaloption
\v!test
700
{
\def
\@@writechemicalstate
#
#
1
#
#
2
%
701
{
\convertargument
#
#
2
\to
\ascii
702
\writestatus
{
#
#
1
}
{
\ascii
}
}
}
703
{
\def
\@@writechemicalstate
#
#
1
#
#
2
{
}
}
%
704
\ignorespaces
}
705 706
\def
\dostartchemical
%
707
{
\catcode
`
\^
=
\superscriptcatcode
% t.b.v. \enableduplication
708
\catcode
`
\_
=
\subscriptcatcode
% t.b.v. de zekerheid
709
\begingroup
710
\inchemicaltrue
711
\def
\toptext
#
#
1
{
\gdef
\thetoptext
{
#
#
1
}
\ignorespaces
}
\toptext
{
}
%
712
\def
\bottext
#
#
1
{
\gdef
\thebottext
{
#
#
1
}
\ignorespaces
}
\bottext
{
}
%
713
\def
\midtext
#
#
1
{
\gdef
\themidtext
{
#
#
1
}
\ignorespaces
}
\midtext
{
}
%
714
\def
\@@chemicalpostponed
{
}
%
715
\complexorsimpleempty
\startchemical
}
716 717
\unexpanded
\def
\startchemical
718
{
\bgroup
% t.b.v. ungrouped floats
719
\dostartchemical
}
720 721
\unexpanded
\def
\stopchemical
722
{
\checkchemicalpicture
723
\@@endchemicalpicture
724
\egroup
725
\ifnum
\chemicaldrawingmode
=
1
726
\dimen
0
=
\@@chemicalunit
727
\setbox
0
=
\hbox
{
\lower
\@@chemdepth
\dimen
0
\box
0
}
%
728
\ht
0
=
\@@chemheight
\dimen
0
729
\dp
0
=
\@@chemdepth
\dimen
0
730
\fi
731
\dimen
0
=
\ht
0
732
\advance
\dimen
0
by
\dp
0
733
\inchemicalfalse
% enables \chemie{} in text
734
\setbox
4
=
\alignedchemical
\themidtext
735
\setbox
6
=
\alignedchemical
\thetoptext
736
\setbox
8
=
\alignedchemical
\thebottext
737
\setbox
4
=
\hbox
to
\wd
0
738
{
\strut
\hss
$
\vcenter
{
\box
4
}
$
\hss
}
%
739
\setbox
2
=
\vbox
to
\dimen
0
740
{
\hbox
to
\wd
0
{
\strut
\hss
\box
6
\hss
}
741
\vfill
742
\hbox
to
\wd
0
{
\strut
\hss
\box
8
\hss
}
743
\vss
}
% disables the depth
744
\wd
0
=
0
pt
\wd
4
=
0
pt
745
\ht
2
=
\ht
0
\dp
2
=
\dp
0
746
\ht
4
=
\ht
0
\dp
4
=
\dp
0
747
\@@chemicalborder
{
\box
0
\box
4
\box
2
}
% text on top of chemicals
748
\endgroup
749
\ignorespaces
750
\egroup
}
% t.b.v. ungrouped floats
751 752
\def
\alignedchemical
#
1
%
753
{
\vtop
754
{
\def
\par
{
\egroup
\hbox
\bgroup
\strut
}
%
755
\let
\\
=
\par
756
\let
\endgraf
=
\par
757
\hbox
\bgroup
\strut
#
1
\egroup
}
}
758 759
% \setchemicalcoordinates{#1}{#2}
760
%
761
% #1: verplaatsing in x-richting
762
% #2: verplaatsing in y-richting
763 764
\newif
\ifchemicaldirection
765 766
\def
\checkchemicaldirection
#
1
#
2
%
767
{
\ifchemicaldirection
768
\ifnum
#
1
>
0
\advance
\horchemical
-
\chemicaldirection
\fi
769
\ifnum
#
1
<
0
\advance
\horchemical
+
\chemicaldirection
\fi
770
\ifnum
#
2
>
0
\advance
\verchemical
-
\chemicaldirection
\fi
771
\ifnum
#
2
<
0
\advance
\verchemical
+
\chemicaldirection
\fi
772
\chemicaldirectionfalse
773
\fi
}
774 775
\def
\processchemicaldirection
%
776
{
\chemicaldirectiontrue
\processchemicaltranslate
}
777 778
\def
\setchemicalcoordinates
#
1
#
2
%
779
{
\advance
\horchemical
#
1
\relax
780
\advance
\verchemical
#
2
\relax
781
\checkchemicaldirection
{
#
1
}
{
#
2
}
%
782
\!!counta
=
-
\horchemical
\edef
\chemicalxoffset
{
\the
\!!counta
}
%
783
\!!countb
=
-
\verchemical
\edef
\chemicalyoffset
{
\the
\!!countb
}
%
784
\ifnum
\chemicaldrawingmode
=
1
785
% njet
786
\else
787
\setcoordinatesystem
point
at
{
\the
\horchemical
}
{
\the
\verchemical
}
788
\fi
}
789 790
\def
\resetchemicalcoordinates
791
{
\horchemical
=
0
792
\verchemical
=
0
793
\edef
\chemicalxoffset
{
0
}
%
794
\edef
\chemicalyoffset
{
0
}
%
795
\ifnum
\chemicaldrawingmode
=
1
796
% njet
797
\else
798
\setcoordinatesystem
point
at
0
0
799
\fi
}
800 801
\def
\restorechemicalcoordinates
802
{
%\writestatus{ppchtex}{restoring \the\horchemical,\the\verchemical}%
803
\edef
\chemicalxoffset
{
\the
\horchemical
}
%
804
\edef
\chemicalyoffset
{
\the
\verchemical
}
%
805
\ifnum
\chemicaldrawingmode
=
1
806
% njet
807
\else
808
\setcoordinatesystem
point
at
{
\the
\horchemical
}
{
\the
\verchemical
}
809
\fi
}
810 811
\def
\setchemicaltranslate
#
1
#
2
#
3
812
{
\setvalue
{
\s!translate
#
1
}
{
\setchemicalcoordinates
{
#
2
}
{
#
3
}
}
}
813 814
\def
\processchemicaltranslate
#
1
%
815
{
\def
\doprocess
[
#
#
1
#
#
2
]
%
816
{
\doifchemicalnumber
{
#
#
1
}
{
MOV
#
1
}
817
{
\ifnum
#
#
1
=
0
818
\def
\chemicaloffset
{
0
}
% incompatible change
819
\resetchemicalcoordinates
820
\else
821
\getvalue
{
\s!translate
#
#
1
}
%
822
\dochemicaloffset
{
#
#
1
}
%
823
\def
\chemicaloffset
{
0
}
%
824
\fi
}
}
%
825
\doprocess
[
#
1
]
}
826 827
\def
\setchemicaldistance
#
1
828
{
\setvalue
{
\s!distance
1
}
{
\setchemicalcoordinates
{
-
#
1
}
{
0
}
}
%
829
\setvalue
{
\s!distance
2
}
{
\setchemicalcoordinates
{
0
}
{
#
1
}
}
%
830
\setvalue
{
\s!distance
3
}
{
\setchemicalcoordinates
{
#
1
}
{
0
}
}
%
831
\setvalue
{
\s!distance
4
}
{
\setchemicalcoordinates
{
0
}
{
-
#
1
}
}
}
832 833
\def
\setchemicaldirection
#
1
834
{
\def
\chemicaldirection
{
#
1
}
}
835 836
\def
\processchemicaldistance
#
1
%
837
{
\def
\doprocess
[
#
#
1
#
#
2
]
%
838
{
\doifchemicalnumber
{
#
#
1
}
{
ADJ
#
1
}
839
{
\ifnum
#
#
1
=
0
840
\resetchemicalcoordinates
841
\else
842
\def
\@@chemicalpostponed
{
\getvalue
{
\s!distance
#
#
1
}
}
%
843
\@@chemicalpostponed
844
\fi
}
}
%
845
\doprocess
[
#
1
]
}
846 847
\def
\setchemicalsubstitute
#
1
848
{
\setvalue
{
\s!substitute
1
}
{
\setchemicalcoordinates
{
-
#
1
}
{
0
}
}
%
849
\setvalue
{
\s!substitute
2
}
{
\setchemicalcoordinates
{
0
}
{
#
1
}
}
%
850
\setvalue
{
\s!substitute
3
}
{
\setchemicalcoordinates
{
#
1
}
{
0
}
}
%
851
\setvalue
{
\s!substitute
4
}
{
\setchemicalcoordinates
{
0
}
{
-
#
1
}
}
}
852 853
\def
\processchemicalsubstitute
#
1
%
854
{
\def
\doprocess
[
#
#
1
#
#
2
]
%
855
{
\doifchemicalnumber
{
#
#
1
}
{
SUB
#
1
}
856
{
\ifnum
#
#
1
=
0
857
\resetchemicalcoordinates
858
\else
859
\def
\@@chemicalpostponed
{
\getvalue
{
\s!substitute
#
#
1
}
}
%
860
\@@chemicalpostponed
861
\fi
}
}
%
862
\doprocess
[
#
1
]
}
863 864
% Het is mogelijk een offset of move meerdere malen uit te
865
% voeren, door een nummer voor het commando te plaatsen.
866 867
\def
\chemicalrepeat
{
1
}
868 869
\def
\redoprocesschemical
[
#
1
#
2
]
%
870
{
\doifelseinstring
{
#
1
}
{
0
1
2
3
4
5
6
7
8
9
.
}
871
{
\edef
\chemicalrepeat
{
\chemicalrepeat
#
1
}
%
872
\redoprocesschemical
[
#
2
]
}
873
{
\processchemical
[
#
1
#
2
]
%
874
\def
\chemicalrepeat
{
1
}
}
}
875 876
\def
\doprocesschemical
[
#
1
#
2
]
#
3
%
877
{
\doifelseinstring
{
#
1
}
{
0
1
2
3
4
5
6
7
8
9
.
}
878
{
\def
\chemicalrepeat
{
#
1
}
%
879
\redoprocesschemical
[
#
2
]
}
880
{
#
3
}
}
881 882
% \dochemicaloffset{#1}
883
%
884
% #1: binding
885 886
\def
\chemicaloffset
{
0
}
887 888
\def
\processchemicaloffset
#
1
%
889
{
\dimen
0
=
6
2
5
0
0
sp
% real calc on cardinals, funny number
890
\dimen
0
=
\chemicalrepeat
\dimen
0
891
\divide
\dimen
0
by
\@@localchemicalscale
892
\!!counta
=
\dimen
0
893
\def
\doprocess
[
#
#
1
#
#
2
]
%
894
{
\doifelseinstring
{
#
#
1
}
{
1
2
8
}
895
{
\edef
\chemicaloffset
{
\the
\!!counta
}
}
896
{
\doifelseinstring
{
#
#
1
}
{
4
5
6
}
897
{
\edef
\chemicaloffset
{
-
\the
\!!counta
}
}
898
{
\doifelse
{
#
#
1
}
{
0
}
899
{
\edef
\chemicaloffset
{
0
}
}
900
{
\unknownchemical
{
OFF
#
1
}
}
}
}
}
%
901
\doprocess
[
#
1
]
}
902 903
\def
\dochemicaloffset
#
1
%
904
{
\ifnum
\chemicaloffset
=
0
905
\def
\undochemicaloffset
{
}
%
906
\else
907
\setchemicalcoordinates
{
-
\chemicaloffset
}
{
0
}
%
908
\def
\undochemicaloffset
%
909
{
\setchemicalcoordinates
{
\chemicaloffset
}
{
0
}
%
910
\def
\undochemicaloffset
{
}
}
%
911
\fi
}
912 913
\def
\processchemicalphantom
#
1
#
2
%
914
{
\setbox
0
=
\hbox
915
{
\def
\splitoff
#
#
1
?
?
?
?
{
#
#
1
}
%
916
$
\@@dochemicalstyle
{
\@@localchemicalformat
\splitoff
#
2
}
$
}
%
917
\dimen
0
=
.
2
5
\wd
0
918
\divide
\dimen
0
by
\@@localchemicalscale
919
\!!counta
=
\dimen
0
920
\doifelseinstring
{
#
1
}
{
1
2
8
}
921
{
\edef
\chemicaloffset
{
\the
\!!counta
}
}
922
{
\doifelseinstring
{
#
1
}
{
4
5
6
}
923
{
\edef
\chemicaloffset
{
-
\the
\!!counta
}
}
924
{
\doifelse
{
#
1
}
{
0
}
925
{
\edef
\chemicaloffset
{
0
}
}
926
{
\unknownchemical
{
OF
#
1
:
#
2
}
}
}
}
}
927 928
% \dosetchemicalrotation{#1}{#2}
929
%
930
% #1: cos(phi)
931
% #2: sin(phi)
932 933
\def
\chemicalrotation
{
1
}
934
\def
\chemicalangle
{
0
}
935
\def
\chemicalxoffset
{
0
}
936
\def
\chemicalyoffset
{
0
}
937 938
\def
\setchemicalmirror
#
1
%
939
{
\setvalue
{
\s!mirror
#
1
}
{
*
}
}
940 941
\def
\resetchemicalmirror
#
1
%
942
{
\resetvalue
{
\s!mirror
#
1
}
}
943 944
\def
\togglechemicalmirror
#
1
%
945
{
\doifelse
{
\getvalue
{
\s!mirror
#
1
}
}
{
*
}
946
{
\resetchemicalmirror
{
#
1
}
}
947
{
\setchemicalmirror
{
#
1
}
}
}
948 949
\def
\setchemicalrotation
#
1
#
2
#
3
#
4
#
5
#
6
#
7
#
8
#
9
950
{
\setvalue
{
\s!rotate
1
.
#
1
}
{
\dosetchemicalrotation
{
#
2
}
{
#
3
}
}
%
951
\setvalue
{
\s!rotate
2
.
#
1
}
{
\dosetchemicalrotation
{
#
4
}
{
#
5
}
}
%
952
\setvalue
{
\s!rotate
3
.
#
1
}
{
\dosetchemicalrotation
{
#
6
}
{
#
7
}
}
%
953
\setvalue
{
\s!rotate
4
.
#
1
}
{
\dosetchemicalrotation
{
#
8
}
{
#
9
}
}
}
954 955
\def
\setchemicalangle
#
1
#
2
#
3
#
4
#
5
956
{
\setvalue
{
\s!angle
1
.
#
1
}
{
\dosetchemicalangle
{
#
2
}
}
%
957
\setvalue
{
\s!angle
2
.
#
1
}
{
\dosetchemicalangle
{
#
3
}
}
%
958
\setvalue
{
\s!angle
3
.
#
1
}
{
\dosetchemicalangle
{
#
4
}
}
%
959
\setvalue
{
\s!angle
4
.
#
1
}
{
\dosetchemicalangle
{
#
5
}
}
}
960 961
\def
\chemicalrotate
[
#
1
]
%
962
{
\doifelsedefined
{
\s!mirror
#
1
}
963
{
\getvalue
{
\s!rotate
\chemicalrotation
.
#
1
\getvalue
{
\s!mirror
#
1
}
}
%
964
\getvalue
{
\s!angle
\chemicalrotation
.
#
1
\getvalue
{
\s!mirror
#
1
}
}
}
965
{
\getvalue
{
\s!rotate
\chemicalrotation
.
#
1
}
%
966
\getvalue
{
\s!angle
\chemicalrotation
.
#
1
}
}
}
967 968
\def
\dosetchemicalangle
#
1
% zwak zie onder
969
{
\def
\chemicalangle
{
#
1
}
}
970 971
\def
\dosetchemicalrotation
#
1
#
2
%
972
{
\ifnum
\chemicaldrawingmode
=
1
973
% njet
974
\else
975
\startrotation
by
{
#
1
}
{
#
2
}
%% \stoprotation (t.b.v. testen)
976
\fi
}
977 978
\def
\doresetchemicalrotation
979
{
\ifnum
\chemicaldrawingmode
=
1
980
% njet
981
\else
982
\stoprotation
983
\fi
}
984 985
\def
\processchemicalrotation
#
1
%
986
{
\def
\doprocess
[
#
#
1
#
#
2
]
%
987
{
\doifelsenumber
{
#
#
1
}
988
{
\def
\chemicalrotation
{
#
#
1
}
}
989
{
\unknownchemical
{
ROT
#
1
}
}
}
%
990
\doprocess
[
#
1
]
}
991 992
% \filtertextelement[#1][#2][#3][#4]
993
%
994
% #1: volgnummer
995
% #2: offset in uitlijningen
996
% #3: lijst met uitlijningen -> \chemicalloca
997
% #4: lijst met teksten -> \chemicaltext
998 999
\def
\setchemicallocation
#
1
%
1000
{
\doifelse
{
#
1
}
{
}
1001
{
\edef
\chemicalloca
{
c
}
}
1002
{
\edef
\chemicalloca
{
#
1
}
}
}
1003 1004
\newif
\iffixedchemicaltext
1005 1006
\def
\filterchemicaltextelement
[
#
1
]
[
#
2
]
[
#
3
]
[
#
4
]
%
1007
{
\ifchemicaltextconstant
1008
\def
\chemicaltext
{
#
4
}
%
1009
\setchemicallocation
{
}
%
1010
\else
1011
\ifnum
#
1
=
0
\relax
1012
\setchemicallocation
{
}
%
1013
\else
1014
\iffixedchemicaltext
1015
\!!counta
#
2
1016
\else
1017
\!!counta
=
\chemicalrotation
1018
\advance
\!!counta
-
1
1019
\multiply
\!!counta
#
2
1020
\advance
\!!counta
#
1
1021
\fi
1022
\getfromcommalist
[
#
3
]
[
\the
\!!counta
]
%
1023
\setchemicallocation
\commalistelement
1024
\fi
1025
\ifchemicalpicture
1026
\let
\chemicaltext
\relax
1027
\else
1028
\advance
\txtchemical
1
1029
\getfromcommalist
[
#
4
]
[
\txtchemical
]
%
1030
\let
\chemicaltext
\commalistelement
1031
\fi
1032
\fi
1033
\fixedchemicaltextfalse
}
1034 1035
% \putchemicaltext{#1}{#2}
1036
%
1037
% #1 : x-coordinaat
1038
% #2 : y-coordinaat
1039
%
1040
% \chemicaltext en \chemicalloca worden met \gettextelement
1041
% opgehaald uit de tweede set bij \chemie
1042
%
1043
% Ten behoeve van testdoeleinden wordt gebruik gemaakt van
1044
% \chemicalframe in plaats van het meer sjieke, maar tevens
1045
% meer trage \framed.
1046 1047
\ifx
\ruledhbox
\undefined
1048
\def
\chemicalframe
#
1
%
1049
{
\hbox
1050
{
\vrule
\hskip
-
.
4
pt
1051
\vbox
{
\hrule
\vskip
-
.
4
pt
\hbox
{
#
1
}
\vskip
-
.
4
pt
\hrule
}
%
1052
\hskip
-
.
4
pt
\vrule
}
}
1053
\else
1054
\def
\chemicalframe
#
1
%
1055
{
\ruledhbox
{
#
1
}
}
1056
\fi
1057 1058
\def
\doputchemicaltext
#
1
[
#
2
]
at
#
3
#
4
%
1059
{
\ifnum
\chemicaldrawingmode
=
1
1060
\rput
1061
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1062
{
\expanded
{
\rput
[
#
2
]
{
\chemicalangle
}
(
#
3
,
#
4
)
{
#
1
}
}
}
%
1063
\else
1064
\put
{
#
1
}
[
#
2
]
at
{
#
3
}
{
#
4
}
%
1065
\fi
}
1066 1067
\def
\dodoifsinglelocation
#
1
#
2
\\
#
3
%
1068
{
\ifx
#
2
\relax
#
3
\fi
}
1069 1070
\def
\doifelsesinglelocation
#
1
%
1071
{
\expandafter
\dodoifsinglelocationelse
#
1
\relax
\\
}
1072 1073
\let
\doifsinglelocationelse
\doifelsesinglelocation
1074 1075
\def
\putchemicaltext
#
1
#
2
%
1076
{
\enablechemicalspecials
1077
\ifchemicalpicture
1078
\setchemicalpicture
{
#
1
}
{
#
2
}
%
1079
\else
1080
\doifelse
\@@chemicaloption
\v!test
1081
{
\def
\@@chemicalframe
{
\chemicalframe
}
}
1082
{
\def
\@@chemicalframe
{
}
}
%
1083
\dosetsubscripts
1084
\setbox
2
=
\hbox
{
\@@dochemicalcolor
1085
$
\@@dochemicalstyle
{
\@@localchemicalformat
\chemicaltext
}
$
}
%
1086
\setbox
4
=
\hbox
{
$
\@@dochemicalstyle
{
\@@localchemicalformat
C
\normalsubscript
2
\normapsuperscript
2
}
$
}
%
1087
\setbox
6
=
\hbox
{
$
\@@dochemicalstyle
{
\@@localchemicalformat
O
}
$
}
% or C
1088
\doresetsubscripts
1089
\doifnot
\@@chemicallocation
\v!intext
1090
{
\ht
2
=
\ht
4
1091
\dp
2
=
\dp
4
}
%
1092
\setbox
2
=
\hbox
{
\@@chemicalframe
{
\box
2
}
}
%
1093
\ifdim
\wd
2
>
\wd
6
1094
\doifelse
{
#
1
}
{
0
}
1095
{
\doifnot
{
#
2
}
{
0
}
{
\wd
2
=
\wd
6
}
}
1096
{
%\doifsinglelocation\chemicalloca
1097
{
\doifinset
{
\chemicalloca
}
{
t
,
b
}
{
\wd
2
=
\wd
6
}
}
}
% common ?
1098
\fi
1099
\expanded
1100
{
\doputchemicaltext
1101
{
\noexpand
\dowithchemical
{
\copy
2
}
}
% per se \copy2 i.p.v. \box2
1102
[
\chemicalloca
]
at
{
#
1
}
{
#
2
}
}
1103
\nomoreaccounting
1104
\fi
1105
\disablechemicalspecials
}
1106 1107
\def
\setchemicaltextelement
#
1
#
2
#
3
1108
{
\setvalue
{
\s!chemicaltextelement
#
1
}
{
\putchemicaltext
{
#
2
}
{
#
3
}
}
}
1109 1110
\def
\getchemicalfixedtextelement
%
1111
{
\fixedchemicaltexttrue
1112
\getchemicaltextelement
}
1113 1114
\def
\getchemicaltextelement
[
#
1
]
[
#
2
]
[
#
3
]
[
#
4
]
[
#
5
]
%
1115
{
\filterchemicaltextelement
[
#
2
]
[
#
3
]
[
#
4
]
[
#
5
]
%
1116
\doifelse
{
#
2
}
{
0
}
1117
{
\dochemicaloffset
{
#
2
}
% % incompatible change
1118
\putchemicaltext
{
0
}
{
0
}
%
1119
\undochemicaloffset
}
% incompatible change
1120
{
\chemicalrotate
[
#
2
]
%
1121
\dochemicaloffset
{
#
2
}
%
1122
\def
\chemicaltextelementnumber
{
#
2
}
%
1123
\getvalue
{
\s!chemicaltextelement
#
1
}
%
1124
\getvalue
{
\s!chemicaltextelement
#
1
1
}
%
1125
\getvalue
{
\s!chemicaltextelement
#
1
2
}
%
1126
\getvalue
{
\s!chemicaltextelement
#
1
3
}
%
1127
\undochemicaloffset
}
}
1128 1129
\def
\processchemicaltextelement
#
1
#
2
#
3
#
4
#
5
%
1130
{
\def
\doprocess
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
1131
{
\doifelse
{
#
#
1
}
{
?
}
1132
{
\doprocess
[
1
.
.
\maxchemical
?
?
?
?
]
}
1133
{
\doifchemicalnumber
{
#
#
1
}
{
#
1
#
2
}
1134
{
\doifelse
{
#
#
2
#
#
3
}
{
.
.
}
1135
{
\doifchemicalnumber
{
#
#
4
}
{
#
1
#
2
}
1136
{
\getchemicaltextelement
[
#
1
]
[
#
#
1
]
[
#
4
]
[
#
5
]
[
#
3
]
%
1137
\doifnot
{
#
#
1
}
{
#
#
4
}
1138
{
\!!counta
=
#
#
1
\relax
1139
\advance
\!!counta
by
1
1140
\edef
\nextsegment
{
\the
\!!counta
}
%
1141
\doprocess
[
\nextsegment
.
.
#
#
4
#
#
5
]
}
}
}
1142
{
\getchemicaltextelement
[
#
1
]
[
#
#
1
]
[
#
4
]
[
#
5
]
[
#
3
]
%
1143
\doifnot
{
#
#
2
}
{
?
}
{
\doprocess
[
#
#
2
#
#
3
#
#
4
#
#
5
]
}
}
}
}
}
%
1144
\doprocess
[
#
2
]
%
1145
\smallchemicaltextfalse
}
1146 1147
\def
\processchemicalsmalltextelement
%
1148
{
\smallchemicaltexttrue
\processchemicaltextelement
}
1149 1150
\def
\processchemicalsmalltextconstant
%
1151
{
\smallchemicaltexttrue
\processchemicaltextconstant
}
1152 1153
\def
\processchemicalunrotatedtextelement
#
1
#
2
#
3
#
4
#
5
#
6
%
1154
{
\bgroup
1155
\xdef
\@@xxx
{
0
}
%
1156
\xdef
\@@yyy
{
0
}
%
1157
\def
\putchemicaltext
#
#
1
#
#
2
%
1158
{
\xdef
\@@xxx
{
#
#
1
}
%
1159
\xdef
\@@yyy
{
#
#
2
}
}
%
1160
\getvalue
{
\s!chemicaltextelement
#
1
}
%
1161
\egroup
1162
\bgroup
1163
\def
\doputchemicaltext
#
#
1
[
#
#
2
]
at
#
#
3
#
#
4
%
1164
{
\ifnum
\chemicaldrawingmode
=
1
1165
\rput
1166
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1167
{
\rput
{
\chemicalangle
}
(
\@@xxx
,
\@@yyy
)
{
\expanded
{
\rput
[
#
#
2
]
(
#
#
3
,
#
#
4
)
{
#
#
1
}
}
}
}
%
1168
\else
1169
\put
1170
{
\stoprotation
\setcoordinatesystem
point
at
0
0
1171
\expanded
{
\put
{
#
#
1
}
[
#
#
2
]
at
{
#
#
3
}
{
#
#
4
}
}
}
1172
at
{
\@@xxx
}
{
\@@yyy
}
1173
\fi
}
%
1174
\processchemicaltextelement
{
#
2
}
{
#
3
}
{
#
4
}
{
#
5
}
{
#
6
}
%
1175
\egroup
}
1176 1177
\newif
\ifchemicaltextconstant
1178 1179
\def
\processchemicaltextconstant
#
1
#
2
#
3
#
4
%
1180
{
\chemicaltextconstanttrue
1181
\let
\@@oldchemicalframe
\@@chemicalframe
1182
\let
\@@chemicalframe
\relax
1183
\processchemicaltextelement
{
#
1
}
{
#
2
}
{
#
3
}
{
#
4
}
{
}
%
1184
\let
\@@chemicalframe
\@@oldchemicalframe
1185
\chemicaltextconstantfalse
}
1186 1187
% \plotchemicalline{#1}{#2}{#3}{#4}
1188
%
1189
% #1: x-coordinaat beginpunt
1190
% #2: y-coordinaat beginpunt
1191
% #3: x-coordinaat eindpunt
1192
% #4: y-coordinaat eindpunt
1193 1194
\newconstant
\chemicallinetype
1195 1196
\def
\doplotchemicalline
1197
{
\!!counte
=
\!!countc
\advance
\!!counte
by
-
\!!counta
1198
\!!countf
=
\!!countd
\advance
\!!countf
by
-
\!!countb
1199
\bgroup
1200
\ifcase
\chemicaldrawingmode
1201
\ifcase
\chemicallinetype
1202
% 0 : normal line
1203
\plot
{
\!!counta
}
{
\!!countb
}
{
\!!countc
}
{
\!!countd
}
/
%
1204
\or
1205
% 1 : normal arrow
1206
\arrow
<
5
pt
>
[
.
2
,
.
6
7
]
from
{
\!!counta
}
{
\!!countb
}
to
{
\!!countc
}
{
\!!countd
}
1207
\or
1208
% 2 : reverse arrow
1209
\arrow
<
5
pt
>
[
.
2
,
.
6
7
]
from
{
\!!countc
}
{
\!!countd
}
to
{
\!!counta
}
{
\!!countb
}
1210
\or
1211
% 3 : unrotated line
1212
\put
{
\stoprotation
\setcoordinatesystem
point
at
0
0
1213
\plot
0
0
{
\!!counte
}
{
\!!countf
}
/
}
1214
[
\chemicallineposition
]
at
{
\!!counta
}
{
\!!countb
}
1215
\else
1216
% 4 : dashed line
1217
\findlength
{
\plot
{
\!!counta
}
{
\!!countb
}
{
\!!countc
}
{
\!!countd
}
/
}
%
1218
\setdashesnear
<
2
pt
>
for
<
\totalarclength
>
%
1219
\plot
{
\!!counta
}
{
\!!countb
}
{
\!!countc
}
{
\!!countd
}
/
%
1220
\fi
1221
\or
1222
\ifcase
\chemicallinetype
1223
\rput
1224
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1225
{
\psline
(
\!!counta
,
\!!countb
)
(
\!!countc
,
\!!countd
)
}
%
1226
\or
1227
\rput
1228
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1229
{
\psline
{
-
>
}
(
\!!counta
,
\!!countb
)
(
\!!countc
,
\!!countd
)
}
%
1230
\or
1231
\rput
1232
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1233
{
\psline
{
<
-
}
(
\!!counta
,
\!!countb
)
(
\!!countc
,
\!!countd
)
}
%
1234
\or
1235
\rput
1236
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1237
{
\expanded
{
\rput
[
\chemicallineposition
]
{
-
\chemicalangle
}
%
1238
(
\!!counta
,
\!!countb
)
{
\psline
(
0
,
0
)
(
\!!counte
,
\!!countf
)
}
}
}
%
1239
\else
1240
\psset
{
linestyle
=
dashed
}
%
1241
\rput
1242
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1243
{
\psline
(
\!!counta
,
\!!countb
)
(
\!!countc
,
\!!countd
)
}
%
1244
\fi
1245
\or
1246
\global
\MPdrawingdonetrue
1247
\setchemicalattributes
1248
\startMPdrawing
1249
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1250
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1251
x
1
:
=
\MPdivten
[
\the
\!!counta
]
u
;
1252
y
1
:
=
\MPdivten
[
\the
\!!countb
]
u
;
1253
x
2
:
=
\MPdivten
[
\the
\!!countc
]
u
;
1254
y
2
:
=
\MPdivten
[
\the
\!!countd
]
u
;
1255
x
3
:
=
\MPdivten
[
\the
\!!counte
]
u
;
1256
y
3
:
=
\MPdivten
[
\the
\!!countf
]
u
;
1257
\ifcase
\chemicallinetype
1258
% 0 : normal line
1259
draw
(
(
z
1
-
-
z
2
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1260
shifted
z
0
;
1261
\or
1262
% 1 : normal arrow
1263
drawarrow
(
(
z
1
-
-
z
2
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1264
shifted
z
0
;
1265
\or
1266
% 2 : reverse arrow
1267
drawarrow
(
(
z
2
-
-
z
1
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1268
shifted
z
0
;
1269
\or
1270
% 3 : unrotated line % nog \chemicalineposition: t/b
1271
draw
(
origin
-
-
z
3
)
1272
shifted
(
z
1
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1273
shifted
z
0
;
1274
\else
1275
% 4 : dashed line
1276
draw
(
(
z
1
-
-
z
2
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1277
shifted
z
0
dashed
dashpattern
(
on
5
.
5
u
off
6
u
)
;
1278
\fi
1279
\stopMPdrawing
1280
\fi
1281
\egroup
1282
\account
\!!counta
\!!countb
1283
\account
\!!countc
\!!countd
}
1284 1285
\def
\plotchemicalline
#
1
#
2
#
3
#
4
%
1286
{
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
1287
\doplotchemicalline
}
1288 1289
\def
\plotchemicalfactorline
#
1
#
2
#
3
#
4
%
1290
{
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
1291
\ifdim
\@@chemicalfactor
\onepoint
=
\onepoint
\else
1292
\scratchdimen
\!!counta
\s!sp
\multiply
\scratchdimen
1
0
0
0
\scratchdimen
\@@chemicalfactor
\scratchdimen
\divide
\scratchdimen
1
0
0
0
\!!counta
\scratchdimen
1293
\scratchdimen
\!!countc
\s!sp
\multiply
\scratchdimen
1
0
0
0
\scratchdimen
\@@chemicalfactor
\scratchdimen
\divide
\scratchdimen
1
0
0
0
\!!countc
\scratchdimen
1294
\fi
1295
\doplotchemicalline
}
1296 1297
\def
\plotchemicalzline
#
1
#
2
#
3
#
4
%
1298
{
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
1299
\ifnum
\chemicaldrawingmode
=
2
1300
\global
\MPdrawingdonetrue
1301
\setchemicalattributes
1302
\startMPdrawing
1303
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1304
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1305
x
1
:
=
\MPdivten
[
\the
\!!counta
]
u
;
1306
y
1
:
=
\MPdivten
[
\the
\!!countb
]
u
;
1307
x
2
:
=
\MPdivten
[
\the
\!!countc
]
u
;
1308
y
2
:
=
\MPdivten
[
\the
\!!countd
]
u
;
1309
filldraw
(
(
1310
\ifnum
\chemicalangle
>
1
8
0
1311
z
1
-
-
z
2
1312
\else
\ifnum
\chemicalangle
<
9
0
1313
z
1
-
-
(
z
2
shifted
(
-
2
u
,
+
2
u
)
)
-
-
(
z
2
shifted
(
+
2
u
,
-
2
u
)
)
1314
\else
\ifnum
\chemicalangle
=
9
0
1315
(
z
1
shifted
(
-
2
u
,
+
2
u
)
)
-
-
(
z
1
shifted
(
+
2
u
,
-
2
u
)
)
-
-
1316
(
z
2
shifted
(
+
2
u
,
+
2
u
)
)
-
-
(
z
2
shifted
(
-
2
u
,
-
2
u
)
)
1317
\else
1318
(
z
1
shifted
(
+
2
u
,
+
2
u
)
)
-
-
(
z
1
shifted
(
-
2
u
,
-
2
u
)
)
-
-
z
2
1319
\fi
\fi
\fi
1320
-
-
cycle
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
shifted
z
0
;
1321
\stopMPdrawing
1322
\else
1323
\doplotchemicalline
1324
\ifnum
\chemicalangle
>
1
8
0
\else
1325
\ifnum
\chemicalangle
=
9
0
1326
\advance
\!!counta
by
-
2
0
\advance
\!!countc
by
-
2
0
1327
\doplotchemicalline
1328
\advance
\!!counta
by
4
0
\advance
\!!countc
by
4
0
1329
\else
\ifnum
\chemicalangle
<
9
0
1330
\advance
\!!countc
by
-
2
0
\advance
\!!countd
by
+
2
0
1331
\doplotchemicalline
1332
\advance
\!!countc
by
+
4
0
\advance
\!!countd
by
-
4
0
1333
\else
1334
\advance
\!!counta
by
2
0
\advance
\!!countb
by
2
0
1335
\doplotchemicalline
1336
\advance
\!!counta
by
-
4
0
\advance
\!!countb
by
-
4
0
1337
\fi
\fi
1338
\fi
1339
\doplotchemicalline
1340
\fi
}
1341 1342
\def
\plotchemicaldeltaline
#
1
#
2
#
3
#
4
%
1343
{
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
1344
\ifnum
\chemicaldrawingmode
=
2
1345
\global
\MPdrawingdonetrue
1346
\setchemicalattributes
1347
\startMPdrawing
1348
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1349
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1350
x
1
:
=
\MPdivten
[
\the
\!!counta
]
u
;
1351
y
1
:
=
\MPdivten
[
\the
\!!countb
]
u
;
1352
x
2
:
=
\MPdivten
[
\the
\!!countc
]
u
;
1353
y
2
:
=
\MPdivten
[
\the
\!!countd
]
u
;
1354
filldraw
(
(
z
1
-
-
(
z
2
rotatedaround
(
z
1
,
5
)
)
-
-
(
z
2
rotatedaround
(
z
1
,
-
5
)
)
1355
-
-
cycle
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1356
shifted
z
0
;
1357
\stopMPdrawing
1358
\account
{
#
1
}
{
#
2
}
%
1359
\account
{
#
3
}
{
#
4
}
%
1360
\else
1361
\doplotchemicalline
1362
\advance
\!!countc
by
1
6
\advance
\!!countd
by
-
2
1
1363
\doplotchemicalline
1364
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1365
\doplotchemicalline
1366
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1367
\doplotchemicalline
1368
\advance
\!!countc
by
-
8
\advance
\!!countd
by
1
4
1369
\doplotchemicalline
1370
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1371
\doplotchemicalline
1372
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1373
\doplotchemicalline
1374
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1375
\doplotchemicalline
1376
\fi
}
1377 1378
\def
\setchemicallinesegment
#
1
#
2
#
3
#
4
#
5
1379
{
\setvalue
{
\s!chemicallinesegment
#
1
}
{
\plotchemicalline
{
#
2
}
{
#
3
}
{
#
4
}
{
#
5
}
}
}
1380 1381
\def
\setchemicalfactorlinesegment
#
1
#
2
#
3
#
4
#
5
1382
{
\setvalue
{
\s!chemicallinesegment
#
1
}
{
\plotchemicalfactorline
{
#
2
}
{
#
3
}
{
#
4
}
{
#
5
}
}
}
1383 1384
\def
\getchemicallinesegment
[
#
1
]
[
#
2
]
%
1385
{
\chemicalrotate
[
#
1
]
%
1386
\dochemicaloffset
{
#
1
}
%
1387
\getvalue
{
\s!chemicallinesegment
#
2
}
%
1388
\getvalue
{
\s!chemicallinesegment
#
2
1
}
%
1389
\getvalue
{
\s!chemicallinesegment
#
2
2
}
%
1390
\undochemicaloffset
}
1391 1392
\def
\getprivatechemicallinesegment
[
#
1
]
[
#
2
]
%
1393
{
\chemicalrotate
[
#
1
]
%
1394
\getvalue
{
\s!chemicallinesegment
#
2
#
1
}
}
1395 1396
\def
\doprocesschemicallinesegment
#
1
#
2
#
3
#
4
#
5
%
1397
{
\chemicallinetype
#
1
\relax
1398
\def
\chemicallineposition
{
#
2
}
%
1399
\def
\doprocess
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
1400
{
\doifelse
{
#
#
1
}
{
?
}
1401
{
\doprocess
[
1
.
.
\maxchemical
?
?
?
?
]
}
1402
{
\doifchemicalnumber
{
#
#
1
}
{
#
4
#
5
}
1403
{
\doifelse
{
#
#
2
#
#
3
}
{
.
.
}
1404
{
\doifchemicalnumber
{
#
#
4
}
{
#
4
#
5
}
1405
{
#
3
[
#
#
1
]
[
#
4
]
%
1406
\doifnot
{
#
#
1
}
{
#
#
4
}
1407
{
\!!counta
=
#
#
1
\relax
1408
\advance
\!!counta
by
1
1409
\edef
\nextsegment
{
\the
\!!counta
}
%
1410
\doprocess
[
\nextsegment
.
.
#
#
4
#
#
5
]
}
}
}
1411
{
#
3
[
#
#
1
]
[
#
4
]
%
1412
\doifnot
{
#
#
2
}
{
?
}
1413
{
\doprocess
[
#
#
2
#
#
3
#
#
4
#
#
5
]
}
}
}
}
}
%
1414
\doprocess
[
#
5
]
}
1415 1416
\def
\processchemicallinesegment
1417
{
\doprocesschemicallinesegment
0
c
\getchemicallinesegment
}
1418 1419
\def
\processchemicalzlinesegment
#
1
#
2
%
1420
{
%\doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
1421
\bgroup
1422
\def
\plotchemicalline
{
\plotchemicalzline
}
%
1423
\doprocesschemicallinesegment
0
c
\getchemicallinesegment
{
#
1
}
{
#
2
}
%
1424
\egroup
}
1425 1426
\def
\processchemicaldeltalinesegment
#
1
#
2
%
1427
{
%\doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
1428
\bgroup
1429
\def
\plotchemicalline
{
\plotchemicaldeltaline
}
%
1430
\doprocesschemicallinesegment
0
c
\getchemicallinesegment
{
#
1
}
{
#
2
}
%
1431
\egroup
}
1432 1433
\def
\processprivatechemicallinesegment
%
1434
{
\doprocesschemicallinesegment
0
c
\getprivatechemicallinesegment
}
1435 1436
\def
\processchemicaldownarrowsegment
%
1437
{
\doprocesschemicallinesegment
1
c
\getchemicallinesegment
}
1438 1439
\def
\processchemicaluparrowsegment
%
1440
{
\doprocesschemicallinesegment
2
c
\getchemicallinesegment
}
1441 1442
\def
\processchemicalunrotatedlinesegment
#
1
%
1443
{
\doprocesschemicallinesegment
3
{
#
1
}
\getchemicallinesegment
}
1444 1445
\def
\processchemicaldashedlinesegment
1446
{
\doprocesschemicallinesegment
4
c
\getchemicallinesegment
}
1447 1448
\def
\plotchemicaldasheddeltaline
#
1
#
2
#
3
#
4
%
1449
{
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
1450
\ifnum
\chemicaldrawingmode
=
2
1451
\global
\MPdrawingdonetrue
1452
\setchemicalattributes
1453
\startMPdrawing
1454
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1455
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1456
x
1
:
=
\MPdivten
[
\the
\!!counta
]
u
;
1457
y
1
:
=
\MPdivten
[
\the
\!!countb
]
u
;
1458
x
2
:
=
\MPdivten
[
\the
\!!countc
]
u
;
1459
y
2
:
=
\MPdivten
[
\the
\!!countd
]
u
;
1460
z
2
0
=
z
2
rotatedaround
(
z
1
,
+
5
)
;
1461
z
2
1
=
z
2
rotatedaround
(
z
1
,
-
5
)
;
1462
draw
(
z
1
rotatedaround
(
origin
,
-
\chemicalangle
)
)
shifted
z
0
;
1463
save
n
;
n
:
=
5
;
1464
for
i
=
1
upto
n
:
1465
draw
(
(
(
(
z
2
0
-
-
z
2
1
)
shifted
-
z
2
)
shifted
(
i
/
n
)
[
z
2
,
z
1
]
)
1466
rotatedaround
(
origin
,
-
\chemicalangle
)
)
shifted
z
0
;
1467
endfor
1468
\stopMPdrawing
1469
\account
{
#
1
}
{
#
2
}
%
1470
\account
{
#
3
}
{
#
4
}
%
1471
\else
1472
\doplotchemicalline
1473
\advance
\!!countc
by
1
6
\advance
\!!countd
by
-
2
1
1474
\doplotchemicalline
1475
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1476
\doplotchemicalline
1477
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1478
\doplotchemicalline
1479
\advance
\!!countc
by
-
8
\advance
\!!countd
by
1
4
1480
\doplotchemicalline
1481
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1482
\doplotchemicalline
1483
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1484
\doplotchemicalline
1485
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1486
\doplotchemicalline
1487
\fi
}
1488 1489
\def
\plotchemicalwavyline
#
1
#
2
#
3
#
4
%
1490
{
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
1491
\ifnum
\chemicaldrawingmode
=
2
1492
\global
\MPdrawingdonetrue
1493
\setchemicalattributes
1494
\startMPdrawing
1495
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1496
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1497
x
1
:
=
\MPdivten
[
\the
\!!counta
]
u
;
1498
y
1
:
=
\MPdivten
[
\the
\!!countb
]
u
;
1499
x
2
:
=
\MPdivten
[
\the
\!!countc
]
u
;
1500
y
2
:
=
\MPdivten
[
\the
\!!countd
]
u
;
1501
save
d
;
pair
d
;
1502
d
:
=
z
2
rotatedaround
(
z
1
,
+
5
)
shifted
-
z
2
;
1503
save
n
;
n
:
=
4
;
1504
draw
(
(
for
i
=
0
upto
n
-
1
:
1505
(
(
i
)
/
n
)
[
z
1
,
z
2
]
.
.
1506
(
(
i
+
.
2
5
)
/
n
)
[
z
1
,
z
2
]
shifted
d
.
.
1507
(
(
i
+
.
5
0
)
/
n
)
[
z
1
,
z
2
]
.
.
1508
(
(
i
+
.
7
5
)
/
n
)
[
z
1
,
z
2
]
shifted
-
d
.
.
1509
endfor
1510
z
2
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
shifted
z
0
;
1511
\stopMPdrawing
1512
\account
{
#
1
}
{
#
2
}
%
1513
\account
{
#
3
}
{
#
4
}
%
1514
\else
1515
\doplotchemicalline
1516
\advance
\!!countc
by
1
6
\advance
\!!countd
by
-
2
1
1517
\doplotchemicalline
1518
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1519
\doplotchemicalline
1520
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1521
\doplotchemicalline
1522
\advance
\!!countc
by
-
8
\advance
\!!countd
by
1
4
1523
\doplotchemicalline
1524
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1525
\doplotchemicalline
1526
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1527
\doplotchemicalline
1528
\advance
\!!countc
by
-
4
\advance
\!!countd
by
7
1529
\doplotchemicalline
1530
\fi
}
1531 1532
\def
\processchemicaldasheddeltalinesegment
#
1
#
2
%
1533
{
\bgroup
1534
\def
\plotchemicalline
{
\plotchemicaldasheddeltaline
}
%
1535
\doprocesschemicallinesegment
0
c
\getchemicallinesegment
{
#
1
}
{
#
2
}
%
1536
\egroup
}
1537 1538
\def
\processchemicalwavylinesegment
#
1
#
2
%
1539
{
\bgroup
1540
\def
\plotchemicalline
{
\plotchemicalwavyline
}
%
1541
\doprocesschemicallinesegment
0
c
\getchemicallinesegment
{
#
1
}
{
#
2
}
%
1542
\egroup
}
1543 1544
\def
\processchemicalopenend
#
1
#
2
%
1545
{
\doprocesschemicallinesegment
0
c
\doprocesschemicalopenend
{
#
1
}
{
#
2
}
}
1546 1547
\def
\doprocesschemicalopenend
[
#
1
]
[
#
2
]
%
1548
{
\chemicalrotate
[
#
1
]
%
1549
\dochemicaloffset
{
#
1
}
%
1550
\ifcase
\chemicaldrawingmode
1551
\beginpicture
1552
\setquadratic
\plot
1553
3
0
0
0
4
0
0
0
1554
5
0
0
0
5
5
0
7
5
1555
6
0
0
0
6
5
0
-
7
5
1556
7
0
0
0
7
5
0
7
5
1557
8
0
0
0
8
5
0
-
7
5
1558
9
0
0
0
9
5
0
0
1559
1
0
5
0
0
/
1560
\endpicture
1561
\or
1562
\rput
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1563
{
\psline
(
3
0
0
,
0
)
(
5
0
0
,
0
)
%
1564
\rput
(
5
0
0
,
0
)
{
\psplot
[
yunit
=
7
5
,
plotstyle
=
curve
]
{
0
}
{
7
2
0
}
{
x
sin
}
}
%
1565
\psline
(
9
5
0
,
0
)
(
1
0
5
0
,
0
)
}
%
1566
\or
1567
\global
\MPdrawingdonetrue
1568
\setchemicalattributes
1569
\startMPdrawing
1570
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1571
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1572
draw
1573
(
(
(
3
0
.
0
u
,
0
)
-
-
(
5
0
.
0
u
,
0
)
{
up
}
.
.
(
5
5
.
0
u
,
7
.
5
u
)
.
.
1574
(
6
0
.
0
u
,
0
)
.
.
(
6
5
.
0
u
,
-
7
.
5
u
)
.
.
(
7
0
.
0
u
,
0
)
.
.
1575
(
7
5
.
0
u
,
7
.
5
u
)
.
.
(
8
0
.
0
u
,
0
)
.
.
(
8
5
.
0
u
,
-
7
.
5
u
)
.
.
{
up
}
1576
(
9
0
.
0
u
,
0
)
-
-
(
1
0
5
.
0
u
,
0
)
)
rotatedaround
(
origin
,
-
\chemicalangle
)
)
1577
shifted
z
0
;
1578
\stopMPdrawing
1579
\fi
1580
\undochemicaloffset
}
1581 1582
% \plotchemicalcircle{#1}{#2}{#3}{#4}
1583
%
1584
% #1: lengte van de boog in graden
1585
% #2: x-coordinaat eindpunt
1586
% #3: y-coordinaat eindpunt
1587 1588
\newif
\ifchemicaldotted
1589 1590
\def
\plotchemicalcircle
#
1
#
2
#
3
#
4
#
5
#
6
%
1591
{
\bgroup
1592
\ifcase
\chemicaldrawingmode
1593
\ifchemicaldotted
1594
\findlength
{
\circulararc
{
#
4
}
degrees
from
{
#
5
}
{
#
6
}
center
at
{
0
}
{
0
}
}
%
1595
\divide
\totalarclength
by
6
1596
\def
\b
{
\the
\totalarclength
}
%
1597
\divide
\totalarclength
by
2
1598
\def
\a
{
\the
\totalarclength
}
%
1599
\setdashpattern
<
\a
,
\b
,
\b
,
\b
,
\b
,
\b
,
\a
>
1600
\fi
1601
\circulararc
{
#
4
}
degrees
from
{
#
5
}
{
#
6
}
center
at
{
0
}
{
0
}
%
1602
\or
1603
\ifchemicaldotted
1604
\psset
{
linestyle
=
dashed
}
%
1605
\fi
1606
\rput
1607
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1608
{
\psarc
(
0
,
0
)
{
#
3
}
{
#
1
}
{
#
2
}
}
%
1609
\or
1610
\global
\MPdrawingdonetrue
1611
\setchemicalattributes
1612
\startMPdrawing
1613
r
:
=
\MPdivten
[
#
3
]
*
2
u
;
1614
x
0
:
=
\MPdivten
[
\chemicalxoffset
]
u
;
1615
y
0
:
=
\MPdivten
[
\chemicalyoffset
]
u
;
1616
draw
(
(
subpath
(
#
1
/
4
5
,
#
2
/
4
5
)
of
(
fullcircle
scaled
(
r
)
)
)
1617
rotatedaround
(
origin
,
\chemicalangle
+
1
5
0
)
)
1618
shifted
z
0
\ifchemicaldotted
dashed
withdots
\fi
;
1619
\stopMPdrawing
1620
\fi
1621
\egroup
}
1622 1623
\def
\setchemicalcircsegment
#
1
#
2
#
3
#
4
#
5
#
6
#
7
1624
{
\setvalue
{
\s!chemicalcircsegment
#
1
}
{
\plotchemicalcircle
{
#
2
}
{
#
3
}
{
#
4
}
{
#
5
}
{
#
6
}
{
#
7
}
}
}
1625 1626
\def
\getchemicalcircsegment
[
#
1
]
[
#
2
]
%
1627
{
\chemicalrotate
[
#
1
]
%
1628
\getvalue
{
\s!chemicalcircsegment
#
2
}
}
1629 1630
\def
\doprocesschemicalcircsegment
#
1
#
2
%
1631
{
\def
\doprocess
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
1632
{
\doifelse
{
#
#
1
}
{
?
}
1633
{
\doprocess
[
1
.
.
\maxchemical
?
?
?
?
]
}
1634
{
\doifchemicalnumber
{
#
#
1
}
{
#
1
#
2
}
1635
{
\doifelse
{
#
#
2
#
#
3
}
{
.
.
}
1636
{
\doifchemicalnumber
{
#
#
4
}
{
#
1
#
2
}
1637
{
\getchemicalcircsegment
[
#
#
1
]
[
#
1
]
%
1638
\doifnot
{
#
#
1
}
{
#
#
4
}
1639
{
\!!counta
=
#
#
1
\relax
1640
\advance
\!!counta
by
1
1641
\edef
\nextsegment
{
\the
\!!counta
}
%
1642
\doprocess
[
\nextsegment
.
.
#
#
4
#
#
5
]
}
}
}
1643
{
\getchemicalcircsegment
[
#
#
1
]
[
#
1
]
%
1644
\doifnot
{
#
#
2
}
{
?
}
1645
{
\doprocess
[
#
#
2
#
#
3
#
#
4
#
#
5
]
}
}
}
}
}
%
1646
\doprocess
[
#
2
]
}
1647 1648
\def
\processchemicalcircsegment
%
1649
{
\chemicaldottedfalse
\doprocesschemicalcircsegment
}
1650 1651
\def
\processchemicaldottsegment
%
1652
{
\chemicaldottedtrue
\doprocesschemicalcircsegment
}
1653 1654
\let
\endchemicalpicture
=
\relax
1655
\let
\checkchemicalpicture
=
\relax
1656
\let
\nomoreaccounting
=
\relax
1657 1658
\newif
\ifchemicalpicture
1659 1660
\def
\beginchemicalpicture
#
1
% NO PSTRICKS SUPPORT YET
1661
{
\checkchemicalpicture
1662
\bgroup
% DOES NOT HANDLE AUTOWIDTH/HEIGHT
1663
\chemicalpicturetrue
1664
\processchemical
[
#
1
]
}
1665 1666
\def
\setchemicalpicture
#
1
#
2
%
1667
{
\chemicalpicturefalse
1668
\def
\endchemicalpicture
%
1669
{
\@@endchemicallocalpicture
{
#
1
}
{
#
2
}
%
1670
\egroup
1671
\ifnum
\chemicaldrawingmode
=
1
1672
\rput
1673
{
-
\chemicalangle
}
(
\chemicalxoffset
,
\chemicalyoffset
)
%
1674
{
\expanded
{
\rput
[
\chemicalloca
]
{
\chemicalangle
}
(
#
1
,
#
2
)
{
\box
\nextbox
}
}
}
%
1675
\else
1676
\expanded
{
\put
{
\box
\nextbox
}
[
\chemicalloca
]
at
{
#
1
}
{
#
2
}
}
1677
\fi
1678
\egroup
}
%
1679
\def
\checkchemicalpicture
%
1680
{
\ifx
\endchemicalpicture
\relax
\else
1681
\writestatus
{
ppchtex
}
{
missing
end
of
picture
(
PE
)
}
%
1682
\endchemicalpicture
1683
\fi
}
%
1684
\setbox
\nextbox
=
\hbox
\bgroup
1685
\@@beginchemicallocalpicture
1686
% alternatief: gewoon accounting, en zelf l,r afhandelen
1687
\ifnum
\chemicaldrawingmode
=
1
1688
% njet
1689
\else
1690
\accountingon
1691
\let
\nomoreaccounting
=
\accountingoff
1692
\fi
}
1693 1694
\def
\doskipchemical
[
#
1
]
[
#
2
]
%
1695
{
{
\tt
[
ppchtex
]
}
}
1696 1697
\def
\skipchemical
%
1698
{
\dodoubleargument
\doskipchemical
}
1699 1700
\def
\complexchemical
% met \expandafter
1701
{
\ifinchemical
1702
\expandafter
\dochemical
1703
\else
1704
\writestatus
{
ppchtex
}
{
the
[
]
[
]
-
alternative
is
not
permitted
here
}
%
1705
\expandafter
\skipchemical
1706
\fi
}
1707 1708
\newif
\ifinnerchemical
1709 1710
\def
\dosimplechemical
#
1
#
2
#
3
%
1711
{
\doifelsedefined
{
\??chemical
\c!location
}
1712
{
\writestatus
{
ppchtex
}
{
the
{
}
{
}
-
alternative
is
not
permitted
here
}
}
1713
{
\ifinnerchemical
1714
\let
\chemicalsign
=
\chemicalinnersign
1715
\let
\chemicalmolecule
=
\chemicalinnermolecule
1716
\let
\chemicalsinglearrow
=
\chemicalsingleinnerarrow
1717
\let
\chemicaldoublearrow
=
\chemicaldoubleinnerarrow
1718
\let
\chemicaltwintiparrow
=
\chemicaltwintipinnerarrow
1719
\else
1720
\let
\chemicalsign
=
\chemicaloutersign
1721
\let
\chemicalmolecule
=
\chemicaloutermolecule
1722
\let
\chemicalsinglearrow
=
\chemicalsingleouterarrow
1723
\let
\chemicaldoublearrow
=
\chemicaldoubleouterarrow
1724
\let
\chemicaltwintiparrow
=
\chemicaltwintipouterarrow
1725
\fi
1726
\disablechemicalspecials
1727
\processallactionsinset
1728
[
#
1
]
1729
[
HIGH
=
>
\sethighsubscripts
,
1730
LOW
=
>
\setlowsubscripts
,
1731
PLUS
=
>
\chemicalsign
{
+
}
,
1732
GIVES
=
>
\chemicalsinglearrow
{
#
2
}
{
#
3
}
,
1733
EQUILIBRIUM
=
>
\chemicaldoublearrow
{
#
2
}
{
#
3
}
,
1734
MESOMERIC
=
>
\chemicaltwintiparrow
{
#
2
}
{
#
3
}
,
1735
SINGLE
=
>
\singlechemicalbond
,
1736
DOUBLE
=
>
\doublechemicalbond
,
1737
TRIPLE
=
>
\triplechemicalbond
,
1738
+
=
>
\chemicalsign
{
+
}
,
1739
-
>
=
>
\chemicalsinglearrow
{
#
2
}
{
#
3
}
,
1740
<
-
>
=
>
\chemicaldoublearrow
{
#
2
}
{
#
3
}
,
1741
<
>
=
>
\chemicaltwintiparrow
{
#
2
}
{
#
3
}
,
1742
-
=
>
\singlechemicalbond
,
1743
-
-
=
>
\doublechemicalbond
,
1744
-
-
-
=
>
\triplechemicalbond
,
1745
\s!unknown
=
>
\enablechemicalspecials
1746
\chemicalmolecule
{
\commalistelement
}
{
#
2
}
{
#
3
}
]
}
}
1747 1748
\def
\dosimplechemicalA
#
1
#
2
#
3
% % evt: {#1,\relax}
1749
{
\let
\chemicalspace
=
\relax
1750
\expandafter
\dosimplechemical
\expandafter
{
\@@chemicalchemicaloffset
,
#
1
}
{
#
2
}
{
#
3
}
%
1751
\egroup
}
1752 1753
\def
\dosimplechemicalB
#
1
#
2
#
3
%
1754
{
\dosimplechemical
{
#
1
}
{
#
2
}
{
#
3
}
%
1755
\egroup
}
1756 1757
\def
\dosimplechemicalC
#
1
#
2
#
3
%
1758
{
$
\simplechemical
{
#
1
}
{
#
2
}
{
#
3
}
$
%
1759
\egroup
}
% erbij
1760 1761
\def
\simplechemical
1762
{
\ifinner
1763
\innerchemicaltrue
1764
\else
1765
\innerchemicalfalse
1766
\fi
1767
\bgroup
1768
\catcode
`
\^
=
\superscriptcatcode
% t.b.v. \enableduplication
1769
\catcode
`
\_
=
\subscriptcatcode
% t.b.v. de zekerheid
1770
\ifmmode
1771
\ifinnerchemical
1772
\def
\next
{
\dotriplegroupempty
\dosimplechemicalA
}
%
1773
\else
1774
\def
\next
{
\dotriplegroupempty
\dosimplechemicalB
}
%
1775
\fi
1776
\else
1777
\def
\next
{
\dotriplegroupempty
\dosimplechemicalC
}
%
1778
\fi
1779
\next
}
1780 1781
\definecomplexorsimple
\chemical
1782 1783
\def
\dogotochemical
#
1
#
2
%
1784
{
\def
\dowithchemical
% % experiment
1785
{
\localgotochemical
{
#
1
}
}
% % experiment
1786
\chemical
}
% experiment
1787 1788
\def
\gotochemical
% % experiment
1789
{
\dosingleargument
\dogotochemical
}
% experiment
1790 1791
\def
\dododochemical
#
1
[
#
2
]
[
#
3
]
% % experiment
1792
{
\def
\simpledododochemical
% % experiment
1793
{
#
1
[
#
2
]
[
#
3
]
}
% % experiment
1794
\def
\complexdododochemical
[
#
#
1
]
% % experiment
1795
{
\def
\dowithchemical
% % experiment
1796
{
\localthisischemical
{
#
2
}
}
% % experiment
1797
#
1
[
#
3
]
[
#
#
1
]
}
% % experiment
1798
\complexorsimple
\dododochemical
}
% experiment
1799 1800
\def
\dodochemical
[
#
1
]
[
#
2
]
%
1801
{
\ignorespaces
1802
\ifinchemical
1803
\drawchemical
[
#
1
]
[
#
2
]
%
1804
\ignorespaces
1805
\else
1806
\startchemical
[
\c!location
=
\v!intext
]
%
1807
\drawchemical
[
#
1
]
[
#
2
]
%
1808
\expandafter
\stopchemical
1809
\fi
1810
\ignorespaces
}
1811 1812
\def
\dochemical
[
#
1
]
%
1813
{
\def
\simpledochemical
%
1814
{
\@@writechemicalstate
{
ppchtex
}
{
[
#
1
]
[
]
}
%
1815
\dodochemical
[
#
1
]
[
]
}
%
1816
%
1817
\def
\complexdochemical
[
#
#
1
]
%
1818
{
\@@writechemicalstate
{
ppchtex
}
{
[
#
1
]
[
#
#
1
]
}
%
1819
\txtchemical
=
0
%
1820
\dodochemical
[
#
1
]
[
#
#
1
]
}
%
1821
%
1822
\def
\complexdochemical
[
#
#
1
]
% % experiment
1823
{
\@@writechemicalstate
{
ppchtex
}
{
[
#
1
]
[
#
#
1
]
}
% % experiment
1824
\txtchemical
=
0
% % experiment
1825
\dododochemical
\dodochemical
[
#
1
]
[
#
#
1
]
}
% % experiment
1826
%
1827
\complexorsimple
\dochemical
}
1828 1829
% \processlocalchemicals{#1}
1830
%
1831
% #1: commando's
1832 1833
\def
\dodoprocesschemical
#
1
%
1834
{
\processchemical
[
#
1
?
?
?
?
]
}
1835 1836
\def
\processlocalchemicals
#
1
%
1837
{
\processcommalist
[
#
1
]
\dodoprocesschemical
}
1838 1839
% \drawchemical[#1][#2]
1840
%
1841
% #1: bindingen enz.
1842
% #2: atomen enz.
1843 1844
\def
\localdodochemical
[
#
1
]
[
#
2
]
%
1845
{
\@@writechemicalstate
{
ppchtex
}
{
[
#
1
]
[
#
2
]
}
%
1846
%\bgroup % koppelen en afmetingen gaat fout, vandaar:
1847
\advance
\levchemical
1
1848
\letvalue
{
\??chemical
\s!unknown
\the
\levchemical
}
\unknownchemical
1849
\setevalue
{
\??chemical
\c!text
\the
\levchemical
}
{
\the
\txtchemical
}
%
1850
\txtchemical
=
0
1851
\dodochemical
[
#
1
]
[
#
2
]
%
1852
% \expandafter\txtchemical\expandafter\csname\??chemical\c!text\the\levchemical\endcsname
1853
\txtchemical
\csname
\??chemical
\c!text
\the
\levchemical
\endcsname
1854
\expandafter
\let
\expandafter
\unknownchemical
\csname
\??chemical
\s!unknown
\the
\levchemical
\endcsname
1855
\advance
\levchemical
-
1
1856
%\egroup
1857
\ignorespaces
}
1858 1859
\def
\drawchemical
[
#
1
]
[
#
2
]
%
1860
{
\ignorespaces
1861
\def
\dodochemical
[
#
#
1
]
[
#
#
2
]
%
1862
{
\drawchemical
[
#
#
1
]
[
#
#
2
]
%
1863
\ignorespaces
}
%
1864
\def
\dochemical
[
#
#
1
]
%
1865
{
\def
\simpledochemical
%
1866
{
\@@writechemicalstate
{
ppchtex
}
{
[
#
#
1
]
[
#
2
]
}
%
1867
\dodochemical
[
#
#
1
]
[
#
2
]
%
1868
\ignorespaces
}
%
1869
\def
\complexdochemical
[
#
#
#
#
1
]
%
1870
{
\dododochemical
\localdodochemical
[
#
#
1
]
[
#
#
#
#
1
,
#
2
]
}
%
1871
\complexorsimple
\dochemical
}
%
1872
\doif
\@@chemicalstate
\v!start
1873
{
\doifelse
\chemicalname
\s!unknown
1874
{
\getvalue
{
\s!executechemical
\defaultchemical
}
[
#
2
]
}
1875
{
\getvalue
{
\s!executechemical
\chemicalname
}
[
#
2
]
}
%
1876
\def
\unknownchemical
#
#
1
%
1877
{
\processunknownchemical
[
#
#
1
]
[
#
2
]
}
%
1878
\processcommalist
[
\@@chemicaloffset
,
#
1
]
\dodoprocesschemical
}
%
1879
\ignorespaces
}
1880 1881
\unexpanded
\def
\chemicaloxidation
#
1
#
2
#
3
%
1882
{
\chemicaltop
1883
{
\ifnum
#
2
0
=
0
1884
0
%
1885
\else
1886
#
1
\expandafter
\uppercase
\expandafter
{
\romannumeral
#
2
}
%
1887
\fi
}
1888
{
#
3
}
}
1889 1890
\def
\chemicaltfraction
{
\ifinchemical
.
6
0
\else
.
8
\fi
}
1891
\def
\chemicalbfraction
{
\ifinchemical
.
4
5
\else
.
6
\fi
}
1892
\def
\chemicallfraction
{
\ifinchemical
.
1
\else
.
1
\fi
}
1893
\def
\chemicalrfraction
{
\ifinchemical
.
1
\else
.
1
\fi
}
1894 1895
\def
\chemicaltighttext
1896
{
\def
\chemicaltfraction
{
\ifinchemical
.
3
\else
.
6
\fi
}
%
1897
\def
\chemicalbfraction
{
\ifinchemical
.
2
\else
.
4
\fi
}
%
1898
\def
\chemicallfraction
{
\ifinchemical
0
\else
0
\fi
}
%
1899
\def
\chemicalrfraction
{
\ifinchemical
0
\else
0
\fi
}
}
1900 1901
\def
\dochemicaltop
#
1
#
2
#
3
#
4
%
1902
{
\vbox
1903
{
\@@dochemicalcolor
1904
\baselineskip
=
\chemicaltfraction
\baselineskip
\lineskip
0
pt
1905
\halign
1906
{
#
1
#
#
#
2
\cr
1907
$
\@@dochemicalstyle
{
\scriptscriptstyle
#
3
}
$
\cr
1908
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
4
}
$
\cr
}
}
}
1909 1910
\def
\dochemicalbottom
#
1
#
2
#
3
#
4
%
1911
{
\vtop
1912
{
\@@dochemicalcolor
1913
\baselineskip
=
\chemicalbfraction
\baselineskip
\lineskip
0
pt
1914
\halign
1915
{
#
1
#
#
#
2
\cr
1916
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
4
}
$
\cr
1917
$
\@@dochemicalstyle
{
\scriptscriptstyle
#
3
}
$
\cr
}
}
}
1918 1919
\def
\chemicalleft
#
1
#
2
%
1920
{
\hbox
1921
{
\@@dochemicalcolor
1922
$
\@@dochemicalstyle
{
\scriptscriptstyle
#
1
}
$
%
1923
$
\@@dochemicalstyle
{
\@@currentchemicalformat
\hskip
\chemicallfraction
em
#
2
}
$
}
}
1924 1925
\def
\chemicalright
#
1
#
2
%
1926
{
\hbox
1927
{
\@@dochemicalcolor
1928
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
2
\hskip
\chemicalrfraction
em
}
$
%
1929
$
\@@dochemicalstyle
{
\scriptscriptstyle
#
1
}
$
}
}
1930 1931
\def
\chemicalcentered
#
1
%
1932
{
\setbox
0
=
\hbox
{
$
\@@dochemicalstyle
{
\scriptscriptstyle
#
1
}
$
}
%
1933
\setbox
2
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
C
}
$
}
%
1934
\dimen
0
=
.
5
\ht
2
1935
\advance
\dimen
0
by
-
.
5
\ht
0
1936
\advance
\dimen
0
by
\dp
0
1937
\hbox
{
\@@dochemicalcolor
\raise
\dimen
0
\box
0
}
}
1938 1939
\def
\chemicalleftcentered
#
1
#
2
%
1940
{
\hbox
1941
{
\@@dochemicalcolor
1942
\chemicalcentered
{
#
1
}
%
1943
$
\@@dochemicalstyle
{
\@@currentchemicalformat
\hskip
\chemicallfraction
em
#
2
}
$
}
}
1944 1945
\def
\chemicalrightcentered
#
1
#
2
%
1946
{
\hbox
1947
{
\@@dochemicalcolor
1948
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
2
\hskip
\chemicalrfraction
em
}
$
%
1949
\chemicalcentered
{
#
1
}
}
}
1950 1951
\def
\chemicaltop
{
\dochemicaltop
\hss
\hss
}
1952
\def
\chemicallefttop
{
\dochemicaltop
\relax
\hss
}
1953
\def
\chemicalrighttop
{
\dochemicaltop
\hss
\relax
}
1954
\def
\chemicalbottom
{
\dochemicalbottom
\hss
\hss
}
1955
\def
\chemicalleftbottom
{
\dochemicalbottom
\relax
\hss
}
1956
\def
\chemicalrightbottom
{
\dochemicalbottom
\hss
\relax
}
1957 1958
\def
\chemicaltopleft
#
1
{
\chemicalleft
{
\chemicallefttop
{
#
1
}
{
}
}
}
1959
\def
\chemicalbottomleft
#
1
{
\chemicalleft
{
\chemicalleftbottom
{
#
1
}
{
}
}
}
1960
\def
\chemicaltopright
#
1
{
\chemicalright
{
\chemicallefttop
{
#
1
}
{
}
}
}
1961
\def
\chemicalbottomright
#
1
{
\chemicalright
{
\chemicalleftbottom
{
#
1
}
{
}
}
}
1962 1963
\def
\chemicalsmashedleft
#
1
%
1964
{
\hbox
\bgroup
1965
\@@dochemicalcolor
1966
\setbox
0
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
C
}
$
}
%
1967
\setbox
2
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
1
}
$
}
%
1968
\wd
2
=
\wd
0
1969
\box
2
1970
\egroup
}
1971 1972
\def
\chemicalsmashedmiddle
#
1
%
1973
{
\hbox
\bgroup
1974
\@@dochemicalcolor
1975
\setbox
0
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
C
}
$
}
%
1976
\setbox
2
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
1
}
$
}
%
1977
\hbox
{
\hskip
-
.
5
\wd
2
\hskip
.
5
\wd
0
\box
2
}
1978
\egroup
}
1979 1980
\def
\chemicalsmashedright
#
1
%
1981
{
\hbox
\bgroup
1982
\@@dochemicalcolor
1983
\setbox
0
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
C
}
$
}
%
1984
\setbox
2
=
\hbox
{
$
\@@dochemicalstyle
{
\@@currentchemicalformat
#
1
}
$
}
%
1985
\hbox
to
\wd
0
{
\hskip
-
\wd
2
\hskip
\wd
0
\box
2
}
%
1986
\egroup
}
1987 1988
\def
\+
{
\tabalign
}
% is \long in Plain
1989 1990
\def
\chemicalforever
#
1
#
2
%
1991
{
\bgroup
1992
\setbox
0
=
\hbox
1993
{
\@@dochemicalcolor
1994
$
\@@dochemicalstyle
{
\scriptscriptstyle
\hskip
-
.
1
5
em
#
2
}
$
}
%
1995
\wd
0
=
0
pt
1996
\big
#
1
\normapsubscript
{
\hskip
.
1
em
\box
0
}
%
1997
\egroup
}
1998 1999
\def
\disablechemicalspecials
%
2000
{
\def
\+
#
#
1
{
#
#
1
}
\def
\-
#
#
1
{
#
#
1
}
%
2001
\def
\[
{
[
}
\def
\]
{
]
}
%
2002
\def
\1
{
}
\def
\2
{
}
\def
\3
{
}
\def
\4
{
}
\def
\5
{
}
\def
\6
{
}
\def
\7
{
}
%
2003
\def
\X
{
}
%
2004
\def
\T
{
}
\def
\B
{
}
\def
\L
{
}
\def
\R
{
}
\def
\LC
{
}
\def
\RC
{
}
%
2005
\def
\TL
{
}
\def
\BL
{
}
\def
\TR
{
}
\def
\BR
{
}
%
2006
\def
\LT
{
}
\def
\LB
{
}
\def
\RT
{
}
\def
\RB
{
}
%
2007
\def
\SL
{
}
\def
\SM
{
}
\def
\SR
{
}
}
2008 2009
\def
\enablechemicalspecials
%
2010
{
\def
\+
{
\dodoublegroupempty
\chemicaloxidation
{
+
}
}
% {} needed!
2011
\def
\-
{
\dodoublegroupempty
\chemicaloxidation
{
-
}
}
% {} needed!
2012
\def
\[
{
\dodoublegroupempty
\chemicalforever
{
[
}
}
% {} needed!
2013
\def
\]
{
\dodoublegroupempty
\chemicalforever
{
]
}
}
% {} needed!
2014
\def
\1
{
\chemicaloxidation
\relax
1
}
%
2015
\def
\2
{
\chemicaloxidation
\relax
2
}
%
2016
\def
\3
{
\chemicaloxidation
\relax
3
}
%
2017
\def
\4
{
\chemicaloxidation
\relax
4
}
%
2018
\def
\5
{
\chemicaloxidation
\relax
5
}
%
2019
\def
\6
{
\chemicaloxidation
\relax
6
}
%
2020
\def
\7
{
\chemicaloxidation
\relax
7
}
%
2021
\def
\X
{
\chemicaltighttext
}
%
2022
\def
\T
{
\chemicaltop
}
%
2023
\def
\B
{
\chemicalbottom
}
%
2024
\def
\L
{
\chemicalleft
}
%
2025
\def
\LC
{
\chemicalleftcentered
}
%
2026
\def
\R
{
\chemicalright
}
%
2027
\def
\RC
{
\chemicalrightcentered
}
%
2028
\def
\TL
{
\chemicaltopleft
}
%
2029
\def
\BL
{
\chemicalbottomleft
}
%
2030
\def
\TR
{
\chemicaltopright
}
%
2031
\def
\BR
{
\chemicalbottomright
}
%
2032
\def
\LT
{
\chemicallefttop
}
%
2033
\def
\LB
{
\chemicalleftbottom
}
%
2034
\def
\RT
{
\chemicalrighttop
}
%
2035
\def
\RB
{
\chemicalrightbottom
}
%
2036
\def
\SL
{
\chemicalsmashedleft
}
%
2037
\def
\SM
{
\chemicalsmashedmiddle
}
%
2038
\def
\SR
{
\chemicalsmashedright
}
}
2039 2040
% \reversechemical#1#2#3
2041
%
2042
% #1: prefix
2043
% #2: volgnummer enz
2044
% #3: tegengestelde volgnummers
2045 2046
\def
\reversechemical
#
1
#
2
#
3
%
2047
{
\def
\doprocess
[
#
#
1
#
#
2
]
%
2048
{
\doifchemicalnumber
{
#
#
1
}
{
#
1
#
2
}
%
2049
{
\getfromcommalist
[
#
3
]
[
#
#
1
]
%
2050
\let
\reversechemicalaction
=
\commalistelement
2051
\processchemical
[
#
1
\reversechemicalaction
#
#
2
]
}
}
%
2052
\doprocess
[
#
2
]
}
2053 2054
% \processunknownchemical[#1????][#2]
2055
%
2056
% #1: bindingen enz.
2057
% #2: atomen enz.
2058 2059
\def
\defaultchemical
%
2060
{
SIX
}
2061 2062
\def
\processunknownchemical
[
#
1
?
?
?
?
]
[
#
2
]
%
2063
{
\processaction
2064
[
#
1
]
2065
[
SAVE
=
>
\executechemicalSAVE
,
2066
RESTORE
=
>
\executechemicalRESTORE
,
2067
HIGH
=
>
\sethighsubscripts
,
2068
LOW
=
>
\setlowsubscripts
,
2069
\s!default
=
>
,
2070
\s!unknown
=
>
\doifelsedefined
{
\s!executechemical
#
1
}
2071
{
\def
\chemicalrotation
{
1
}
%
2072
\def
\chemicaloffset
{
0
}
%
2073
\doifdefined
{
\s!executechemical
#
1
}
2074
{
\getvalue
{
\s!executechemical
#
1
}
[
#
2
]
}
%
2075
\@@chemicalpostponed
}
2076
{
\getpredefinedchemical
{
#
1
}
}
]
}
2077 2078
\newcount
\chemicalstack
2079 2080
\setvalue
{
\s!chemical
\c!x
1
}
{
0
}
2081
\setvalue
{
\s!chemical
\c!y
1
}
{
0
}
2082 2083
\def
\executechemicalSAVE
2084
{
%\writestatus{ppchtex}{saving \the\horchemical,\the\verchemical}%
2085
\advance
\chemicalstack
by
1
2086
\letvalue
{
\s!chemical
n
\the
\chemicalstack
}
=
\chemicalname
2087
%\letvalue {\s!chemical p\the\chemicalstack}=\@@chemicalpostponed
2088
\setevalue
{
\s!chemical
x
\the
\chemicalstack
}
{
\the
\horchemical
}
%
2089
\setevalue
{
\s!chemical
y
\the
\chemicalstack
}
{
\the
\verchemical
}
}
2090 2091
\def
\restorechemicalvalues
#
1
%
2092
{
\let
\oldprocesschemical
=
\processchemical
2093
\doifdefined
{
\s!executechemical
#
1
}
{
\getvalue
{
\s!executechemical
#
1
}
[
]
}
%
2094
\let
\processchemical
=
\oldprocesschemical
}
2095 2096
\def
\executechemicalRESTORE
2097
{
\ifnum
\chemicalstack
=
0
\relax
2098
\horchemical
=
\getvalue
{
\s!chemical
x
1
}
\relax
2099
\verchemical
=
\getvalue
{
\s!chemical
y
1
}
\relax
2100
\else
2101
\restorechemicalvalues
{
\getvalue
{
\s!chemical
n
\the
\chemicalstack
}
}
%
2102
%\expandafter\let\expandafter\@@chemicalpostponed\expandafter=\csname\s!chemical p\the\chemicalstack\endcsname
2103
\let
\@@chemicalpostponed
=
\relax
2104
\horchemical
=
\getvalue
{
\s!chemical
x
\the
\chemicalstack
}
\relax
2105
\verchemical
=
\getvalue
{
\s!chemical
y
\the
\chemicalstack
}
\relax
2106
\advance
\chemicalstack
by
-
1
2107
\fi
2108
\restorechemicalcoordinates
}
2109 2110
% De onderstaande macro's zijn verantwoordelijk voor het zetten
2111
% van de + en pijlen. De +, en dus ook de pijlen, worden omhoog
2112
% gehaald. Dit oogt m.i. fraaier.
2113 2114
\def
\chemicalinnerclip
#
1
%
2115
{
{
\setbox
0
=
\hbox
{
#
1
}
\ht
0
\ht
\strutbox
\dp
0
\dp
\strutbox
\box
0
}
}
2116 2117
\def
\chemicalraise
#
1
#
2
%
2118
{
\chemicalinnerclip
2119
{
\setbox
0
=
\hbox
{
$
#
1
+
$
}
%
2120
\raise
\dp
0
\hbox
{
$
#
1
#
2
$
}
}
}
2121 2122
\def
\chemicalinnersign
#
1
% todo: \@@chemicaltextcolor
2123
{
\chemicalraise
{
\@@localchemicalstyle
}
{
#
1
}
}
2124 2125
\def
\chemicaloutersign
#
1
%
2126
{
\chemicalraise
{
}
{
\@@dochemicalcolor
#
1
}
}
2127 2128
\def
\chemicalsingleinnerarrow
#
1
#
2
%
2129
{
\chemicalraise
{
\@@localchemicalstyle
}
{
\longrightarrow
}
}
2130 2131
\def
\chemicaldoubleinnerarrow
#
1
#
2
% todo: \@@chemicaltextcolor
2132
{
\chemicalinnerclip
2133
{
\lower
.
2
ex
\hbox
2134
{
\setbox
0
=
\hbox
{
$
\@@localchemicalstyle
\longrightarrow
$
}
%
2135
\setbox
2
=
\hbox
{
$
\@@localchemicalstyle
\longleftarrow
$
}
%
2136
\wd
0
=
0
pt
\raise
\ht
0
\box
0
\box
2
}
}
}
2137 2138
\def
\chemicaltwintipinnerarrow
#
1
#
2
% todo: \@@chemicaltextcolor
2139
{
\chemicalinnerclip
2140
{
\setbox
0
=
\hbox
{
\chemicalraise
{
\@@localchemicalstyle
}
{
\longrightarrow
}
}
%
2141
\setbox
2
=
\hbox
{
\chemicalraise
{
\@@localchemicalstyle
}
{
\longleftarrow
}
}
%
2142
\wd
0
=
0
pt
\box
0
\box
2
}
}
2143 2144
\def
\dochemicalouterarrow
#
1
#
2
#
3
%
2145
{
\bgroup
2146
\setbox
0
=
\hbox
{
$
\longrightarrow
$
}
%
2147
\setbox
2
=
\hbox
{
$
\@@dochemicalstyle
{
\scriptstyle
\quad
#
2
\quad
}
$
}
%
2148
\setbox
4
=
\hbox
{
$
\@@dochemicalstyle
{
\scriptstyle
\quad
#
3
\quad
}
$
}
%
2149
\dimen
2
=
\wd
0
% \dimen0 is used elsewhere
2150
\ifdim
\wd
2
>
\dimen
2
\dimen
0
=
\wd
2
\fi
2151
\ifdim
\wd
4
>
\dimen
2
\dimen
0
=
\wd
4
\fi
2152
\chemicaloutermolecule
2153
{
#
1
}
2154
{
\ifdim
\ht
2
>
\zeropoint
\box
2
\fi
}
% expands to \empty in test
2155
{
\ifdim
\ht
4
>
\zeropoint
\box
4
\fi
}
% % expands to \empty in test
2156
\egroup
}
2157 2158
\def
\chemicalsingleouterarrow
2159
{
\dochemicalouterarrow
2160
{
\hbox
to
\dimen
2
{
\rightarrowfill
}
}
}
2161 2162
\def
\chemicaldoubleouterarrow
2163
{
\dochemicalouterarrow
2164
{
\lower
.
5
\ht
0
\vbox
2165
{
\offinterlineskip
2166
\hbox
to
\dimen
2
{
\rightarrowfill
}
2167
\hbox
to
\dimen
2
{
\leftarrowfill
}
}
}
}
2168 2169
\def
\chemicaltwintipouterarrow
2170
{
\dochemicalouterarrow
2171
{
\hbox
2172
{
\hbox
to
\dimen
2
{
\rightarrowfill
}
%
2173
\hskip
-
\dimen
2
2174
\hbox
to
\dimen
2
{
\leftarrowfill
}
}
}
}
2175 2176
\def
\chemicalinnermolecule
#
1
#
2
#
3
% no mathop here, can generate space
2177
{
\chemicalspace
% todo: \@@chemicaltextcolor
2178
\chemicalinnerclip
2179
{
\dosetsubscripts
2180
$
\@@dochemicalstyle
{
\@@localchemicalstyle
\strut
#
1
}
$
%
2181
\doresetsubscripts
}
%
2182
\chemicalspace
}
2183 2184
\def
\chemicaloutermolecule
#
1
#
2
#
3
%
2185
{
\chemicalspace
2186
\bgroup
2187
\@@dochemicalcolor
2188
\setbox
0
=
\hbox
% else the font is reset
2189
{
\dosetsubscripts
2190
\hbox
{
$
\@@dochemicalstyle
{
\strut
#
1
}
$
}
%
2191
\doresetsubscripts
}
%
2192
\mathop
{
\box
0
}
%
2193
\ifthirdargument
2194
\doifnot
{
#
2
}
{
}
{
\normapsuperscript
{
\@@dochemicalstyle
{
\strut
#
2
}
}
}
%
2195
\doifnot
{
#
3
}
{
}
{
\normapsubscript
{
\@@dochemicalstyle
{
\strut
#
3
}
}
}
%
2196
\else
2197
\doifnot
{
#
2
}
{
}
2198
{
\normapsubscript
{
\@@dochemicalstyle
{
\strut
#
2
}
}
}
%
2199
\fi
2200
\egroup
2201
\chemicalspace
}
2202 2203
\def
\chemicalsinglepicturearrow
#
1
%
2204
{
\lower
.
5
ex
\hbox
2205
{
\@@dochemicalstyle
2206
$
\chemicalspace
2207
\buildrel
2208
\@@dochemicalstyle
{
\scriptstyle
\quad
#
1
\quad
}
%
2209
\over
{
\overrightarrow
2210
{
\hphantom
{
\@chemicalstyle
{
\scriptstyle
\quad
#
1
\quad
}
}
}
}
%
2211
\chemicalspace
$
}
}
2212 2213
\def
\chemicaldoublepicturearrow
#
1
%
2214
{
\lower
.
5
ex
\hbox
2215
{
\@@dochemicalstyle
2216
$
\chemicalspace
2217
\buildrel
2218
\@@dochemicalstyle
{
\scriptstyle
\quad
#
1
\quad
}
%
2219
\over
{
\overrightarrow
{
\overleftarrow
2220
{
\hphantom
{
\@@dochemicalstyle
{
\scriptstyle
\quad
#
1
\quad
}
}
}
}
}
%
2221
\chemicalspace
$
}
}
2222 2223
% Bij de in-line bindingen wordt gebruik gemaakt van
2224
% een \hrule. De maatvoering wordt bepaald door een
2225
% kunstmatige em (\wd0).
2226 2227
\def
\somechemicalbond
%
2228
{
\hrule
width
\wd
0
height
.
4
pt
}
2229 2230
\def
\dochemicalbonds
#
1
#
2
#
3
% todo: \@@chemicaltextstyle
2231
{
{
\setbox
0
=
\hbox
2232
{
$
{
\@@localchemicalstyle
M
}
$
}
%
2233
\vbox
to
\ht
0
2234
{
\@@dochemicalcolor
2235
\hsize
\wd
0
2236
\vskip
.
1
\wd
0
#
1
\vfill
#
2
\vfill
#
3
\vskip
.
1
\wd
0
}
}
}
2237 2238
\def
\singlechemicalbond
%
2239
{
\dochemicalbonds
{
}
{
\somechemicalbond
}
{
}
}
2240 2241
\def
\doublechemicalbond
%
2242
{
\dochemicalbonds
{
\somechemicalbond
}
{
}
{
\somechemicalbond
}
}
2243 2244
\def
\triplechemicalbond
%
2245
{
\dochemicalbonds
{
\somechemicalbond
}
{
\somechemicalbond
}
{
\somechemicalbond
}
}
2246 2247
% In plaats van \def\naam{\chemie[...]...} kan beter gebruik
2248
% worden gemaakt van het commando
2249
%
2250
% \definieerchemie[naam]{commando's}
2251
%
2252
% De naam krijgt, om problemen met bestaande macro's te
2253
% voorkomen, een prefix. Bij het ophalen van een commando
2254
% worden beide definities afgehandeld.
2255 2256
\def
\dodefinechemical
[
#
1
]
#
2
%
2257
{
\doifdefined
{
\??chemical
#
1
}
2258
{
\writestatus
{
ppchtex
}
{
chemical
definition
#
1
is
redefined
}
}
%
2259
\setvalue
{
\??chemical
#
1
}
{
#
2
}
}
2260 2261
\unexpanded
\def
\definechemical
%
2262
{
\dosingleargument
\dodefinechemical
}
2263 2264
\def
\getpredefinedchemical
#
1
%
2265
{
\doifelsedefined
{
\??chemical
#
1
}
2266
{
\getvalue
{
\??chemical
#
1
}
}
2267
{
\doifelsedefined
{
#
1
}
2268
{
\getvalue
{
#
1
}
}
2269
{
\writestatus
{
ppchtex
}
{
unknown
chemical
definition
#
1
}
}
}
}
2270 2271
% Hieronder zijn de definities van de structuren opgenomen. De
2272
% naam van de structuur is als volgt opgebouwd:
2273
%
2274
% \executechemicalNUMBER[#1]
2275
%
2276
% waarbij [#1] betrekking heeft op de tekstelementen van \chemie,
2277
% de [tweede lijst] dus.
2278
%
2279
% De aan \chemie[#1][#2] meegegeven lijst van segmenten wordt
2280
% deels door de in \execute gedefinieerde macro's afgehandeld,
2281
% deels door algemene macro's. Segmenten hebben de vorm:
2282
%
2283
% [+|-|]identifier[X|XYZ|X..Y]
2284
%
2285
% Voorbeelden van segmenten zijn:
2286
%
2287
% R1
2288
% R1..4
2289
% R135
2290
% -R1
2291
% +R35
2292 2293
\setchemicalmaximum
0
2294 2295
\def
\processchemical
[
#
1
]
%
2296
{
\unknownchemical
{
#
1
}
}
2297 2298
\def
\setchemicalname
#
1
%
2299
{
\def
\chemicalname
{
#
1
}
}
2300 2301
\let
\chemicalname
=
\s!unknown
2302 2303
% Vooruitlopend op een gedetailleerde documentatie, zijn hier
2304
% vast enkele gebruikte afmetingen:
2305
%
2306
% lengte radikalen : 500
2307
% afstand radikalen : 100
2308
% afstand dubbele radikalen : 260
2309
% afstand substituenten : +125
2310 2311 2312 2313 2314
\def
\executechemicalONE
[
#
1
]
%
2315
{
\setchemicalname
ONE
2316
%
2317
\setchemicalmaximum
8
2318
\setchemicaldistance
0
2319
\setchemicalsubstitute
6
2
5
2320
\setchemicaldirection
3
0
3
2321
%
2322
\setchemicalrotation
1
1
0
1
0
1
0
1
0
2323
\setchemicalrotation
2
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
2324
\setchemicalrotation
3
0
-
1
0
-
1
0
-
1
0
-
1
2325
\setchemicalrotation
4
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
2326
\setchemicalrotation
5
-
1
0
-
1
0
-
1
0
-
1
0
2327
\setchemicalrotation
6
-
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
2328
\setchemicalrotation
7
0
1
0
1
0
1
0
1
2329
\setchemicalrotation
8
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
2330
%
2331
\setchemicalangle
1
0
9
0
1
8
0
2
7
0
2332
\setchemicalangle
2
4
5
1
3
5
2
2
5
3
1
5
2333
\setchemicalangle
3
9
0
1
8
0
2
7
0
0
2334
\setchemicalangle
4
1
3
5
2
2
5
3
1
5
4
5
2335
\setchemicalangle
5
1
8
0
2
7
0
0
9
0
2336
\setchemicalangle
6
2
2
5
3
1
5
4
5
1
3
5
2337
\setchemicalangle
7
2
7
0
0
9
0
1
8
0
2338
\setchemicalangle
8
3
1
5
4
5
1
3
5
2
2
5
2339
%
2340
\setchemicaltranslate
1
-
1
0
0
0
0
2341
\setchemicaltranslate
2
-
1
0
0
0
1
0
0
0
2342
\setchemicaltranslate
3
0
1
0
0
0
2343
\setchemicaltranslate
4
1
0
0
0
1
0
0
0
2344
\setchemicaltranslate
5
1
0
0
0
0
2345
\setchemicaltranslate
6
1
0
0
0
-
1
0
0
0
2346
\setchemicaltranslate
7
0
-
1
0
0
0
2347
\setchemicaltranslate
8
-
1
0
0
0
-
1
0
0
0
2348
%
2349
\setchemicallinesegment
SB
3
0
0
0
7
0
0
0
2350
\setchemicallinesegment
DB
1
3
0
0
5
0
7
0
0
5
0
2351
\setchemicallinesegment
DB
2
3
0
0
-
5
0
7
0
0
-
5
0
2352
%
2353
%setchemicallinesegment EP 200 125 200 -125
2354
\setchemicalfactorlinesegment
EP
2
0
0
1
2
5
2
0
0
-
1
2
5
2355
%
2356
\setchemicaltextelement
ES
2
0
0
0
2357
\setchemicaltextelement
ED
1
2
0
0
5
0
2358
\setchemicaltextelement
ED
2
2
0
0
-
5
0
2359
\setchemicaltextelement
ET
1
2
0
0
7
5
2360
\setchemicaltextelement
ET
2
2
0
0
0
2361
\setchemicaltextelement
ET
3
2
0
0
-
7
5
2362
\setchemicaltextelement
HB
1
3
0
0
0
2363
\setchemicaltextelement
HB
2
4
7
5
0
2364
\setchemicaltextelement
HB
3
6
5
0
0
2365
%
2366
\setchemicaltextelement
Z
8
0
0
0
2367
\setchemicaltextelement
RZ
9
5
0
0
2368
\setchemicaltextelement
ZN
5
0
0
0
2369
\setchemicaltextelement
ZTN
5
0
0
1
5
0
2370
\setchemicaltextelement
ZBN
5
0
0
-
1
5
0
2371
%
2372
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
2373
{
\doprocesschemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
2374
{
\processaction
2375
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
2376
[
PB
:
#
#
4
#
#
5
=
>
\beginchemicalpicture
{
#
#
4
#
#
5
}
,
2377
PE
?
?
?
?
=
>
\endchemicalpicture
,
2378
SUB
#
#
4
#
#
5
=
>
\processchemicalsubstitute
{
#
#
4
#
#
5
}
,
2379
ADJ
#
#
4
#
#
5
=
>
\processchemicaldistance
{
#
#
4
#
#
5
}
,
2380
MOV
#
#
4
#
#
5
=
>
\processchemicaltranslate
{
#
#
4
#
#
5
}
,
2381
DIR
#
#
4
#
#
5
=
>
\processchemicaldirection
{
#
#
4
#
#
5
}
,
2382
OFF
#
#
4
#
#
5
=
>
\processchemicaloffset
{
#
#
4
#
#
5
}
,
2383
CCD
#
#
4
#
#
5
=
>
\processchemicaldottsegment
{
CC
}
{
#
#
4
#
#
5
}
,
2384
LDD
#
#
4
#
#
5
=
>
\processchemicaldashedlinesegment
{
DB
1
}
{
#
#
4
#
#
5
}
%
2385
\processchemicallinesegment
{
DB
2
}
{
#
#
4
#
#
5
}
,
2386
RDD
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
DB
1
}
{
#
#
4
#
#
5
}
%
2387
\processchemicaldashedlinesegment
{
DB
2
}
{
#
#
4
#
#
5
}
,
2388
OF
#
#
3
:
#
#
5
=
>
\processchemicalphantom
{
#
#
3
}
{
#
#
5
}
,
2389
OE
#
#
3
#
#
4
#
#
5
=
>
\processchemicalopenend
{
OE
}
{
#
#
3
#
#
4
#
#
5
}
,
2390
EP
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
EP
}
{
#
#
3
#
#
4
#
#
5
}
,
2391
ES
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
ES
}
{
#
#
3
#
#
4
#
#
5
}
{
\hbox
{
$
\cdot
$
}
}
{
0
}
,
2392
ED
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
ED
}
{
#
#
3
#
#
4
#
#
5
}
{
\hbox
{
$
\cdot
$
}
}
{
0
}
,
2393
ET
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
ET
}
{
#
#
3
#
#
4
#
#
5
}
{
\hbox
{
$
\cdot
$
}
}
{
0
}
,
2394
HB
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
HB
}
{
#
#
3
#
#
4
#
#
5
}
{
\hbox
{
$
\cdot
$
}
}
{
0
}
,
2395
SB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2396
DB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
DB
}
{
#
#
3
#
#
4
#
#
5
}
,
2397
SB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2398
BB
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldeltalinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2399
BD
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldasheddeltalinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2400
BW
#
#
3
#
#
4
#
#
5
=
>
\processchemicalwavylinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2401
SD
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldashedlinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2402
TB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
%
2403
\processchemicallinesegment
{
DB
}
{
#
#
3
#
#
4
#
#
5
}
,
2404
CZ
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
RZ
}
{
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2405
ZTN
#
#
4
#
#
5
=
>
\processchemicalsmalltextconstant
{
ZTN
}
{
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2406
ZTT
#
#
4
#
#
5
=
>
\processchemicalsmalltextelement
{
ZTN
}
{
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2407
ZBN
#
#
4
#
#
5
=
>
\processchemicalsmalltextconstant
{
ZBN
}
{
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2408
ZBT
#
#
4
#
#
5
=
>
\processchemicalsmalltextelement
{
ZBN
}
{
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2409
ZN
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
ZN
}
{
#
#
3
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2410
ZT
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
ZN
}
{
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2411
Z
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
2412
{
l
,
l
,
t
,
r
,
r
,
r
,
b
,
l
}
,
2413
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
}
]
}
}
}
2414 2415
\def
\executechemicalTHREE
[
#
1
]
%
2416
{
\setchemicalname
THREE
2417
%
2418
\setchemicalmaximum
3
2419
\setchemicaldistance
2
8
9
2420
\setchemicalsubstitute
9
5
2
2421
%
2422
\setchemicalrotation
1
1
0
0
-
1
-
1
0
0
1
2423
\setchemicalrotation
2
-
0
.
5
-
0
.
8
6
6
-
0
.
8
6
6
0
.
5
0
.
5
0
.
8
6
6
0
.
8
6
6
-
0
.
5
2424
\setchemicalrotation
3
-
0
.
5
0
.
8
6
6
0
.
8
6
6
0
.
5
0
.
5
-
0
.
8
6
6
-
0
.
8
6
6
-
0
.
5
2425
%
2426
\setchemicalangle
1
0
9
0
1
8
0
2
7
0
2427
\setchemicalangle
2
1
2
0
2
1
0
3
0
0
3
0
2428
\setchemicalangle
3
2
4
0
3
3
0
6
0
1
5
0
2429
%
2430
\setchemicaltranslate
1
-
1
0
0
0
0
2431
\setchemicaltranslate
2
0
1
0
0
0
2432
\setchemicaltranslate
3
1
0
0
0
0
2433
\setchemicaltranslate
4
0
-
1
0
0
0
2434
%
2435
\setchemicallinesegment
B
5
7
7
0
-
2
8
9
-
5
0
0
2436
\setchemicallinesegment
SB
3
5
2
-
1
3
0
-
6
4
-
3
7
0
2437
\setchemicallinesegment
-
SB
3
5
2
-
1
3
0
-
2
8
9
-
5
0
0
2438
\setchemicallinesegment
+
SB
5
7
7
0
-
6
4
-
3
7
0
2439
\setchemicallinesegment
DB
1
3
2
7
-
8
7
-
8
9
-
3
2
7
2440
\setchemicallinesegment
DB
2
3
7
7
-
1
7
2
-
3
9
-
4
1
3
2441
\setchemicallinesegment
R
5
7
7
0
1
0
7
7
0
2442
\setchemicallinesegment
-
R
5
7
7
0
1
0
1
0
2
5
0
2443
\setchemicallinesegment
+
R
5
7
7
0
1
0
1
0
-
2
5
0
2444
\setchemicallinesegment
ER
1
5
7
7
5
0
1
0
7
7
5
0
2445
\setchemicallinesegment
ER
2
5
7
7
-
5
0
1
0
7
7
-
5
0
2446
\setchemicallinesegment
SR
8
3
7
0
1
0
7
7
0
2447
\setchemicallinesegment
-
SR
8
0
2
1
3
0
1
0
1
0
2
5
0
2448
\setchemicallinesegment
+
SR
8
0
2
-
1
3
0
1
0
1
0
-
2
5
0
2449
\setchemicallinesegment
DR
1
8
3
7
5
0
1
0
7
7
5
0
2450
\setchemicallinesegment
DR
2
8
3
7
-
5
0
1
0
7
7
-
5
0
2451
%
2452
\setchemicaltextelement
Z
5
7
7
0
2453
\setchemicaltextelement
RZ
1
1
7
7
0
2454
\setchemicaltextelement
-
RZ
1
0
9
7
3
0
0
2455
\setchemicaltextelement
+
RZ
1
0
9
7
-
3
0
0
2456
\setchemicaltextelement
CRZ
1
0
7
7
0
2457
%
2458
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
]
%
2459
{
\processaction
2460
[
#
#
1
#
#
2
#
#
3
#
#
4
]
2461
[
ROT
#
#
4
=
>
\processchemicalrotation
{
#
#
4
}
,
2462
MOV
#
#
4
=
>
\processchemicaltranslate
{
#
#
4
}
,
2463
SUB
#
#
4
=
>
\processchemicalsubstitute
{
#
#
4
}
,
2464
ADJ
#
#
4
=
>
\processchemicaldistance
{
#
#
4
}
,
2465
-
RZ
#
#
4
=
>
\processchemicaltextelement
{
-
RZ
}
{
#
#
4
}
{
#
1
}
{
3
}
2466
{
l
,
t
,
r
,
l
,
r
,
l
,
r
,
b
,
l
,
r
,
l
,
r
}
,
2467
+
RZ
#
#
4
=
>
\processchemicaltextelement
{
+
RZ
}
{
#
#
4
}
{
#
1
}
{
3
}
2468
{
l
,
r
,
b
,
r
,
r
,
l
,
r
,
l
,
t
,
l
,
l
,
r
}
,
2469
-
SB
#
#
4
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
}
,
2470
+
SB
#
#
4
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
}
,
2471
-
SR
#
#
4
=
>
\processchemicallinesegment
{
-
SR
}
{
#
#
4
}
,
2472
+
SR
#
#
4
=
>
\processchemicallinesegment
{
+
SR
}
{
#
#
4
}
,
2473
CRZ
#
#
4
=
>
\processchemicaltextelement
{
CRZ
}
{
#
#
4
}
{
#
1
}
{
0
}
2474
{
}
,
2475
DB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
DB
}
{
#
#
3
#
#
4
}
,
2476
DR
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
DR
}
{
#
#
3
#
#
4
}
,
2477
RZ
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
RZ
}
{
#
#
3
#
#
4
}
{
#
1
}
{
3
}
2478
{
l
,
r
,
r
,
t
,
r
,
l
,
r
,
l
,
l
,
b
,
l
,
r
}
,
2479
ER
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
ER
}
{
#
#
3
#
#
4
}
,
2480
SB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
}
,
2481
SR
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SR
}
{
#
#
3
#
#
4
}
,
2482
-
R
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
-
R
}
{
#
#
3
#
#
4
}
,
2483
+
R
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
+
R
}
{
#
#
3
#
#
4
}
,
2484
B
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
}
,
2485
R
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
R
}
{
#
#
2
#
#
3
#
#
4
}
,
2486
Z
#
#
2
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2487
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
}
]
}
}
2488 2489
\def
\executechemicalFOUR
[
#
1
]
%
2490
{
\setchemicalname
FOUR
2491
%
2492
\setchemicalmaximum
4
2493
\setchemicaldistance
5
0
0
2494
\setchemicalsubstitute
0
2495
%
2496
\setchemicalrotation
1
1
0
0
-
1
-
1
0
0
1
2497
\setchemicalrotation
2
0
-
1
-
1
0
0
1
1
0
2498
\setchemicalrotation
3
-
1
0
0
1
1
0
0
-
1
2499
\setchemicalrotation
4
0
1
1
0
0
-
1
-
1
0
2500
%
2501
\setchemicalangle
1
0
9
0
1
8
0
2
7
0
2502
\setchemicalangle
2
9
0
1
8
0
2
7
0
0
2503
\setchemicalangle
3
1
8
0
2
7
0
0
9
0
2504
\setchemicalangle
4
2
7
0
0
9
0
1
8
0
2505
%
2506
\setchemicaltranslate
1
-
1
0
0
0
0
2507
\setchemicaltranslate
2
0
1
0
0
0
2508
\setchemicaltranslate
3
1
0
0
0
0
2509
\setchemicaltranslate
4
0
-
1
0
0
0
2510
%
2511
\setchemicallinesegment
B
5
0
0
5
0
0
5
0
0
-
5
0
0
2512
\setchemicallinesegment
SB
5
0
0
2
4
0
5
0
0
-
2
4
0
2513
\setchemicallinesegment
-
SB
5
0
0
2
4
0
5
0
0
-
5
0
0
2514
\setchemicallinesegment
+
SB
5
0
0
5
0
0
5
0
0
-
2
4
0
2515
\setchemicallinesegment
DB
1
4
5
0
2
4
0
4
5
0
-
2
4
0
2516
\setchemicallinesegment
DB
2
5
5
0
2
4
0
5
5
0
-
2
4
0
2517
\setchemicallinesegment
EB
3
6
0
3
0
0
3
6
0
-
3
0
0
2518
\setchemicallinesegment
R
5
0
0
5
0
0
8
5
4
8
5
4
2519
\setchemicallinesegment
-
R
5
0
0
5
0
0
5
0
0
1
0
0
0
2520
\setchemicallinesegment
+
R
5
0
0
5
0
0
1
0
0
0
5
0
0
2521
\setchemicallinesegment
ER
1
4
6
5
5
3
5
8
1
9
8
8
9
2522
\setchemicallinesegment
ER
2
5
3
5
4
6
5
8
8
9
8
1
9
2523
\setchemicallinesegment
SR
6
8
4
6
8
4
8
5
4
8
5
4
2524
\setchemicallinesegment
-
SR
5
0
0
7
6
0
5
0
0
1
0
0
0
2525
\setchemicallinesegment
+
SR
7
6
0
5
0
0
1
0
0
0
5
0
0
2526
\setchemicallinesegment
DR
1
6
4
9
7
1
9
8
1
9
8
8
9
2527
\setchemicallinesegment
DR
2
7
1
9
6
4
9
8
8
9
8
1
9
2528
%
2529
\setchemicaltextelement
Z
5
0
0
5
0
0
2530
\setchemicaltextelement
RZ
9
2
5
9
2
5
2531
\setchemicaltextelement
-
RZ
5
0
0
1
1
0
0
2532
\setchemicaltextelement
+
RZ
1
1
0
0
5
0
0
2533
\setchemicaltextelement
CRZ
1
0
3
8
1
0
3
8
2534
%
2535
\setchemicaltextelement
ZN
3
5
0
3
5
0
2536
%
2537
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
]
%
2538
{
\processaction
2539
[
#
#
1
#
#
2
#
#
3
#
#
4
]
2540
[
PB
:
#
#
4
=
>
\beginchemicalpicture
{
#
#
4
}
,
2541
PE
?
?
?
?
=
>
\endchemicalpicture
,
2542
ROT
#
#
4
=
>
\processchemicalrotation
{
#
#
4
}
,
2543
SUB
#
#
4
=
>
\processchemicalsubstitute
{
#
#
4
}
,
2544
ADJ
#
#
4
=
>
\processchemicaldistance
{
#
#
4
}
,
2545
MOV
#
#
4
=
>
\processchemicaltranslate
{
#
#
4
}
,
2546
-
RZ
#
#
4
=
>
\processchemicaltextelement
{
-
RZ
}
{
#
#
4
}
{
#
1
}
{
4
}
2547
{
b
,
l
,
t
,
r
,
l
,
t
,
r
,
b
,
t
,
r
,
b
,
l
,
r
,
b
,
l
,
t
}
,
2548
+
RZ
#
#
4
=
>
\processchemicaltextelement
{
+
RZ
}
{
#
#
4
}
{
#
1
}
{
4
}
2549
{
l
,
t
,
r
,
b
,
t
,
r
,
b
,
l
,
r
,
b
,
l
,
t
,
b
,
l
,
t
,
r
}
,
2550
-
SB
#
#
4
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
}
,
2551
+
SB
#
#
4
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
}
,
2552
-
SR
#
#
4
=
>
\processchemicallinesegment
{
-
SR
}
{
#
#
4
}
,
2553
+
SR
#
#
4
=
>
\processchemicallinesegment
{
+
SR
}
{
#
#
4
}
,
2554
CRZ
#
#
4
=
>
\processchemicaltextelement
{
CRZ
}
{
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2555
ZN
#
#
3
#
#
4
=
>
\processchemicaltextconstant
{
ZN
}
{
#
#
3
#
#
4
}
{
\chemicaltextelementnumber
}
{
0
}
,
2556
ZT
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
ZN
}
{
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2557
DB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
DB
}
{
#
#
3
#
#
4
}
,
2558
DR
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
DR
}
{
#
#
3
#
#
4
}
,
2559
EB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
EB
}
{
#
#
3
#
#
4
}
,
2560
ER
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
ER
}
{
#
#
3
#
#
4
}
,
2561
RZ
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
RZ
}
{
#
#
3
#
#
4
}
{
#
1
}
{
4
}
2562
{
lb
,
lt
,
rt
,
rb
,
lt
,
rt
,
rb
,
lb
,
rt
,
rb
,
lb
,
lt
,
rb
,
lb
,
lt
,
rt
}
,
2563
SB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
}
,
2564
SR
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SR
}
{
#
#
3
#
#
4
}
,
2565
-
R
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
-
R
}
{
#
#
3
#
#
4
}
,
2566
+
R
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
+
R
}
{
#
#
3
#
#
4
}
,
2567
B
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
}
,
2568
R
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
R
}
{
#
#
2
#
#
3
#
#
4
}
,
2569
Z
#
#
2
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2570
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
}
]
}
}
2571 2572
\def
\executechemicalFIVE
[
#
1
]
%
2573
{
\setchemicalname
FIVE
2574
%
2575
\setchemicalmaximum
5
2576
\setchemicaldistance
6
8
8
2577
\setchemicalsubstitute
1
2
2
6
2578
%
2579
\setchemicalrotation
1
1
0
0
-
1
-
1
0
0
1
2580
\setchemicalrotation
2
0
.
3
0
9
-
0
.
9
5
1
-
0
.
9
5
1
-
0
.
3
0
9
-
0
.
3
0
9
0
.
9
4
0
0
.
9
5
1
0
.
3
0
9
2581
\setchemicalrotation
3
-
0
.
8
0
9
-
0
.
5
8
8
-
0
.
5
8
8
0
.
8
0
9
0
.
8
0
9
0
.
5
8
8
0
.
5
8
8
-
0
.
8
0
9
2582
\setchemicalrotation
4
-
0
.
8
0
9
0
.
5
8
8
0
.
5
8
8
0
.
8
0
9
0
.
8
0
9
-
0
.
5
8
8
-
0
.
5
8
8
-
0
.
8
0
9
2583
\setchemicalrotation
5
0
.
3
0
9
0
.
9
5
1
0
.
9
5
1
-
0
.
3
0
9
-
0
.
3
0
9
-
0
.
9
5
1
-
0
.
9
5
1
0
.
3
0
9
2584
%
2585
\setchemicalangle
1
0
9
0
1
8
0
2
7
0
2586
\setchemicalangle
2
7
2
1
6
2
2
5
2
3
4
2
2587
\setchemicalangle
3
1
4
4
2
3
4
3
2
4
5
4
2588
\setchemicalangle
4
2
1
6
3
0
6
3
6
1
2
6
2589
\setchemicalangle
5
2
8
8
1
8
1
0
8
1
9
8
2590
%
2591
\setchemicaltranslate
1
-
1
3
7
6
0
2592
\setchemicaltranslate
2
-
4
2
5
1
3
0
4
2593
\setchemicaltranslate
3
1
1
1
3
8
0
9
2594
\setchemicaltranslate
4
1
1
1
3
-
8
0
9
2595
\setchemicaltranslate
5
-
4
2
5
-
1
3
0
4
2596
%
2597
\setchemicallinesegment
A
1
1
8
8
5
0
0
1
1
8
8
-
5
0
0
2598
\setchemicallinesegment
B
6
8
8
5
0
0
6
8
8
-
5
0
0
2599
\setchemicallinesegment
S
-
2
6
3
8
0
8
6
8
8
-
5
0
0
2600
\setchemicallinesegment
SS
-
1
1
6
6
0
6
5
4
1
-
2
9
8
2601
\setchemicallinesegment
-
SS
-
2
6
3
8
0
8
5
4
1
-
2
9
8
2602
\setchemicallinesegment
+
SS
-
1
1
6
6
0
6
6
8
8
-
5
0
0
2603
\setchemicallinesegment
SB
6
8
8
2
4
0
6
8
8
-
2
4
0
2604
\setchemicallinesegment
-
SB
6
8
8
2
4
0
6
8
8
-
5
0
0
2605
\setchemicallinesegment
+
SB
6
8
8
5
0
0
6
8
8
-
2
4
0
2606
\setchemicallinesegment
DB
1
6
3
8
2
4
0
6
3
8
-
2
4
0
2607
\setchemicallinesegment
DB
2
7
3
8
2
4
0
7
3
8
-
2
4
0
2608
\setchemicallinesegment
EB
5
4
8
3
4
0
5
4
8
-
3
4
0
2609
\setchemicallinesegment
R
6
8
8
5
0
0
1
0
9
3
7
9
4
2610
\setchemicallinesegment
-
R
6
8
8
5
0
0
6
8
8
1
0
0
0
2611
\setchemicallinesegment
+
R
6
8
8
5
0
0
1
1
6
3
3
4
5
2612
\setchemicallinesegment
ER
1
6
5
9
5
4
0
1
0
6
4
8
3
4
2613
\setchemicallinesegment
ER
2
7
2
7
4
6
0
1
1
2
2
7
5
4
2614
\setchemicallinesegment
SR
8
9
8
6
5
3
1
0
9
3
7
9
4
2615
\setchemicallinesegment
-
SR
6
8
8
7
6
0
6
8
8
1
0
0
0
2616
\setchemicallinesegment
+
SR
9
3
5
4
2
0
1
1
6
3
3
4
5
2617
\setchemicallinesegment
DR
1
8
6
9
6
9
3
1
0
6
4
8
3
4
2618
\setchemicallinesegment
DR
2
9
2
7
6
1
3
1
1
2
2
7
5
4
2619
%
2620
\setchemicaltextelement
Z
6
8
8
5
0
0
2621
\setchemicaltextelement
RZ
1
1
8
8
8
6
3
2622
\setchemicaltextelement
-
RZ
6
8
8
1
1
0
0
2623
\setchemicaltextelement
+
RZ
1
2
5
8
3
1
5
2624
\setchemicaltextelement
CRZ
1
3
2
3
9
4
7
2625
%
2626
\setchemicalcircsegment
C
-
3
6
3
6
5
9
0
7
2
4
7
5
-
3
4
5
2627
\setchemicalcircsegment
CC
-
7
2
0
5
9
0
7
2
1
8
2
-
5
6
1
2628
%
2629
\setchemicaltextelement
ZN
4
6
8
3
5
0
2630
\setchemicaltextelement
RN
8
6
0
6
2
5
% 1.25 Z
2631
\setchemicaltextelement
RTN
7
8
5
7
2
8
% .12 / 103 75
2632
\setchemicaltextelement
RBN
9
3
5
5
2
2
2633
%
2634
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
]
%
2635
{
\processaction
2636
[
#
#
1
#
#
2
#
#
3
#
#
4
]
2637
[
FRONT
?
?
?
?
=
>
{
\executechemicalFIVEFRONT
[
#
1
]
}
,
2638
PB
:
#
#
4
=
>
\beginchemicalpicture
{
#
#
4
}
,
2639
PE
?
?
?
?
=
>
\endchemicalpicture
,
2640
ROT
#
#
4
=
>
\processchemicalrotation
{
#
#
4
}
,
2641
SUB
#
#
4
=
>
\processchemicalsubstitute
{
#
#
4
}
,
2642
ADJ
#
#
4
=
>
\processchemicaldistance
{
#
#
4
}
,
2643
MOV
#
#
4
=
>
\processchemicaltranslate
{
#
#
4
}
,
2644
-
RZ
#
#
4
=
>
\processchemicaltextelement
{
-
RZ
}
{
#
#
4
}
{
#
1
}
{
5
}
2645
{
b
,
l
,
t
,
r
,
r
,
l
,
t
,
r
,
r
,
l
,
t
,
r
,
r
,
l
,
l
,
r
,
b
,
l
,
t
,
r
}
,
2646
+
RZ
#
#
4
=
>
\processchemicaltextelement
{
+
RZ
}
{
#
#
4
}
{
#
1
}
{
5
}
2647
{
l
,
t
,
r
,
r
,
b
,
t
,
r
,
r
,
l
,
l
,
r
,
r
,
l
,
l
,
r
,
b
,
l
,
l
,
r
,
r
}
,
2648
-
SB
#
#
4
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
}
,
2649
+
SB
#
#
4
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
}
,
2650
-
SR
#
#
4
=
>
\processchemicallinesegment
{
-
SR
}
{
#
#
4
}
,
2651
+
SR
#
#
4
=
>
\processchemicallinesegment
{
+
SR
}
{
#
#
4
}
,
2652
-
RD
#
#
4
=
>
\processchemicaldashedlinesegment
{
-
R
}
{
#
#
4
}
,
2653
+
RD
#
#
4
=
>
\processchemicaldashedlinesegment
{
+
R
}
{
#
#
4
}
,
2654
-
RB
#
#
4
=
>
\processchemicaldeltalinesegment
{
-
R
}
{
#
#
4
}
,
2655
+
RB
#
#
4
=
>
\processchemicaldeltalinesegment
{
+
R
}
{
#
#
4
}
,
2656
CRZ
#
#
4
=
>
\processchemicaltextelement
{
CRZ
}
{
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2657
RTN
#
#
4
=
>
\processchemicaltextconstant
{
RTN
}
{
#
#
4
}
{
\chemicaltextelementnumber
}
{
0
}
,
2658
RTT
#
#
4
=
>
\processchemicaltextelement
{
RTN
}
{
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2659
RBN
#
#
4
=
>
\processchemicaltextconstant
{
RBN
}
{
#
#
4
}
{
\chemicaltextelementnumber
}
{
0
}
,
2660
RBT
#
#
4
=
>
\processchemicaltextelement
{
RBN
}
{
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2661
-
SS
#
#
4
=
>
\processchemicallinesegment
{
-
SS
}
{
#
#
4
}
,
2662
+
SS
#
#
4
=
>
\processchemicallinesegment
{
+
SS
}
{
#
#
4
}
,
2663
CCD
#
#
4
=
>
\processchemicaldottsegment
{
CC
}
{
#
#
4
}
,
2664
SS
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SS
}
{
#
#
3
#
#
4
}
,
2665
RD
#
#
3
#
#
4
=
>
\processchemicaldashedlinesegment
{
R
}
{
#
#
3
#
#
4
}
,
2666
RB
#
#
3
#
#
4
=
>
\processchemicaldeltalinesegment
{
R
}
{
#
#
3
#
#
4
}
,
2667
ZN
#
#
3
#
#
4
=
>
\processchemicaltextconstant
{
ZN
}
{
#
#
3
#
#
4
}
{
\chemicaltextelementnumber
}
{
0
}
,
2668
ZT
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
ZN
}
{
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2669
RN
#
#
3
#
#
4
=
>
\processchemicaltextconstant
{
RN
}
{
#
#
3
#
#
4
}
{
\chemicaltextelementnumber
}
{
0
}
,
2670
RT
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
RN
}
{
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2671
AU
#
#
3
#
#
4
=
>
\processchemicaluparrowsegment
{
A
}
{
#
#
3
#
#
4
}
,
2672
AD
#
#
3
#
#
4
=
>
\processchemicaldownarrowsegment
{
A
}
{
#
#
3
#
#
4
}
,
2673
CC
#
#
3
#
#
4
=
>
\processchemicalcircsegment
{
CC
}
{
#
#
3
#
#
4
}
,
2674
CD
#
#
3
#
#
4
=
>
\processchemicaldottsegment
{
C
}
{
#
#
3
#
#
4
}
,
2675
DB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
DB
}
{
#
#
3
#
#
4
}
,
2676
DR
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
DR
}
{
#
#
3
#
#
4
}
,
2677
EB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
EB
}
{
#
#
3
#
#
4
}
,
2678
ER
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
ER
}
{
#
#
3
#
#
4
}
,
2679
RZ
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
RZ
}
{
#
#
3
#
#
4
}
{
#
1
}
{
5
}
2680
{
l
,
l
,
r
,
r
,
r
,
l
,
r
,
r
,
b
,
l
,
r
,
r
,
b
,
l
,
t
,
r
,
l
,
l
,
t
,
r
}
,
2681
SB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
}
,
2682
SR
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SR
}
{
#
#
3
#
#
4
}
,
2683
-
R
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
-
R
}
{
#
#
3
#
#
4
}
,
2684
+
R
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
+
R
}
{
#
#
3
#
#
4
}
,
2685
B
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
}
,
2686
C
#
#
2
#
#
3
#
#
4
=
>
\processchemicalcircsegment
{
C
}
{
#
#
2
#
#
3
#
#
4
}
,
2687
R
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
R
}
{
#
#
2
#
#
3
#
#
4
}
,
2688
S
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
S
}
{
#
#
2
#
#
3
#
#
4
}
,
2689
Z
#
#
2
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2690
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
}
]
}
}
2691 2692
\def
\executechemicalSIX
[
#
1
]
%
2693
{
\setchemicalname
SIX
2694
%
2695
\setchemicalmaximum
6
2696
\setchemicalsubstitute
1
3
7
5
2697
\setchemicaldistance
8
6
6
2698
%
2699
\setchemicalrotation
1
1
0
0
-
1
-
1
0
0
1
2700
\setchemicalrotation
2
0
.
5
-
0
.
8
6
6
-
0
.
8
6
6
-
0
.
5
-
0
.
5
0
.
8
6
6
0
.
8
6
6
0
.
5
2701
\setchemicalrotation
3
-
0
.
5
-
0
.
8
6
6
-
0
.
8
6
6
0
.
5
0
.
5
0
.
8
6
6
0
.
8
6
6
-
0
.
5
2702
\setchemicalrotation
4
-
1
0
0
1
1
0
0
-
1
2703
\setchemicalrotation
5
-
0
.
5
0
.
8
6
6
0
.
8
6
6
0
.
5
0
.
5
-
0
.
8
6
6
-
0
.
8
6
6
-
0
.
5
2704
\setchemicalrotation
6
0
.
5
0
.
8
6
6
0
.
8
6
6
-
0
.
5
-
0
.
5
-
0
.
8
6
6
-
0
.
8
6
6
0
.
5
2705
%
2706
\setchemicalangle
1
0
9
0
1
8
0
2
7
0
2707
\setchemicalangle
2
6
0
1
5
0
2
4
0
3
3
0
2708
\setchemicalangle
3
1
2
0
2
1
0
3
0
0
3
0
2709
\setchemicalangle
4
1
8
0
2
7
0
0
9
0
2710
\setchemicalangle
5
2
4
0
3
3
0
6
0
1
5
0
2711
\setchemicalangle
6
3
0
0
3
0
1
2
0
2
1
0
2712
%
2713
\setchemicaltranslate
1
-
1
7
3
2
0
2714
\setchemicaltranslate
2
-
8
6
6
1
5
0
0
2715
\setchemicaltranslate
3
8
6
6
1
5
0
0
2716
\setchemicaltranslate
4
1
7
3
2
0
2717
\setchemicaltranslate
5
8
6
6
-
1
5
0
0
2718
\setchemicaltranslate
6
-
8
6
6
-
1
5
0
0
2719
%
2720
\setchemicallinesegment
A
1
3
8
6
5
0
0
1
3
8
6
-
5
0
0
2721
\setchemicallinesegment
S
0
1
0
0
0
8
6
6
-
5
0
0
2722
\setchemicallinesegment
SS
1
2
5
7
8
3
7
4
1
-
2
8
3
2723
\setchemicallinesegment
-
SS
0
1
0
0
0
7
4
1
-
2
8
3
2724
\setchemicallinesegment
+
SS
1
2
5
7
8
3
8
6
6
-
5
0
0
2725
\setchemicallinesegment
B
8
6
6
5
0
0
8
6
6
-
5
0
0
2726
\setchemicallinesegment
SB
8
6
6
2
4
0
8
6
6
-
2
4
0
2727
\setchemicallinesegment
-
SB
8
6
6
2
4
0
8
6
6
-
5
0
0
2728
\setchemicallinesegment
+
SB
8
6
6
5
0
0
8
6
6
-
2
4
0
2729
\setchemicallinesegment
DB
1
8
1
6
2
4
0
8
1
6
-
2
4
0
2730
\setchemicallinesegment
DB
2
9
1
6
2
4
0
9
1
6
-
2
4
0
2731
\setchemicallinesegment
EB
7
2
6
3
4
0
7
2
6
-
3
4
0
2732
\setchemicallinesegment
R
8
6
6
5
0
0
1
2
9
9
7
5
0
2733
\setchemicallinesegment
-
R
8
6
6
5
0
0
8
6
6
1
0
0
0
2734
\setchemicallinesegment
+
R
8
6
6
5
0
0
1
2
9
9
2
5
0
2735
\setchemicallinesegment
ER
1
8
4
1
5
4
3
1
2
7
4
7
9
3
2736
\setchemicallinesegment
ER
2
8
9
1
4
5
7
1
3
2
4
7
0
7
2737
\setchemicallinesegment
SR
1
0
9
1
6
3
0
1
2
9
9
7
5
0
2738
\setchemicallinesegment
-
SR
8
6
6
7
4
0
8
6
6
1
0
0
0
2739
\setchemicallinesegment
+
SR
1
0
9
1
3
7
0
1
2
9
9
2
5
0
2740
\setchemicallinesegment
DR
1
1
0
6
6
6
7
3
1
2
7
4
7
9
3
2741
\setchemicallinesegment
DR
2
1
1
1
6
5
8
8
1
3
2
4
7
0
7
2742
\setchemicallinesegment
MID
1
0
1
0
0
0
-
1
5
0
2
0
0
2743
\setchemicallinesegment
MID
2
0
-
1
0
0
0
-
1
5
0
-
2
0
0
2744
\setchemicallinesegment
MIDS
1
0
1
0
0
0
-
1
8
0
0
2745
\setchemicallinesegment
MIDS
2
0
-
1
0
0
0
-
1
8
0
0
2746
%
2747
\setchemicalcircsegment
C
-
3
0
3
0
7
0
0
6
0
6
0
0
-
3
4
6
2748
\setchemicalcircsegment
CC
-
6
0
0
7
0
0
6
0
3
5
0
-
6
0
6
2749
%
2750
\setchemicaltextelement
Z
8
6
6
5
0
0
2751
\setchemicaltextelement
RZ
1
3
8
6
8
0
0
2752
\setchemicaltextelement
-
RZ
8
6
6
1
1
0
0
2753
\setchemicaltextelement
+
RZ
1
3
8
6
2
0
0
2754
\setchemicaltextelement
CRZ
1
5
2
4
8
8
0
2755
\setchemicaltextelement
MIDZ
-
1
5
0
0
2756
%
2757
\setchemicaltextelement
ZN
5
8
9
3
5
0
2758
\setchemicaltextelement
RN
1
0
8
3
6
2
5
% 1.25 Z
2759
\setchemicaltextelement
RTN
1
0
0
8
7
5
5
% .12 / 130 75
2760
\setchemicaltextelement
RBN
1
1
5
8
4
9
5
2761
%
2762
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
2763
{
\processaction
2764
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
2765
[
FRONT
?
?
?
?
=
>
{
\executechemicalSIXFRONT
[
#
1
]
}
,
2766
MID
?
?
?
?
=
>
\processchemicallinesegment
{
MID
}
{
1
?
?
?
?
}
,
2767
MIDS
?
?
?
?
=
>
\processchemicallinesegment
{
MIDS
}
{
1
?
?
?
?
}
,
2768
MIDZ
?
?
?
?
=
>
\processchemicaltextelement
{
MIDZ
}
{
1
?
?
?
?
}
{
#
1
}
{
0
}
{
}
,
2769
PB
:
#
#
4
#
#
5
=
>
\beginchemicalpicture
{
#
#
4
#
#
5
}
,
2770
PE
?
?
?
?
=
>
\endchemicalpicture
,
2771
ROT
#
#
4
#
#
5
=
>
\processchemicalrotation
{
#
#
4
#
#
5
}
,
2772
SUB
#
#
4
#
#
5
=
>
\processchemicalsubstitute
{
#
#
4
#
#
5
}
,
2773
ADJ
#
#
4
#
#
5
=
>
\processchemicaldistance
{
#
#
4
#
#
5
}
,
2774
MOV
#
#
4
#
#
5
=
>
\processchemicaltranslate
{
#
#
4
#
#
5
}
,
2775
-
RZ
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
-
RZ
}
{
#
#
4
#
#
5
}
{
#
1
}
{
6
}
2776
{
b
,
l
,
l
,
t
,
r
,
r
,
l
,
l
,
r
,
r
,
r
,
l
,
t
,
r
,
r
,
b
,
l
,
l
,
r
,
r
,
l
,
l
,
l
,
r
}
,
2777
+
RZ
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
+
RZ
}
{
#
#
4
#
#
5
}
{
#
1
}
{
6
}
2778
{
l
,
t
,
r
,
r
,
b
,
l
,
r
,
r
,
r
,
l
,
l
,
l
,
r
,
b
,
l
,
l
,
t
,
r
,
l
,
l
,
l
,
r
,
r
,
r
}
,
2779
-
SB
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
#
#
5
}
,
2780
+
SB
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
#
#
5
}
,
2781
-
SR
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
-
SR
}
{
#
#
4
#
#
5
}
,
2782
+
SR
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
+
SR
}
{
#
#
4
#
#
5
}
,
2783
-
RD
#
#
4
#
#
5
=
>
\processchemicaldashedlinesegment
{
-
R
}
{
#
#
4
#
#
5
}
,
2784
+
RD
#
#
4
#
#
5
=
>
\processchemicaldashedlinesegment
{
+
R
}
{
#
#
4
#
#
5
}
,
2785
-
RB
#
#
4
#
#
5
=
>
\processchemicaldeltalinesegment
{
-
R
}
{
#
#
4
#
#
5
}
,
2786
+
RB
#
#
4
#
#
5
=
>
\processchemicaldeltalinesegment
{
+
R
}
{
#
#
4
#
#
5
}
,
2787
CRZ
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
CRZ
}
{
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2788
-
SS
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
-
SS
}
{
#
#
4
#
#
5
}
,
2789
+
SS
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
+
SS
}
{
#
#
4
#
#
5
}
,
2790
CCD
#
#
4
#
#
5
=
>
\processchemicaldottsegment
{
CC
}
{
#
#
4
#
#
5
}
,
2791
RTN
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
RTN
}
{
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2792
RTT
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
RTN
}
{
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2793
RBN
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
RBN
}
{
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2794
RBT
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
RBN
}
{
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2795
SS
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SS
}
{
#
#
3
#
#
4
#
#
5
}
,
2796
RD
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldashedlinesegment
{
R
}
{
#
#
3
#
#
4
#
#
5
}
,
2797
RB
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldeltalinesegment
{
R
}
{
#
#
3
#
#
4
#
#
5
}
,
2798
ZN
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
ZN
}
{
#
#
3
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2799
ZT
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
ZN
}
{
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2800
RN
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextconstant
{
RN
}
{
#
#
3
#
#
4
#
#
5
}
{
\chemicaltextelementnumber
}
{
0
}
,
2801
RT
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
RN
}
{
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2802
AU
#
#
3
#
#
4
#
#
5
=
>
\processchemicaluparrowsegment
{
A
}
{
#
#
3
#
#
4
#
#
5
}
,
2803
AD
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldownarrowsegment
{
A
}
{
#
#
3
#
#
4
#
#
5
}
,
2804
CD
#
#
3
#
#
4
#
#
5
=
>
\processchemicaldottsegment
{
C
}
{
#
#
3
#
#
4
#
#
5
}
,
2805
CC
#
#
3
#
#
4
#
#
5
=
>
\processchemicalcircsegment
{
CC
}
{
#
#
3
#
#
4
#
#
5
}
,
2806
DB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
DB
}
{
#
#
3
#
#
4
#
#
5
}
,
2807
EB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
EB
}
{
#
#
3
#
#
4
#
#
5
}
,
2808
ER
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
ER
}
{
#
#
3
#
#
4
#
#
5
}
,
2809
RZ
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
RZ
}
{
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
6
}
2810
{
l
,
l
,
t
,
r
,
r
,
b
,
l
,
r
,
r
,
r
,
l
,
l
,
r
,
r
,
b
,
l
,
l
,
t
,
r
,
l
,
l
,
l
,
r
,
r
}
,
2811
SB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2812
SR
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SR
}
{
#
#
3
#
#
4
#
#
5
}
,
2813
DR
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
DR
}
{
#
#
3
#
#
4
#
#
5
}
,
2814
-
R
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
-
R
}
{
#
#
3
#
#
4
#
#
5
}
,
2815
+
R
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
+
R
}
{
#
#
3
#
#
4
#
#
5
}
,
2816
B
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
2817
C
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicalcircsegment
{
C
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
2818
R
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
R
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
2819
S
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
S
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
2820
Z
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2821
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
}
]
}
}
2822 2823
\def
\executechemicalSEVEN
[
#
1
]
% incomplete !
2824
{
\setchemicalname
SEVEN
2825
%
2826
\setchemicalmaximum
7
2827
\setchemicalsubstitute
-
2828
\setchemicaldistance
1
0
3
8
2829
%
2830
\setchemicalrotation
1
.
6
2
3
.
7
8
2
-
-
-
-
-
-
2831
\setchemicalrotation
2
-
.
2
2
3
.
9
7
5
-
-
-
-
-
-
2832
\setchemicalrotation
3
-
.
9
0
1
.
4
3
4
-
-
-
-
-
-
2833
\setchemicalrotation
4
-
.
9
0
1
-
.
4
3
4
-
-
-
-
-
-
2834
\setchemicalrotation
5
-
.
2
2
3
-
.
9
7
5
-
-
-
-
-
-
2835
\setchemicalrotation
6
.
6
2
3
-
.
7
8
2
-
-
-
-
-
-
2836
\setchemicalrotation
7
1
0
-
-
-
-
-
-
2837
%
2838
\setchemicalangle
1
0
-
-
-
2839
\setchemicalangle
2
5
1
.
4
2
9
-
-
-
2840
\setchemicalangle
3
1
0
2
.
8
5
7
-
-
-
2841
\setchemicalangle
4
1
5
4
.
2
8
6
-
-
-
2842
\setchemicalangle
5
2
0
5
.
7
1
4
-
-
-
2843
\setchemicalangle
6
2
5
7
.
1
4
3
-
-
-
2844
\setchemicalangle
7
3
0
8
.
5
7
1
-
-
-
2845
%
2846
\setchemicaltranslate
1
-
-
2847
\setchemicaltranslate
2
-
-
2848
\setchemicaltranslate
3
-
-
2849
\setchemicaltranslate
4
-
-
2850
\setchemicaltranslate
5
-
-
2851
\setchemicaltranslate
6
-
-
2852
\setchemicaltranslate
7
-
-
2853
%
2854
\setchemicallinesegment
B
1
0
3
8
5
0
0
1
0
3
8
-
5
0
0
2855
\setchemicallinesegment
SB
1
0
3
8
2
4
0
1
0
3
8
-
2
4
0
2856
\setchemicallinesegment
-
SB
1
0
3
8
2
4
0
1
0
3
8
-
5
0
0
2857
\setchemicallinesegment
+
SB
1
0
3
8
5
0
0
1
0
3
8
-
2
4
0
2858
%
2859
\setchemicaltextelement
Z
1
0
3
8
5
0
0
2860
%
2861
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
2862
{
\processaction
2863
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
2864
[
PB
:
#
#
4
#
#
5
=
>
\beginchemicalpicture
{
#
#
4
#
#
5
}
,
2865
PE
?
?
?
?
=
>
\endchemicalpicture
,
2866
%ROT##4##5=>\processchemicalrotation{##4},
2867
%SUB##4##5=>\processchemicalsubstitute{##4##5},
2868
%ADJ##4##5=>\processchemicaldistance{##4##5},
2869
%MOV##4##5=>\processchemicaltranslate{##4##5},
2870
-
SB
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
#
#
5
}
,
2871
+
SB
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
#
#
5
}
,
2872
SB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2873
B
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
2874
Z
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2875
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
}
]
}
}
2876 2877
\def
\executechemicalEIGHT
[
#
1
]
% incomplete !
2878
{
\setchemicalname
EIGHT
2879
%
2880
\setchemicalmaximum
8
2881
%\setchemicalsubstitute 1307
2882
\setchemicaldistance
1
2
0
7
2883
%
2884
\setchemicalrotation
1
.
7
0
7
.
7
0
7
-
-
-
-
-
-
2885
\setchemicalrotation
2
0
1
-
-
-
-
-
-
2886
\setchemicalrotation
3
-
.
7
0
7
.
7
0
7
-
-
-
-
-
-
2887
\setchemicalrotation
4
-
1
0
-
-
-
-
-
-
2888
\setchemicalrotation
5
-
.
7
0
7
-
.
7
0
7
-
-
-
-
-
-
2889
\setchemicalrotation
6
0
-
1
-
-
-
-
-
-
2890
\setchemicalrotation
7
.
7
0
7
-
.
7
0
7
-
-
-
-
-
-
2891
\setchemicalrotation
8
1
0
-
-
-
-
-
-
2892
%
2893
\setchemicalangle
1
4
5
-
-
-
2894
\setchemicalangle
2
9
0
-
-
-
2895
\setchemicalangle
3
1
3
5
-
-
-
2896
\setchemicalangle
4
1
8
0
-
-
-
2897
\setchemicalangle
5
2
2
5
-
-
-
2898
\setchemicalangle
6
2
7
0
-
-
-
2899
\setchemicalangle
7
3
1
5
-
-
-
2900
\setchemicalangle
8
0
-
-
-
2901
%
2902
\setchemicaltranslate
1
-
2
4
1
4
0
2903
\setchemicaltranslate
2
-
1
7
0
6
1
7
0
6
2904
\setchemicaltranslate
3
0
2
4
1
4
2905
\setchemicaltranslate
4
1
7
0
6
1
7
0
6
2906
\setchemicaltranslate
5
2
4
1
4
0
2907
\setchemicaltranslate
6
1
7
0
6
-
1
7
0
6
2908
\setchemicaltranslate
7
0
-
2
4
1
4
2909
\setchemicaltranslate
8
-
1
7
0
6
-
1
7
0
6
2910
%
2911
\setchemicallinesegment
B
1
2
0
7
5
0
0
1
2
0
7
-
5
0
0
2912
\setchemicallinesegment
SB
1
2
0
7
2
4
0
1
2
0
7
-
2
4
0
2913
\setchemicallinesegment
-
SB
1
2
0
7
2
4
0
1
2
0
7
-
5
0
0
2914
\setchemicallinesegment
+
SB
1
2
0
7
5
0
0
1
2
0
7
-
2
4
0
2915
%
2916
\setchemicaltextelement
Z
1
2
0
7
5
0
0
2917
%
2918
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
2919
{
\processaction
2920
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
2921
[
PB
:
#
#
4
#
#
5
=
>
\beginchemicalpicture
{
#
#
4
#
#
5
}
,
2922
PE
?
?
?
?
=
>
\endchemicalpicture
,
2923
%SUB##4##5=>\processchemicalsubstitute{##4##5},
2924
ADJ
#
#
4
#
#
5
=
>
\processchemicaldistance
{
#
#
4
#
#
5
}
,
2925
MOV
#
#
4
#
#
5
=
>
\processchemicaltranslate
{
#
#
4
#
#
5
}
,
2926
-
SB
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
#
#
5
}
,
2927
+
SB
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
#
#
5
}
,
2928
SB
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
#
#
5
}
,
2929
B
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
2930
Z
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
0
}
{
}
,
2931
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
}
]
}
}
2932 2933
\def
\executechemicalFIVEFRONT
[
#
1
]
%
2934
{
\executechemicalFIVE
[
]
%
2935
%
2936
\setchemicalname
FIVEFRONT
2937
%
2938
\setchemicallinesegment
-
R
6
8
8
5
0
0
6
8
8
1
0
0
2939
\setchemicallinesegment
+
R
6
8
8
5
0
0
6
8
8
9
0
0
2940
%
2941
\setchemicaltextelement
-
RZ
0
-
1
3
0
0
2942
\setchemicaltextelement
+
RZ
0
1
3
0
0
2943
%
2944
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
]
%
2945
{
\def
\chemicalrotation
{
2
}
%
2946
\processaction
2947
[
#
#
1
#
#
2
#
#
3
#
#
4
]
2948
[
-
RZ
#
#
4
=
>
\processchemicalunrotatedtextelement
{
Z
}
{
-
RZ
}
{
#
#
4
}
{
#
1
}
{
5
}
2949
{
,
,
,
,
,
t
,
t
,
t
,
t
,
t
}
,
2950
+
RZ
#
#
4
=
>
\processchemicalunrotatedtextelement
{
Z
}
{
+
RZ
}
{
#
#
4
}
{
#
1
}
{
5
}
2951
{
,
,
,
,
,
b
,
b
,
b
,
b
,
b
}
,
2952
-
SB
#
#
4
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
}
,
2953
+
SB
#
#
4
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
}
,
2954
SB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
}
,
2955
-
R
#
#
3
#
#
4
=
>
\processchemicalunrotatedlinesegment
{
t
}
{
-
R
}
{
#
#
3
#
#
4
}
,
2956
+
R
#
#
3
#
#
4
=
>
\processchemicalunrotatedlinesegment
{
b
}
{
+
R
}
{
#
#
3
#
#
4
}
,
2957
BB
#
#
3
#
#
4
=
>
\processchemicalzlinesegment
{
B
}
{
#
#
3
#
#
4
}
,
2958
R
#
#
2
#
#
3
#
#
4
=
>
\processchemicalunrotatedlinesegment
{
t
}
{
-
R
}
{
#
#
2
#
#
3
#
#
4
}
%
2959
\processchemicalunrotatedlinesegment
{
b
}
{
+
R
}
{
#
#
2
#
#
3
#
#
4
}
,
2960
B
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
}
,
2961
Z
#
#
2
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2962
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
}
]
}
}
2963 2964
\def
\executechemicalSIXFRONT
[
#
1
]
%
2965
{
\executechemicalSIX
[
]
%
2966
%
2967
\setchemicalname
SIXFRONT
2968
%
2969
\setchemicallinesegment
-
R
8
6
6
5
0
0
8
6
6
1
0
0
2970
\setchemicallinesegment
+
R
8
6
6
5
0
0
8
6
6
9
0
0
2971
%
2972
\setchemicaltextelement
-
RZ
0
-
1
3
0
0
2973
\setchemicaltextelement
+
RZ
0
1
3
0
0
2974
%
2975
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
]
%
2976
{
\def
\chemicalrotation
{
2
}
%
2977
\processaction
2978
[
#
#
1
#
#
2
#
#
3
#
#
4
]
2979
[
-
RZ
#
#
4
=
>
\processchemicalunrotatedtextelement
{
Z
}
{
-
RZ
}
{
#
#
4
}
{
#
1
}
{
6
}
2980
{
,
,
,
,
,
,
t
,
t
,
t
,
t
,
t
,
t
}
,
2981
+
RZ
#
#
4
=
>
\processchemicalunrotatedtextelement
{
Z
}
{
+
RZ
}
{
#
#
4
}
{
#
1
}
{
6
}
2982
{
,
,
,
,
,
,
b
,
b
,
b
,
b
,
b
,
b
}
,
2983
-
SB
#
#
4
=
>
\processchemicallinesegment
{
-
SB
}
{
#
#
4
}
,
2984
+
SB
#
#
4
=
>
\processchemicallinesegment
{
+
SB
}
{
#
#
4
}
,
2985
SB
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
SB
}
{
#
#
3
#
#
4
}
,
2986
-
R
#
#
3
#
#
4
=
>
\processchemicalunrotatedlinesegment
{
t
}
{
-
R
}
{
#
#
3
#
#
4
}
,
2987
+
R
#
#
3
#
#
4
=
>
\processchemicalunrotatedlinesegment
{
b
}
{
+
R
}
{
#
#
3
#
#
4
}
,
2988
BB
#
#
3
#
#
4
=
>
\processchemicalzlinesegment
{
B
}
{
#
#
3
#
#
4
}
,
2989
R
#
#
2
#
#
3
#
#
4
=
>
\processchemicalunrotatedlinesegment
{
t
}
{
-
R
}
{
#
#
2
#
#
3
#
#
4
}
%
2990
\processchemicalunrotatedlinesegment
{
b
}
{
+
R
}
{
#
#
2
#
#
3
#
#
4
}
,
2991
B
#
#
2
#
#
3
#
#
4
=
>
\processchemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
}
,
2992
Z
#
#
2
#
#
3
#
#
4
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
0
}
{
}
,
2993
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
}
]
}
}
2994 2995
% 1 : 0
2996
% 2 : -115
2997
% 3* : -195
2998
% 3 : -165
2999
% 4 : -245
3000 3001
\def
\executechemicalCARBON
[
#
1
]
%
3002
{
\setchemicalname
CARBON
3003
%
3004
\setchemicalmaximum
4
3005
\setchemicaldistance
0
3006
\setchemicalsubstitute
0
3007
%
3008
\setchemicalrotation
1
1
0
0
-
1
-
1
0
0
1
3009
\setchemicalrotation
2
-
0
.
4
2
3
-
0
.
9
0
6
-
0
.
9
0
6
0
.
4
2
3
0
.
4
2
3
0
.
9
0
6
0
.
9
0
6
-
0
.
4
2
3
3010
\setchemicalrotation
3
-
0
.
9
6
6
-
0
.
2
5
9
-
0
.
2
5
9
0
.
9
6
6
0
.
9
6
6
0
.
2
5
9
0
.
2
5
9
-
0
.
9
6
6
3011
\setchemicalrotation
3
*
-
0
.
9
6
6
0
.
2
5
9
0
.
2
5
9
0
.
9
6
6
0
.
9
6
6
-
0
.
2
5
9
-
0
.
2
5
9
-
0
.
9
6
6
3012
\setchemicalrotation
4
-
0
.
4
2
3
0
.
9
0
6
0
.
9
0
6
0
.
4
2
3
0
.
4
2
3
-
0
.
9
0
6
-
0
.
9
0
6
-
0
.
4
2
3
3013
%
3014
\setchemicalangle
1
0
9
0
1
8
0
2
7
0
3015
\setchemicalangle
2
1
1
5
2
0
5
2
9
5
2
5
3016
\setchemicalangle
3
1
6
5
2
5
5
3
4
5
7
5
3017
\setchemicalangle
3
*
1
9
5
2
8
5
1
5
1
0
5
3018
\setchemicalangle
4
2
4
5
3
3
5
6
5
1
5
5
3019
%
3020
\setchemicaltranslate
1
-
1
5
0
0
0
3021
\setchemicaltranslate
2
0
1
5
0
0
3022
\setchemicaltranslate
3
1
5
0
0
0
3023
\setchemicaltranslate
4
0
-
1
5
0
0
3024
%
3025
\setchemicallinesegment
B
1
5
0
0
0
1
0
0
0
0
3026
\setchemicallinesegment
B
2
3
0
0
0
1
0
0
0
0
3027
\setchemicallinesegment
B
3
5
0
0
0
1
0
0
0
0
3028
\setchemicallinesegment
B
4
3
0
0
0
1
0
0
0
0
3029
%
3030
\setchemicaltextelement
Z
1
1
0
0
0
3031
%
3032
\setchemicalcircsegment
C
0
3
6
0
5
0
0
3
6
0
0
-
5
0
0
3033
%
3034
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
3035
{
\processaction
3036
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
3037
[
MIR
?
?
?
?
=
>
\setchemicalmirror
{
3
}
,
3038
-
MIR
?
?
?
?
=
>
\resetchemicalmirror
{
3
}
,
3039
*
MIR
?
?
?
?
=
>
\togglechemicalmirror
{
3
}
,
3040
CB
?
?
?
?
=
>
\processlocalchemicals
{
B
,
C
,
Z
}
,
3041
C
?
?
?
?
=
>
\processchemicalcircsegment
{
C
}
{
1
?
?
?
?
}
,
3042
-
ROT
#
#
5
=
>
\reversechemical
{
ROT
}
{
#
#
5
}
{
3
,
4
,
1
,
2
}
,
3043
ROT
#
#
4
#
#
5
=
>
\processchemicalrotation
{
#
#
4
#
#
5
}
,
3044
MOV
#
#
4
#
#
5
=
>
\processchemicaltranslate
{
#
#
4
#
#
5
}
,
3045
CB
#
#
3
#
#
4
#
#
5
=
>
\processlocalchemicals
3046
{
ROT
#
#
3
,
C
,
B
,
Z
2
.
.
4
,
3047
MOV
#
#
3
,
*
MIR
,
-
ROT
#
#
3
,
C
,
B
,
Z
2
.
.
4
}
,
3048
B
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processprivatechemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
,
3049
Z
#
#
2
#
#
3
#
#
4
#
#
5
=
>
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
#
#
5
}
{
#
1
}
{
4
}
3050
{
l
,
t
,
r
,
b
,
t
,
r
,
b
,
l
,
r
,
b
,
l
,
t
,
b
,
l
,
t
,
r
}
,
3051
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
}
]
}
}
3052 3053
% 1: 45 2: -90 3: -225
3054
% 4: -45 5: -135 6: -270
3055 3056
\newif
\ifNEWMANstagger
\NEWMANstaggertrue
3057 3058
\def
\executechemicalNEWMANSTAGGER
%
3059
{
\NEWMANstaggertrue
\executechemicalNEWMAN
}
3060 3061
\def
\executechemicalNEWMANECLIPSE
%
3062
{
\NEWMANstaggerfalse
\executechemicalNEWMAN
}
3063 3064
\def
\executechemicalNEWMAN
[
#
1
]
%
3065
{
\setchemicalname
NEWMAN
3066
%
3067
\setchemicalmaximum
6
3068
\setchemicaldistance
0
3069
\setchemicalsubstitute
0
3070
%
3071
\ifNEWMANstagger
3072
\setchemicalrotation
1
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
3073
\setchemicalrotation
2
0
-
1
-
1
0
0
1
1
0
3074
\setchemicalrotation
3
-
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
3075
\else
3076
\setchemicalrotation
1
.
8
6
6
-
.
5
-
.
5
-
.
8
6
6
-
.
8
6
6
.
5
.
5
.
8
6
6
3077
\setchemicalrotation
2
-
.
2
5
9
.
9
6
6
.
9
6
6
.
2
5
9
.
2
5
9
-
.
9
6
6
-
.
9
6
6
-
.
2
5
9
3078
\setchemicalrotation
3
-
.
5
-
.
8
6
6
-
.
8
6
6
.
5
.
5
.
8
6
6
.
8
6
6
-
.
5
3079
\fi
3080
\setchemicalrotation
4
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
3081
\setchemicalrotation
5
-
0
.
7
0
7
-
0
.
7
0
7
-
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
0
.
7
0
7
-
0
.
7
0
7
3082
\setchemicalrotation
6
0
1
1
0
0
-
1
-
1
0
3083
%
3084
\ifNEWMANstagger
3085
\setchemicalangle
1
3
1
5
4
5
1
3
5
2
2
5
3086
\setchemicalangle
2
9
0
1
8
0
2
7
0
0
3087
\setchemicalangle
3
2
2
5
3
1
5
4
5
1
3
5
3088
\else
3089
\setchemicalangle
1
3
0
1
2
0
2
1
0
3
0
0
3090
\setchemicalangle
2
2
5
5
3
4
5
7
5
1
6
5
3091
\setchemicalangle
3
1
2
0
2
1
0
3
0
0
3
0
3092
\fi
3093
\setchemicalangle
4
4
5
1
3
5
2
2
5
3
1
5
3094
\setchemicalangle
5
1
3
5
2
2
5
3
1
5
4
5
3095
\setchemicalangle
6
2
7
0
0
9
0
1
8
0
3096
%
3097
\setchemicaltranslate
1
-
1
5
0
0
0
3098
\setchemicaltranslate
2
0
1
5
0
0
3099
\setchemicaltranslate
3
1
5
0
0
0
3100
\setchemicaltranslate
4
0
-
1
5
0
0
3101
%
3102
\setchemicallinesegment
B
1
0
0
1
0
0
0
0
3103
\setchemicallinesegment
B
2
0
0
1
0
0
0
0
3104
\setchemicallinesegment
B
3
0
0
1
0
0
0
0
3105
\setchemicallinesegment
B
4
5
0
0
0
1
0
0
0
0
3106
\setchemicallinesegment
B
5
5
0
0
0
1
0
0
0
0
3107
\setchemicallinesegment
B
6
5
0
0
0
1
0
0
0
0
3108
%
3109
\setchemicaltextelement
Z
1
1
0
0
0
3110
%
3111
\setchemicalcircsegment
C
0
3
6
0
5
0
0
3
6
0
0
-
5
0
0
3112
%
3113
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
]
%
3114
{
\processaction
3115
[
#
#
1
#
#
2
#
#
3
#
#
4
]
3116
[
STAGGER
?
?
?
?
=
>
{
\executechemicalNEWMANSTAGGER
[
#
1
]
}
,
3117
ECLIPSE
?
?
?
?
=
>
{
\executechemicalNEWMANECLIPSE
[
#
1
]
}
,
3118
B
?
?
?
?
=
>
\processlocalchemicals
{
B
1
.
.
6
}
,
3119
CB
?
?
?
?
=
>
\processlocalchemicals
{
B
1
.
.
6
,
C
,
Z
1
.
.
6
}
,
3120
C
?
?
?
?
=
>
\processchemicalcircsegment
{
C
}
{
1
?
?
?
?
}
,
3121
ROT
#
#
4
=
>
\processchemicalrotation
{
#
#
4
}
,
3122
MOV
#
#
4
=
>
\processchemicaltranslate
{
#
#
4
}
,
3123
B
#
#
2
#
#
3
#
#
4
=
>
\processprivatechemicallinesegment
{
B
}
{
#
#
2
#
#
3
#
#
4
}
,
3124
Z
#
#
2
#
#
3
#
#
4
=
>
\ifNEWMANstagger
3125
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
6
}
3126
{
l
,
t
,
r
,
l
,
r
,
b
,
l
,
r
,
l
,
r
,
r
,
l
,
r
,
b
,
l
,
r
,
l
,
t
,
r
,
l
,
r
,
l
,
l
,
r
}
%
3127
\else
3128
\processchemicaltextelement
{
Z
}
{
#
#
2
#
#
3
#
#
4
}
{
#
1
}
{
6
}
3129
{
l
,
r
,
t
,
t
,
r
,
b
,
t
,
b
,
r
,
r
,
b
,
l
,
r
,
l
,
b
,
b
,
l
,
t
,
b
,
t
,
l
,
l
,
t
,
r
}
%
3130
\fi
,
3131
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
}
]
}
}
3132 3133
\def
\executechemicalCHAIR
[
#
1
]
% smaller
3134
{
\setchemicalname
CHAIR
3135
%
3136
\setchemicalmaximum
6
3137
%
3138
\setchemicallinesegment
B
1
1
6
0
0
8
0
0
2
8
0
0
-
8
0
0
3139
\setchemicallinesegment
B
2
2
8
0
0
-
8
0
0
8
0
0
0
3140
\setchemicallinesegment
B
3
8
0
0
0
-
1
6
0
0
-
8
0
0
3141
\setchemicallinesegment
B
4
-
1
6
0
0
-
8
0
0
-
2
8
0
0
8
0
0
3142
\setchemicallinesegment
B
5
-
2
8
0
0
8
0
0
-
8
0
0
0
3143
\setchemicallinesegment
B
6
-
8
0
0
0
1
6
0
0
8
0
0
3144
%
3145
\setchemicallinesegment
+
R
1
1
6
0
0
8
0
0
1
6
0
0
1
6
0
0
3146
\setchemicallinesegment
+
R
2
2
8
0
0
-
8
0
0
2
8
0
0
-
1
6
0
0
3147
\setchemicallinesegment
+
R
3
8
0
0
0
8
0
0
8
0
0
3148
\setchemicallinesegment
+
R
4
-
1
6
0
0
-
8
0
0
-
1
6
0
0
-
1
6
0
0
3149
\setchemicallinesegment
+
R
5
-
2
8
0
0
8
0
0
-
2
8
0
0
1
6
0
0
3150
\setchemicallinesegment
+
R
6
-
8
0
0
0
-
8
0
0
-
8
0
0
3151
%
3152
\setchemicallinesegment
-
R
1
1
6
0
0
8
0
0
2
3
5
0
5
2
2
% 750 278
3153
\setchemicallinesegment
-
R
2
2
8
0
0
-
8
0
0
3
4
9
3
-
4
0
0
3154
\setchemicallinesegment
-
R
3
8
0
0
0
1
3
2
9
-
6
0
0
% 528 600
3155
\setchemicallinesegment
-
R
4
-
1
6
0
0
-
8
0
0
-
2
3
5
0
-
5
2
2
% 750 278
3156
\setchemicallinesegment
-
R
5
-
2
8
0
0
8
0
0
-
3
4
9
3
4
0
0
3157
\setchemicallinesegment
-
R
6
-
8
0
0
0
-
1
3
2
9
6
0
0
% 528 600
3158
%
3159
\setchemicaltextelement
+
RZ
1
1
6
0
0
1
8
0
0
3160
\setchemicaltextelement
+
RZ
2
2
8
0
0
-
1
8
0
0
3161
\setchemicaltextelement
+
RZ
3
8
0
0
1
0
0
0
3162
\setchemicaltextelement
+
RZ
4
-
1
6
0
0
-
1
8
0
0
3163
\setchemicaltextelement
+
RZ
5
-
2
8
0
0
1
8
0
0
3164
\setchemicaltextelement
+
RZ
6
-
8
0
0
-
1
0
0
0
3165
%
3166
\setchemicaltextelement
-
RZ
1
2
5
3
8
4
5
3
% 200 lang
3167
\setchemicaltextelement
-
RZ
2
3
6
6
6
-
3
0
0
3168
\setchemicaltextelement
-
RZ
3
1
4
6
0
-
7
5
0
3169
\setchemicaltextelement
-
RZ
4
-
2
5
3
8
-
4
5
3
3170
\setchemicaltextelement
-
RZ
5
-
3
6
6
6
3
0
0
3171
\setchemicaltextelement
-
RZ
6
-
1
4
6
0
7
5
0
3172
%
3173
\def
\processchemical
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
%
3174
{
\def
\chemicalrotation
{
1
}
%
3175
\processaction
3176
[
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
]
3177
[
B
?
?
?
?
=
>
\processlocalchemicals
{
B
1
,
B
2
,
B
3
,
B
4
,
B
5
,
B
6
}
,
3178
-
R
?
?
?
?
=
>
\processlocalchemicals
{
-
R
1
,
-
R
2
,
-
R
3
,
-
R
4
,
-
R
5
,
-
R
6
}
,
3179
+
R
?
?
?
?
=
>
\processlocalchemicals
{
+
R
1
,
+
R
2
,
+
R
3
,
+
R
4
,
+
R
5
,
+
R
6
}
,
3180
B
#
#
2
?
?
?
?
=
>
{
\getchemicallinesegment
[
0
]
[
B
#
#
2
]
}
,
3181
-
RZ
#
#
4
?
?
?
?
=
>
{
\getchemicalfixedtextelement
[
-
RZ
#
#
4
]
[
1
]
[
#
#
4
]
[
l
,
l
,
tc
,
r
,
r
,
bc
]
[
#
1
]
}
,
3182
+
RZ
#
#
4
?
?
?
?
=
>
{
\getchemicalfixedtextelement
[
+
RZ
#
#
4
]
[
1
]
[
#
#
4
]
[
c
]
[
#
1
]
}
,
3183
-
R
#
#
3
?
?
?
?
=
>
{
\getchemicallinesegment
[
0
]
[
-
R
#
#
3
]
}
,
3184
+
R
#
#
3
?
?
?
?
=
>
{
\getchemicallinesegment
[
0
]
[
+
R
#
#
3
]
}
,
3185
\s!unknown
=
>
\unknownchemical
{
#
#
1
#
#
2
#
#
3
#
#
4
#
#
5
}
]
}
}
3186 3187
\def
\executechemicalarrow
#
1
#
2
[
#
3
]
%
3188
{
\dogetcommalistelement
1
\from
#
3
\to
\toptext
3189
\dogetcommalistelement
2
\from
#
3
\to
\bottext
3190
\def
\dochemicaltext
#
#
1
%
3191
{
\dosetsubscripts
%
3192
$
\@@dochemicalstyle
{
\@@localchemicalformat
\strut
#
#
1
}
$
%
3193
\doresetsubscripts
}
%
3194
\doifelse
\@@chemicallocation
\v!intext
3195
{
#
1
{
\dochemicaltext
\toptext
}
}
%
3196
{
\setbox
\chemicalsymbols
=
\hbox
3197
{
\box
\chemicalsymbols
3198
\vbox
{
\halign
{
#
#
\cr
3199
\hbox
to
3
em
{
\hss
\dochemicaltext
{
\toptext
}
\hss
}
\cr
3200
#
2
%
3201
\hbox
to
3
em
{
\hss
\dochemicaltext
{
\bottext
}
\hss
}
\cr
}
}
}
}
}
3202 3203
\def
\executechemicalGIVES
3204
{
\executechemicalarrow
3205
{
\chemicalsinglepicturearrow
}
% nodig
3206
{
\rightarrowfill
\cr
}
}
3207 3208
\def
\executechemicalEQUILIBRIUM
3209
{
\executechemicalarrow
3210
{
\chemicaldoublepicturearrow
}
% nodig
3211
{
\rightarrowfill
\cr
\leftarrowfill
\cr
}
}
3212 3213
\def
\executechemicalMESOMERIC
3214
{
\executechemicalarrow
3215
{
\chemicalsinglepicturearrow
}
% nodig
3216
{
$
\leftarrow
\hskip
-
1
em
$
\rightarrowfill
\cr
}
}
3217 3218
\def
\executechemicalsign
#
1
[
#
2
]
%
3219
{
\doifelse
\@@chemicallocation
\v!intext
3220
{
\dosetsubscripts
3221
$
\@@dochemicalstyle
{
\@@localchemicalformat
#
1
}
$
%
3222
\doresetsubscripts
}
3223
{
\setbox
\chemicalsymbols
\hbox
3224
{
\box
\chemicalsymbols
3225
\dosetsubscripts
3226
$
\@@dochemicalstyle
{
\@@localchemicalformat
#
1
}
$
%
3227
\doresetsubscripts
}
}
}
3228 3229
\def
\executechemicalPLUS
3230
{
\executechemicalsign
{
+
}
}
3231 3232
\def
\executechemicalMINUS
3233
{
\executechemicalsign
{
-
}
}
3234 3235
\def
\executechemicalEQUAL
3236
{
\executechemicalsign
{
=
}
}
3237 3238
\def
\executechemicalSPACE
[
#
1
]
%
3239
{
\doifnot
\@@chemicallocation
\v!intext
3240
{
\setbox
\chemicalsymbols
\hbox
3241
{
\box
\chemicalsymbols
3242
\quad
}
}
}
3243 3244
\def
\executechemicalCHEM
[
#
1
]
%
3245
{
\doifnot
\@@chemicallocation
\v!intext
3246
{
\setbox
\chemicalsymbols
\hbox
3247
{
\box
\chemicalsymbols
3248
$
\@@dochemicalstyle
{
\@@localchemicalformat
#
1
}
$
}
}
}
3249 3250
\def
\executechemicalTEXT
[
#
1
]
%
3251
{
\doifnot
\@@chemicallocation
\v!intext
3252
{
\setbox
\chemicalsymbols
\hbox
3253
{
\box
\chemicalsymbols
#
1
}
}
}
3254 3255
%\def\executechemicalLOW[#1]%
3256
% {\setlowsubscripts}
3257
%
3258
%\def\executechemicalHIGH[#1]%
3259
% {\sethighsubscripts}
3260 3261
\def
\putchemicalrule
#
1
#
2
#
3
#
4
%
3262
{
\ifcase
\chemicaldrawingmode
3263
\putrule
from
{
#
1
}
{
#
2
}
to
{
#
3
}
{
#
4
}
3264
\or
3265
\psline
(
#
1
,
#
2
)
(
#
3
,
#
4
)
%
3266
\or
3267
\bgroup
3268
\!!counta
=
#
1
\!!countb
=
#
2
\!!countc
=
#
3
\!!countd
=
#
4
\relax
3269
\global
\MPdrawingdonetrue
3270
\setchemicalattributes
3271
\startMPdrawing
3272
x
1
:
=
\MPdivten
[
\the
\!!counta
]
u
;
3273
y
1
:
=
\MPdivten
[
\the
\!!countb
]
u
;
3274
x
2
:
=
\MPdivten
[
\the
\!!countc
]
u
;
3275
y
2
:
=
\MPdivten
[
\the
\!!countd
]
u
;
3276
draw
z
1
-
-
z
2
;
3277
\stopMPdrawing
3278
\egroup
3279
\fi
}
3280 3281
\def
\executechemicalcomplex
#
1
%
3282
{
\bgroup
3283
\putchemicalrule
{
0
}
{
-
\@@chemicalbottom
}
{
0
}
{
\@@chemicaltop
}
%
3284
\putchemicalrule
{
0
}
{
\@@chemicaltop
}
{
#
1
1
5
0
}
{
\@@chemicaltop
}
%
3285
\putchemicalrule
{
0
}
{
-
\@@chemicalbottom
}
{
#
1
1
5
0
}
{
-
\@@chemicalbottom
}
%
3286
\egroup
}
3287 3288
\def
\executechemicalOPENCOMPLEX
[
#
1
]
%
3289
{
\executechemicalcomplex
+
\ignorespaces
3290
\executechemicalSPACE
[
]
}
3291 3292
\def
\executechemicalCLOSECOMPLEX
[
#
1
]
%
3293
{
\executechemicalSPACE
[
]
%
3294
\executechemicalcomplex
-
\ignorespaces
}
3295 3296
% nog niet door midden as!
3297 3298
\def
\executechemicalverticalsymbol
#
1
#
2
%
3299
{
\executechemicalTEXT
3300
[
$
\left
#
1
\relax
3301
\dimen
0
=
\@@chemicalunit
3302
\scratchcounter
=
\@@chemicaltop
3303
\advance
\scratchcounter
by
\@@chemicalbottom
3304
\dimen
0
=
\scratchcounter
\dimen
0
3305
\vcenter
to
\dimen
0
{
}
3306
\dimen
2
=
\@@chemicalunit
3307
\dimen
2
=
\@@chemicalright
\dimen
0
3308
\vcenter
{
\leftskip
1
em
\hsize
\dimen
2
\relax
\strut
#
2
\strut
}
%
3309
\right
.
$
]
}
%
3310 3311
\def
\executechemicalUPARROW
[
#
1
]
%
3312
{
\executechemicalverticalsymbol
\uparrow
{
#
1
}
}
3313 3314
\def
\executechemicalDOWNARROW
[
#
1
]
%
3315
{
\executechemicalverticalsymbol
\downarrow
{
#
1
}
}
3316 3317
\def
\executechemicalUPDOWNARROW
[
#
1
]
%
3318
{
\executechemicalverticalsymbol
\updownarrow
{
#
1
}
}
3319 3320
\let
\setchemicalattributes
\relax
3321 3322
\setupchemical
3323
[
\c!width
=
0
,
3324
\c!height
=
0
,
3325
\c!left
=
0
,
3326
\c!right
=
0
,
3327
\c!top
=
0
,
3328
\c!bottom
=
0
,
3329
\c!bodyfont
=
\the
\bodyfontsize
,
3330
\c!resolution
=
\outputresolution
,
3331
\c!scale
=
\v!medium
,
3332
\c!size
=
\v!medium
,
3333
\c!textsize
=
\v!big
,
3334
\c!frame
=
\v!off
,
3335
\c!axis
=
\v!off
,
3336
\c!state
=
\v!start
,
3337
\c!style
=
\rm
,
3338
\c!location
=
,
3339
\c!option
=
,
3340
\c!offset
=
LOW
,
3341
\c!alternative
=
1
,
3342
\c!color
=
,
3343
\c!rulethickness
=
,
3344
\c!rulecolor
=
,
3345
\c!factor
=
1
]
3346 3347
% Tijdelijk plaatsen we deze extra macro's hier.
3348
%
3349
% mathontop: \mtop {} {}
3350
% textontop: \ttop {} {}
3351 3352
\def
\putontop
#
1
#
2
%
3353
{
\vbox
3354
{
\halign
3355
{
\strut
\hss
#
#
\hss
\cr
3356
#
1
\cr
3357
#
2
\cr
}
}
}
3358 3359
\def
\ttop
#
1
#
2
%
3360
{
\putontop
{
\tx
#
1
}
{
#
2
}
}
3361 3362
\def
\mtop
#
1
#
2
%
3363
{
\vbox
3364
{
\offinterlineskip
3365
\halign
3366
{
\hss
#
#
\hss
\cr
3367
$
\scriptscriptstyle
#
1
$
\cr
3368
\noalign
{
\vskip
.
5
ex
}
%
3369
$
#
2
$
\cr
}
}
}
3370 3371
\def
\ctop
#
1
#
2
%
3372
{
\vbox
3373
{
\offinterlineskip
3374
\halign
3375
{
\hss
#
#
\hss
\cr
3376
$
\@@dochemicalstyle
{
\@@localchemicalformat
\scriptscriptstyle
#
1
}
$
\cr
3377
\noalign
{
\vskip
.
5
ex
}
%
3378
$
\@@dochemicalstyle
{
\@@localchemicalformat
#
2
}
$
\cr
}
}
}
3379 3380
%D Here are a couple of goodies:
3381
%D
3382
%D \startitemize
3383
%D \item styles hooked into \CONTEXT\ style mechanism
3384
%D \item support for color and rulethickness (mp mode only)
3385
%D \item position tracking
3386
%D \stopitemize
3387 3388
\let
\@@chemicalrulecolor
\empty
3389
\let
\@@chemicalcolor
\empty
3390 3391
\def
\setchemicalattributes
3392
{
\scratchdimen
\@@chemicalrulethickness
3393
\def
\chemicalattributes
3394
{
withpen
pencircle
scaled
\the
\scratchdimen
\space
3395
withcolor
}
%
3396
\doifelsenothing
\@@chemicalrulecolor
3397
{
\edef
\chemicalattributes
{
\chemicalattributes
black
}
}
3398
{
\edef
\chemicalattributes
{
\chemicalattributes
\MPcolor
{
\@@chemicalrulecolor
}
}
}
%
3399
\startMPdrawing
3400
drawoptions
(
\chemicalattributes
)
;
3401
\stopMPdrawing
}
3402 3403
\unexpanded
\def
\@@dochemicalcolor
3404
{
\dousecolorparameter
\@@chemicalcolor
}
3405 3406
\unexpanded
\def
\@@dochemicalstyle
3407
{
\dousestyleparameter
\@@chemicalstyle
}
3408 3409
\setupchemical
3410
[
\c!rulethickness
=
\linewidth
,
3411
\c!rulecolor
=
,
3412
\c!color
=
]
3413 3414
\def
\cpos
#
1
#
2
%
3415
{
\iftrialtypesetting
3416
#
2
%
3417
\else
3418
\bgroup
3419
\globalpushmacro
\dowithchemical
3420
\gdef
\dowithchemical
#
#
1
{
\hpos
{
#
1
}
{
#
#
1
}
\globalpopmacro
\dowithchemical
}
%
3421
#
2
%
3422
\egroup
3423
\fi
}
3424 3425
\protect
\endinput
3426 3427
% \startchemical[axis=on,frame=yes]
3428
% \chemical[SIX,ROT2,B,R36,RZ6][CH_3]
3429
% \chemical[PB:RZ3,ONE,Z05,SB5,EP37,PE][O,H]
3430
% \stopchemical
3431 3432
% \startchemical[size=big,scale=small,axis=on,frame=yes,factor=1.5]
3433
% \chemical[SIX,ROT2,B,R36,RZ6][CH_3]
3434
% \chemical[PB:RZ3,ONE,Z05,SB5,EP37,PE][O,H]
3435
% \stopchemical
3436 3437
% \startchemical[size=big,scale=medium,axis=on,frame=yes,factor=1.5]
3438
% \chemical[SIX,ROT2,B,R36,RZ6][CH_3]
3439
% \chemical[PB:RZ3,ONE,Z05,SB5,EP37,PE][O,H]
3440
% \stopchemical
3441 3442
% \startchemical[size=big,scale=big,axis=on,frame=yes,factor=1.5]
3443
% \chemical[SIX,ROT2,B,R36,RZ6][CH_3]
3444
% \chemical[PB:RZ3,ONE,Z05,SB5,EP37,PE][O,H]
3445
% \stopchemical
3446