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