summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xymtex/base/bondcolor.dtx
blob: fc86de1cec7553ca9f43c1d31c0fdae0f72de033 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
% \iffalse meta-comment
%% File: bondcolor.dtx
%
%  Copyright 2010 by Shinsaku Fujita
%
%  This file is part of XyMTeX system.
%  -------------------------------------
%
% This file (bondcolor.sty) is a successor to:
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \typeout{XyMTeX for Drawing Chemical Structural Formulas. Version 1.00}
% \typeout{       -- Released December 1, 1993 by Shinsaku Fujita}
% Copyright (C) 1993 by Shinsaku Fujita, all rights reserved.
%
% This file is a part of the macro package ``XyMTeX'' which has been 
% designed for typesetting chemical structural formulas.
%
% This file is to be contained in the ``xymtex'' directory which is 
% an input directory for TeX. It is a LaTeX optional style file and 
% should be used only within LaTeX, because several macros of the file 
% are based on LaTeX commands. 
%
% For the review of XyMTeX, see
%  (1)  Shinsaku Fujita, ``Typesetting structural formulas with the text
%    formatter TeX/LaTeX'', Computers and Chemistry, in press.    
% The following book deals with an application of TeX/LaTeX to 
% preparation of manuscripts of chemical fields:
%  (2)  Shinsaku Fujita, ``LaTeX for Chemists and Biochemists'' 
%    Tokyo Kagaku Dozin, Tokyo (1993) [in Japanese].  
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'. 
% The Current Maintainer of this work is Shinsaku Fujita.
%
% This work consists of the files bondcolor.dtx and bondcolor.ins
% and the derived file lewisstruc.sty.
%
% Please report any bugs, comments, suggestions, etc. to:
%   Shinsaku Fujita, 
%   Shonan Institute of Chemoinformatics and Mathematical Chemistry
%   Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun, Kanagawa 250-0019 Japan
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{bondcolor}
% \def\versi@ndate{October 01, 2010}
% \def\versi@nno{ver5.00}
% \def\copyrighth@lder{SF}% Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \fi
%
% \CheckSum{960}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
% \setcounter{StandardModuleDepth}{1}
%
% \StopEventually{}
% \MakeShortVerb{\|}
%
% \iffalse
% \changes{v5.00}{2010/10/01}{First release for XyMTeX5.00}
% \fi
%
% \iffalse
%<*driver>
\NeedsTeXFormat{pLaTeX2e}
% \fi
\ProvidesFile{bondcolor.dtx}[2010/10/01 v5.00 bondcolor package file]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{lewisstruc.dtx}
%
% %%XyMTeX Logo: Definition 2%%%
\def\UPSILON{\char'7}
\def\XyM{X\kern-.30em\smash{%
\raise.50ex\hbox{\UPSILON}}\kern-.30em{M}}
\def\XyMTeX{\XyM\kern-.1em\TeX}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Bond Coloring by {\sffamily bondcolor.sty} 
(\fileversion) of \XyMTeX{}}
\author{Shinsaku Fujita \\ 
Shonan Institute of Chemoinformatics and 
Mathematical Chemistry \\
Kanagawa, 258-0019 Japan 
}
\date{\filedate}
%
\begin{document}
   \maketitle
   \DocInput{bondcolor.dtx}
\end{document}
%</driver>
% \fi
%
% \section{Introduction}\label{bondcolor:intro}
%
% \subsection{Options for {\sffamily docstrip}}
%
% \DeleteShortVerb{\|}
% \begin{center}
% \begin{tabular}{|l|l|}
% \hline
% \emph{option} & \emph{function}\\ \hline
% bondcolor & bondcolor.sty \\
% driver & driver for this dtx file \\
% \hline
% \end{tabular}
% \end{center}
% \MakeShortVerb{\|}
%
% \subsection{Version Information}
%
%    \begin{macrocode}
%<*bondcolor>
\typeout{Part of XyMTeX for Drawing Chemical Structural Formulas. Version 5.00}
\typeout{       -- Released October 01, 2010 by Shinsaku Fujita}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\j@urnalname{bondcolor}
\def\versi@ndate{October 01, 2010}
\def\versi@nno{ver5.00}
\def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\typeout{XyMTeX Macro File `\j@urnalname' (\versi@nno) <\versi@ndate>%
\space[\copyrighth@lder]}
%    \end{macrocode}
%
%    \begin{macrocode}
\RequirePackage{chemstr}
\RequirePackage{hetarom}
\RequirePackage{hetaromh}
\RequirePackage{methylen}
%    \end{macrocode}
%
% \section{Substitution Bond Coloring}
%
% \begin{macro}{\ifcolorBLsw}
% A switch |\ifcolorBLsw| is introduced to judging whether the present process 
% is in BONDLIST or in ATOMLIST.  
% 
%    \begin{macrocode}
\newif\ifcolorBLsw \colorBLswfalse
%    \end{macrocode}
% \end{macro}
% 
% The macro |\RightAtomBond| is defined to color substitution bonds (and substituents), 
% when it is to be designated in ATOMLIST or in BONDLIST of a command for drawing 
% a structural formula.  
%
% \begin{verbatim}
%   \RightAtomBond(x,y)[COLOR]<CLIPPING>{SUBSTLIST}
% \end{verbatim}
%
% The first optional argument (x,y) represents increments of x-, and y-coordinates, 
% which may be added if adjustment is necessary. The default value is (0,0). 
% The second optional argument [COLOR] is a command of coloring (e.g., |\red|). 
% The default value is |\black|. 
% The third optional argument <CLIPPING> accomodates \verb/<s>/ for non-clipping and 
% a vacant or omitted argument represents a clipping of a corner. 
% The defalt value is a vacant value. 
% The fourth argument is a SUBSLIST, in which a substitution number 1--8 represents 
% a bond slope to be drawn. Slopes to cover a right-handed half circle are numbered 
% on a similar line to those of the |\ryl| macro, as follows: 
% \begin{verbatim}
%     SLOPE    
%       
%       1      : (0,1)
%       2      : (3,5)
%       3      : (1,1)
%       4      : (1,0)
%       5      : (5,-3)
%       6      : (1,-1)
%       7      : (3,-5)
%       8      : (0,-1)
% \end{verbatim}
% As for the format of the SUBSLIST, see the specification of the |\ryl| command. 
%
% \begin{macro}{\RightAtomBond}
% \begin{macro}{\Right@tomBond}
% \begin{macro}{\Right@tomB@nd}
% \begin{macro}{\Right@t@mB@nd}
%    \begin{macrocode}
\def\RightAtomBond{%
\@ifnextchar({\Right@tomBond}{\Right@tomBond(0,0)}}
\def\Right@tomBond(#1,#2){%
\@ifnextchar[{\Right@tomB@nd(#1,#2)}{\Right@tomB@nd(#1,#2)[\black]}}
\def\Right@tomB@nd(#1,#2)[#3]{%
\@ifnextchar<{\Right@t@mB@nd(#1,#2)[#3]}{\Right@t@mB@nd(#1,#2)[#3]<>}}
\def\Right@t@mB@nd(#1,#2)[#3]<#4>#5{%
\begingroup
\global\let\FuseWarning=\futileFuseWarning
\let\setbscolor=#3\relax
\@ifundefined{@tmpb}{\edef\@tmpb{0}}{}%dummy
\@ifundefined{@@tmpa}{\colorBLswfalse}{\if\@@tmpa @\relax\else
\edef\@@tmpa{a}\colorBLswtrue\fi}%enforced setting
%\@tempcntXa=\z@ \@tempcntYa=\z@
\@tempcntXa=#1\relax \@tempcntYa=#2\relax
\if\@tmpb s\relax
  \@clipfusefalse
\else
 \if#4s\relax
  \@clipfusefalse
 \else
   \ifcolorBLsw
     \@clipfusetrue
     \advance\@tempcntXa by5\relax%tentative value
     \advance\@tempcntYa by-15\relax%tentative value
   \colorBLswfalse
  \else
   \@clipfusetrue
   \advance\@tempcntXa by40\relax%tentative value
   \advance\@tempcntYa by38\relax%tentative value
\fi\fi\fi
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\@forsemicol\member:=#5\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}%
\let\local@tmpa=\@tmpa%global to local 2002/5/30 by SF
\ifcase\local@tmpa%
\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{{\setbscolor\setatombonda}\addbscolor{}{}}%2010/10/01% 0 (upward) (0,1)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondF}\addbscolor{}{}}%2010/10/01%%1 (3,5)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondA}\addbscolor{}{}}%2010/10/01%%2 (1,1)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondf}\addbscolor{}{}}%2010/10/01%%3 (5,3)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondb}\addbscolor{}{}}%2010/10/01%%4 (1,0)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombonde}\addbscolor{}{}}%2010/10/01%%5 (5,-3)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondB}\addbscolor{}{}}%2010/10/01%\or%6 (1,-1)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondE}\addbscolor{}{}}%2010/10/01%%7 (3,-5)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondc}\addbscolor{}{}}%2010/10/01%%8 (0,-1)
\fi%end of ifcase
\fi}\endgroup}%end of definition of \RightAtomBond 
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The macro |\LeftAtomBond| is defined to color substitution bonds (and substituents), 
% when it is to be designated in ATOMLIST or in BONDLIST of a command for drawing 
% a structural formula.  
%
% \begin{verbatim}
%   \LeftAtomBond(x,y)[COLOR]<CLIPPING>{SUBSTLIST}
% \end{verbatim}
%
% The first optional argument (x,y) represents increments of x-, and y-coordinates, 
% which may be added if adjustment is necessary. The default value is (0,0). 
% The second optional argument [COLOR] is a command of coloring (e.g., |\red|). 
% The default value is |\black|. 
% The third optional argument <CLIPPING> accomodates \verb/<s>/ for non-clipping and 
% a vacant or omitted argument represents a clipping of a corner. 
% The defalt value is a vacant value. 
% The fourth argument is a SUBSLIST, in which a substitution number 1--8 represents 
% a bond slope to be drawn. Slopes to cover a left-handed half circle are numbered 
% on a similar line to those of the |\lyl| macro, as follows: 
%
% \begin{verbatim}
%     SLOPE 
%       1      : (0,1)
%       2      : (-3,5)
%       3      : (-1,1)
%       4      : (-1,0)
%       5      : (-5,-3)
%       6      : (-1,-1)
%       7      : (-3,-5)
%       8      : (0,-1)
% \end{verbatim}
% As for the format of the SUBSLIST, see the specification of the |\lyl| command. 
%
% \begin{macro}{\LeftAtomBond}
% \begin{macro}{\Left@tomBond}
% \begin{macro}{\Left@tomB@nd}
% \begin{macro}{\Left@t@mB@nd}
%    \begin{macrocode}
\def\LeftAtomBond{%
\@ifnextchar({\Left@tomBond}{\Left@tomBond(0,0)}}
\def\Left@tomBond(#1,#2){%
\@ifnextchar[{\Left@tomB@nd(#1,#2)}{\Left@tomB@nd(#1,#2)[\black]}}
\def\Left@tomB@nd(#1,#2)[#3]{%
\@ifnextchar<{\Left@t@mB@nd(#1,#2)[#3]}{\Left@t@mB@nd(#1,#2)[#3]<>}}
\def\Left@t@mB@nd(#1,#2)[#3]<#4>#5{%
\begingroup
\global\let\FuseWarning=\futileFuseWarning
\let\setbscolor=#3\relax
\@ifundefined{@tmpb}{\edef\@tmpb{0}}{}%dummy
\@ifundefined{@@tmpa}{\colorBLswfalse}{\if\@@tmpa @\relax\else
\edef\@@tmpa{a}\colorBLswtrue\fi}%enforced setting
%\@tempcntXa=\z@ \@tempcntYa=\z@
\@tempcntXa=#1\relax \@tempcntYa=#2\relax
\if\@tmpb s\relax
  \@clipfusefalse
\else
 \if#4s\relax
  \@clipfusefalse
 \else
   \ifcolorBLsw
     \@clipfusetrue
     \advance\@tempcntXa by5\relax%tentative value
     \advance\@tempcntYa by-15\relax%tentative value
   \colorBLswfalse
  \else
   \@clipfusetrue
   \advance\@tempcntXa by40\relax%tentative value
   \advance\@tempcntYa by38\relax%tentative value
\fi\fi\fi
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\@forsemicol\member:=#5\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}%
\let\local@tmpa=\@tmpa%global to local 2002/5/30 by SF
\ifcase\local@tmpa%
\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{{\setbscolor\setatombonda}\addbscolor{}{}}%2010/10/01% 0 (upward) (0,1)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondD}\addbscolor{}{}}%2010/10/01%%1 (-3,5)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondH}\addbscolor{}{}}%2010/10/01%%2 (-1,1)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondd}\addbscolor{}{}}%2010/10/01%%3 (-5,3)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondh}\addbscolor{}{}}%2010/10/01%%4 (-1,0)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondg}\addbscolor{}{}}%2010/10/01%%5 (-5,-3)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondC}\addbscolor{}{}}%2010/10/01%%6 (-1,-1)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondG}\addbscolor{}{}}%2010/10/01%%7 (-3,-5)
\or{\setbscolor\Put@Direct(\the\@tempcntXa,\the\@tempcntYa)%
{\setatombondc}\addbscolor{}{}}%2010/10/01%%8 (0,-1)
\fi%end of ifcase
\fi}\endgroup}%end of definition of \LeftAtomBond 
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Double Bond Coloring}
% 
% \begin{macro}{\addvbonda etc.}
% Basic commands \verb/\addvbonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing six-membered vertical-type structural formulas, where 
% the letter \texttt{v} of \texttt{add--v--bond--a} means a vertical type. 
% The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addvbonda{\put(0,-406){\bonda}}
\def\addvbondb{\put(-171,-303){\bondb}}
\def\addvbondc{\put(-171,-103){\bondc}}
\def\addvbondd{\put(0,0){\bondd}}
\def\addvbonde{\put(171,-103){\bonde}}
\def\addvbondf{\put(171,-303){\bondf}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addvibonda etc.}
% Basic commands \verb/\addvibonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing six-membered inverse-vertical-type structural formulas, 
% where the letter \texttt{vi} 
% of \texttt{add--vi--bond--a} means an inverse vertical type. 
% The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addvibonda{\put(0,0){\bondc}}
\def\addvibondb{\put(-171,-103){\bondb}}
\def\addvibondc{\put(-171,-303){\bonda}}
\def\addvibondd{\put(0,-406){\bondf}}
\def\addvibonde{\put(171,-303){\bonde}}
\def\addvibondf{\put(171,-103){\bondd}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addhbonda etc.}
% Basic commands \verb/\addhbonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing six-membered horizontal-type structural formulas, 
% where the letter \texttt{h} 
% of \texttt{add--h--bond--a} means a horizontal type. 
% The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addhbonda{\put(0,0){\hbonda}}
\def\addhbondb{\put(-103,-171){\hbondb}}
\def\addhbondc{\put(-303,-171){\hbondc}}
\def\addhbondd{\put(-406,0){\hbondd}}
\def\addhbonde{\put(-303,171){\hbonde}}
\def\addhbondf{\put(-103,171){\hbondf}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addhibonda etc.}
% Basic commands \verb/\addhibonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing six-membered inverse horizontal-type structural formulas, 
% where the letter \texttt{hi} 
% of \texttt{add--hi--bond--a} means an inverse horizontal type. 
% The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addhibonda{\put(-403,0){\hbondc}}
\def\addhibondb{\put(-303,-171){\hbondb}}
\def\addhibondc{\put(-103,-171){\hbonda}}
\def\addhibondd{\put(0,0){\hbondf}}
\def\addhibonde{\put(-103,171){\hbonde}}
\def\addhibondf{\put(-303,171){\hbondd}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addvvbonda etc.}
% Basic commands \verb/\addvvbonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing five-membered vertical-type structural formulas, where 
% the first letter \texttt{v} of \texttt{add--v--v--bond--a} means 
% a five-membered ring (roman numeral) and the latter \texttt{v} 
% means a vertical type. 
% The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addvvbonda{\put(0,0){\bondc}}
\def\addvvbondb{\put(-171,-103){\bondb}}
\def\addvvbondc{\put(-171,-103){\bondhoriz}}
\def\addvvbondd{\put(171,-303){\bonde}}
\def\addvvbonde{\put(171,-103){\bondd}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addvvibonda etc.}
% Basic commands \verb/\addvvibonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing five-membered inverse vertical-type structural formulas, where 
% the first letter \texttt{v} of \texttt{add--v--vi--bond--a} means 
% a five-membered ring (roman numeral) and the latter \texttt{vi} 
% means an inverse vertical type. The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addvvibonda{\put(0,-406){\bonda}}
\def\addvvibondb{\put(-171,-303){\bondb}}
\def\addvvibondc{\put(-171,-103){\bondhorizi}}
\def\addvvibondd{\put(171,-103){\bonde}}
\def\addvvibonde{\put(171,-303){\bondf}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addvhbonda etc.}
% Basic commands \verb/\addvhbonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing five-membered horizontal-type structural formulas, where 
% the first letter \texttt{v} of \texttt{add--v--h--bond--a} means 
% a five-membered ring (roman numeral) and the latter \texttt{h} 
% means a horizontal type. 
% The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addvhbonda{\put(-403,0){\hbondc}}
\def\addvhbondb{\put(-303,-171){\hbondb}}
\def\addvhbondc{\put(-303,-171){\hbondvert}}
%\def\addvhbondd{\put(0,0){\hbondf}}
\def\addvhbondd{\put(-103,171){\hbonde}}
\def\addvhbonde{\put(-303,171){\hbondd}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addvhibonda etc.}
% Basic commands \verb/\addvhibonda/ etc. are used to add 
% colored double bonds in commands of 
% drawing five-membered inverse horizontal-type structural formulas, where 
% the first letter \texttt{v} of \texttt{add--v--hi--bond--a} means 
% a five-membered ring (roman numeral) and the latter \texttt{hi} 
% means an inverse horizontal type. The suffix \texttt{a} is a bond specifier. 
%    \begin{macrocode}
\def\addvhibonda{\put(0,0){\hbonda}}
\def\addvhibondb{\put(-103,-171){\hbondb}}
\def\addvhibondc{\put(-303,-171){\hbondverti}}
%\def\addvhibondd{\put(-406,0){\hbondd}}
\def\addvhibondd{\put(-303,171){\hbonde}}
\def\addvhibonde{\put(-103,171){\hbondf}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\MethyleneBonda etc.}
% Basic commands \verb/\MethyleneBonda/ etc. are used to add 
% colored double bonds in commands of drawing dimethylene to decamethylene units 
% of normal type, where the suffix \texttt{a}, etc. are bond specifiers. 
%    \begin{macrocode}
\def\MethyleneBonda{\Put@Direct(171,-303){\bondA}}
\def\MethyleneBondb{\Put@Direct(0,-406){\bondB}}
\def\MethyleneBondc{\Put@Direct(171,-303){\bondA}}
\def\MethyleneBondd{\Put@Direct(0,-406){\bondB}}
\def\MethyleneBonde{\Put@Direct(171,-303){\bondA}}
\def\MethyleneBondf{\Put@Direct(0,-406){\bondB}}
\def\MethyleneBondg{\Put@Direct(171,-303){\bondA}}
\def\MethyleneBondh{\Put@Direct(0,-406){\bondB}}
\def\MethyleneBondi{\Put@Direct(171,-303){\bondA}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\MethyleneBondA etc.}
% Basic commands \verb/\MethyleneBondA/ etc. are used to add 
% colored double bonds in commands of drawing dimethylene to decamethylene units 
% of normal type, where the suffix \texttt{A}, etc. are bond specifiers. 
% A double bond corresponding to the suffix \texttt{A} appears an alternate side 
% the counterpart due to the suffix \texttt{a}. 
%    \begin{macrocode}
\def\MethyleneBondA{\Put@Direct(0,-406){\bondAA}}
\def\MethyleneBondB{\Put@Direct(-171,-303){\bondBB}}
\def\MethyleneBondC{\Put@Direct(0,-406){\bondAA}}
\def\MethyleneBondD{\Put@Direct(-171,-303){\bondBB}}
\def\MethyleneBondE{\Put@Direct(0,-406){\bondAA}}
\def\MethyleneBondF{\Put@Direct(-171,-303){\bondBB}}
\def\MethyleneBondG{\Put@Direct(0,-406){\bondAA}}
\def\MethyleneBondH{\Put@Direct(-171,-303){\bondBB}}
\def\MethyleneBondI{\Put@Direct(0,-406){\bondAA}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\MethyleneiBonda etc.}
% Basic commands \verb/\MethyleneiBonda/ etc. are used to add 
% colored double bonds in commands of drawing dimethylene to decamethylene units 
% of inverse type, where the suffix \texttt{a}, etc. are bond specifiers. 
%    \begin{macrocode}
\def\MethyleneiBonda{\Put@Direct(171,-103){\bondAi}}
\def\MethyleneiBondb{\Put@Direct(0,0){\bondBi}}
\def\MethyleneiBondc{\Put@Direct(171,-103){\bondAi}}
\def\MethyleneiBondd{\Put@Direct(0,0){\bondBi}}
\def\MethyleneiBonde{\Put@Direct(171,-103){\bondAi}}
\def\MethyleneiBondf{\Put@Direct(0,0){\bondBi}}
\def\MethyleneiBondg{\Put@Direct(171,-103){\bondAi}}
\def\MethyleneiBondh{\Put@Direct(0,0){\bondBi}}
\def\MethyleneiBondi{\Put@Direct(171,-103){\bondAi}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\MethyleneiBondA etc.}
% Basic commands \verb/\MethyleneiBondA/ etc. are used to add 
% colored double bonds in commands of drawing dimethylene to decamethylene units 
% of inverse type, where the suffix \texttt{A}, etc. are bond specifiers. 
% A double bond corresponding to the suffix \texttt{A} appears an alternate side 
% the counterpart due to the suffix \texttt{a}. 
%    \begin{macrocode}
\def\MethyleneiBondA{\Put@Direct(0,0){\bondAAi}}
\def\MethyleneiBondB{\Put@Direct(-171,-103){\bondBBi}}
\def\MethyleneiBondC{\Put@Direct(0,0){\bondAAi}}
\def\MethyleneiBondD{\Put@Direct(-171,-103){\bondBBi}}
\def\MethyleneiBondE{\Put@Direct(0,0){\bondAAi}}
\def\MethyleneiBondF{\Put@Direct(-171,-103){\bondBBi}}
\def\MethyleneiBondG{\Put@Direct(0,0){\bondAAi}}
\def\MethyleneiBondH{\Put@Direct(-171,-103){\bondBBi}}
\def\MethyleneiBondI{\Put@Direct(0,0){\bondAAi}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\adddbcolor}
% The user command \verb/\adddbcolor/ is used to specify a color of 
% a double bond to be changed. The first argument specifies types of 
% structures to be drawn by designating \texttt{v}, \texttt{vi}, etc. 
% The vacant argument and \texttt{i} correspond to polymethylene units 
% defined in \textsf{methylen} package. 
% The second argument specifies a color to be changed. 
% The command \verb/\adddbcolor/ is placed in a bond list. 
%    \begin{macrocode}
\def\adddbcolor#1#2{%
\global\let\FuseWarning=\futileFuseWarning
\global\@dbondcolortrue
\edef\@@tmpBondSp{#1}%
\edef\@@tmpBondSpi{i}%
\ifx\@@tmpBondSp\empty\relax%\tetrahemethylene etc.
{\Put@Direct(0,0){#2\expandafter\csname MethyleneBond\@@tmpa\endcsname}}%
\else\ifx\@@tmpBondSp\@@tmpBondSpi\relax%\tetramethyleni etc.
{\Put@Direct(0,0){#2\csname MethyleneiBond\@@tmpa\endcsname}}%
\else
{\Put@Direct(0,0){#2\csname add#1bond\@@tmpa\endcsname}}%
\fi\fi}
%    \end{macrocode}
% \end{macro}
%
% \section{Skeletal Bond Coloring}
%
% \begin{macro}{\addskbcolor}
% The user command \verb/\addskbcolor/ is used to specify a color of 
% a skeletal bond to be changed. The first argument specifies types of 
% structures to be drawn by designating \texttt{v}, \texttt{h}, etc. 
% The second argument specifies a color to be changed. 
% The command \verb/\addskbcolor/ is placed in a skeletal bond list. 
%    \begin{macrocode}
\def\addskbcolor#1#2{%
\iflongskbond
{#2\expandafter\csname\skbondreplace\endcsname}%
\else 
\if#1\empty\relax
{#2\expandafter\csname skbond\skbondreplace\endcsname}%
\else\if#1v\relax
{#2\expandafter\csname skbond\skbondreplace\endcsname}%
\else
{#2\expandafter\csname #1skbond\skbondreplace\endcsname}%
\fi\fi\fi%
\global\let\FuseWarning=\futileFuseWarning%for methylen package
\global\@dbondcolortrue%for heterarom and heteraromh packages
}
%
%\def\addskbcolor#1#2{%
%      \edef\@@tmpsBondSp{#1}%
%      \edef\@@tmpsBondSpv{v}%
%\iflongskbond
%{#2\expandafter\csname\skbondreplace\endcsname}%
%\else 
%\ifx\@@tmpsBondSp\empty\relax
%{#2\expandafter\csname skbond\skbondreplace\endcsname}%
%\else\ifx\@@tmpsBondSp\@@tmpsBondSpv\relax
%{#2\expandafter\csname skbond\skbondreplace\endcsname}%
%\else
%{#2\expandafter\csname #1skbond\skbondreplace\endcsname}%
%\fi\fi\fi%
%\global\let\FuseWarning=\futileFuseWarning%for methylen package
%\global\@dbondcolortrue%for heterarom and heteraromh packages
%}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\red etc.}
% \changes{v5.00}{2010/10/01}{Colors for TeX/LaTeX mode}
%    \begin{macrocode}
\def\red{\color{red}}
\def\blue{\color{blue}}
\def\green{\color{green}}
\def\black{\color{black}}
\def\cyan{\color{cyan}}
\def\yellow{\color{yellow}}
\def\magenta{\color{magenta}}
\def\white{\color{white}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\xymcolor}
% \begin{macro}{\red etc.}
% These macros are defined to avoid \texttt{**Warning** color stack underflow} 
% during processing by the dvipdfmx converter. 
% \changes{v5.00}{2010/10/01}{Added: Colors for TeX/LaTeX mode}
%    \begin{macrocode}
\def\xymcolor#1#2{\mbox{\color{#1}#2}}
\def\redx#1{\xymcolor{red}{#1}}
\def\bluex#1{\xymcolor{blue}{#1}}
\def\greenx#1{\xymcolor{green}{#1}}
\def\blackx#1{\xymcolor{black}{#1}}
\def\cyanx#1{\xymcolor{cyan}{#1}}
\def\yellowx#1{\xymcolor{yellow}{#1}}
\def\magentax#1{\xymcolor{magenta}{#1}}
\def\whitex#1{\xymcolor{white}{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Color@@Line}
% \begin{macro}{\Color@Line}
% \changes{v5.00}{2010/10/01}{Colors for TeX/LaTeX mode}
% The |\Color@Line| macro is used to erase an old line by setting color to be white. 
%    \begin{macrocode}
\def\Color@@Line{%
\@ifnextchar[{\C@lor@@Line}{\C@lor@@Line[0.4pt]}}
\def\C@lor@@Line[#1](#2,#3)(#4,#5)#6#7{%
\begingroup
\@tempdima=#1\relax
\ifdim\@tempdima=0.4pt\else
\XyMTeXWarning{The line width is ineffective for TeX/LaTeX mode}%
\fi
\put(0,0){\csname #7\endcsname \Put@Line(#2,#3)(#4,#5){#6}}%
\endgroup}%end of \Color@@Line
\let\Color@Line=\Color@@Line%for TeX/LaTeX mode
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\replaceSKbond}
% The user command \verb/\replaceSKbond/ is used to specify a color of 
% a skeletal bond to be changed. The first optional argument specifies 
% the bond width to be changed if necessary. 
% The arguments in the first pair of parentheses specify the original point. 
% The arguments in the second pair of parentheses specify the slope e.g., (5,3). 
% The next argument indicates the projection length to the x-axis. 
% The last argument indicates a color to be applied. 
% The command \verb/\replaceSKbond/ is placed in a bond list. 
%    \begin{macrocode}
\def\replaceSKbond{%
\@ifnextchar[{\repl@ceSKbond}{\repl@ceSKbond[0.4pt]}}
\def\repl@ceSKbond[#1](#2,#3)(#4,#5)#6#7{\begingroup%
\global\let\FuseWarning=\futileFuseWarning
\global\@dbondcolortrue
\def\thinLineWidth{#1}%
\@tempdima=#1 \advance\@tempdima by1.2pt
\put(0,0){\Color@Line[\the\@tempdima](#2,#3)(#4,#5){#6}{white}}%
\put(0,0){#7\Put@Line(#2,#3)(#4,#5){#6}}\endgroup}%
%
%\def\replaceSKbond{%
%\@ifnextchar[{\repl@ceSKbond}{\repl@ceSKbond[0.4pt]}}
%\def\repl@ceSKbond[#1](#2,#3)(#4,#5)#6#7{\begingroup%
%\global\let\FuseWarning=\futileFuseWarning
%\global\@dbondcolortrue
%\def\thinLineWidth{#1}%
%\@tempdima=#1 \advance\@tempdima by1.2pt
%\put(0,0){\edef\thinLineWidth{\the\@tempdima}\white\Put@Line(#2,#3)(#4,#5){#6}}%
%\put(0,0){#7\Put@Line(#2,#3)(#4,#5){#6}}\endgroup}%
%
\endinput
%</bondcolor>
%    \end{macrocode}
% \end{macro}
%
% \Finale
%
\endinput