%xymsubst.tex %Copyright (C) 1993, Shinsaku Fujita, All rights reserved. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %This file is a part of xymtex.tex that is the manual of the macro %package `XyMTeX' for drawing chemical structural formulas. %This file is not permitted to be translated into Japanese and any other %languages. \typeout{``xymsubst.tex''--- This file is a part of xymtex.tex that is the manual of the macro % package `XyMTeX'. 1993/12/1 S. Fujita} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Large Substituents} \section{Basic Ideas} In all of the preceding chapters, any substituents described in SUBSLIST are rather simple ones, which at most vary from an atom of one- or two-character to a group of several characters. How about such a complex substituent as produced by a macro? Let us consider the substitution of \begin{center} \bzdrv{1==OH;2=={$*$};4==OC$_{16}$H$_{33}$;5==CH$_{3}$} \end{center} at the 2-position ($*$)with the substituent represented by \begin{center} \bzdrh{1==NH--SO$_{2}$;2==OCH$_{2}$CH$_{2}$OCH$_{3}$;5==NO$_{2}$} \end{center} This task can be accomplished in the light of the technique introduced in the preceding chapter. Thus, the statement \begin{verbatim} \begin{picture}(2000,1000)(0,0) \put(0,0){\bzdrv{1==OH;2==;4==OC$_{16}$H$_{33}$;5==CH$_{3}$}} \put(993,230){\bzdrh{1==NH--SO$_{2}$;% 2==OCH$_{2}$CH$_{2}$OCH$_{3}$;5==NO$_{2}$}} \end{picture} \end{verbatim} provides \begin{center} \begin{picture}(2000,1000)(0,0) \put(0,0){\bzdrv{1==OH;2==;4==OC$_{16}$H$_{33}$;5==CH$_{3}$}} \put(993,230){\bzdrh{1==NH--SO$_{2}$;% 2==OCH$_{2}$CH$_{2}$OCH$_{3}$;5==NO$_{2}$}} \end{picture} \end{center} This methodology implies that both of the parts are regarded as fragments to be combined together. On the other hand, another useful technique is available, if you use the \TeX{} command \verb/\setbox/ and the related commands. In the light of this technique, either one is regarded as a substituent of the other. First, a structure regarded as a substituent is constructed in a \verb/\hbox/ and stored in \verb/\box4/ by means of the command \verb/\setbox/ as follows: \begin{verbatim} \setbox4=\hbox{% \begin{picture}(0,0)(-285,370)% % \put(-285,370){\circle{50}}%change reference point \put(0,0){\bzdrh{1==NH--SO$_{2}$;2==OCH$_{2}$CH$_{2}$OCH$_{3}$;% 5==NO$_{2}$}}% \end{picture}}% \end{verbatim} \setbox4=\hbox{% \begin{picture}(0,0)(-285,370)% %\put(-285,370){\circle{50}}% \put(0,0){\bzdrh{1==NH--SO$_{2}$;2==OCH$_{2}$CH$_{2}$OCH$_{3}$;% 5==NO$_{2}$}}% \end{picture}% }% The inner picture environment has the width of 0pt and the height of 0pt, where the reference point is shifted into the $(-285, 370)$ point which is the rightmost point of the NH--SO$_{2}$ group. This reference point is regared as the $(0, 0)$ point of the substituent stored in \verb/\box4/. Then, the substituent \verb/\box4/ is written in SUBSLIST of the command \verb/\bzdrv/, {\em i.e.}, \begin{verbatim} \bzdrv{1==OH;2==\box4;4==OC$_{16}$H$_{33}$;5==CH$_{3}$} \end{verbatim} This statement produces \begin{center} \begin{picture}(2000,1000)(0,0) \put(0,0){\bzdrv{1==OH;2==\copy4;4==OC$_{16}$H$_{33}$;5==CH$_{3}$}} \end{picture} \end{center} It should be noted that the token \verb/2==\box4/ creates such a complex fragment that is impossible to be directly assigned to an argument list. This technique is also useful to avoid the overcrowding of substituents, since the reference point of the substituent can be changed appropriately. When you multiple times use the stored substituent, you can use the command \verb/\copy/ instead of \verb/\box/: \begin{verbatim} \bzdrv{1==OH;2==\copy4;4==OC$_{16}$H$_{33}$;5==CH$_{3}$} \end{verbatim} Then, you are able to use the stored substituent in another context. \begin{verbatim} \setbox5=\hbox{% \bzdrv{1==OH;2==\box4;5==C$_{16}$H$_{33}$O;4==CH$_{3}$}}% \mbox{\box5} \end{verbatim} This statement provides another derivative having the same substituents. \setbox5=\hbox{% \bzdrv{1==OH;2==\box4;5==C$_{16}$H$_{33}$O;4==CH$_{3}$}}% \medskip \begin{center} \begin{picture}(2000,1000)(0,0) \put(0,0){\mbox{\box5}} \end{picture} \end{center} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Nested Substituents} The lastest sample reveals that a structure constructed by the present techique can be further nested to be a substituent of another macro. The following example illustrates multiple nesting for drawing the same dye releaser as depicted in the preceding chapter. First, the formula of 2-methanesulfonyl-4-nitro-phenyl-1-azo group (A) is constructed in the box \verb/\box4/ by means of following statement: % 370 = 400 - 30 (depth of letter=30) \begin{verbatim} \setbox4=\hbox{% \begin{picture}(0,0)(996,370)% % \put(996,370){\circle{50}}% \put(0,0){\bzdrh{1==O$_{2}$N;5==SO$_{3}$CH$_{3}$;4==N=N}}% \end{picture}}% \end{verbatim} Note that the value (996,370) shifts the reference point into the rightmost terminal of the azo group, which is a linking point in the next step. The formula (A) strored in \verb/\box4/ is placed at the 8-position of a naphalene ring. The resulting formula (B) is, in turn, stored into \verb/\box5/. \begin{verbatim} \setbox5=\hbox{% \begin{picture}(0,0)(-250,712)% % \put(-250,712){\circle{50}}% \put(0,0){\naphdrh{1==SO$_{2}$NH;5==OH;8==\box4}}% \end{picture}% }% \end{verbatim} The value $(-250,712)$ shifts the reference point into the leftmost terminal of the sulfonamido group at the 1-position of the naphthalene ring. The formula B an a sulfamoyl group are placed at the meta position of a benzen ring to produce formula C. \begin{verbatim} \setbox4=\hbox{% \begin{picture}(0,0)(-285,370)% % \put(-285,370){\circle{50}}% \put(0,0){\bzdrh{1==NH--SO$_{2}$;5==\box5}}% \end{picture}% }% \end{verbatim} The resulting formula C is further placed on another benzene ring to generate the formula (D) of a complex substituent. \begin{verbatim} \setbox5=\hbox{% \begin{picture}(0,0)(-285,370)% % \put(-285,370){\circle{50}}% \put(0,0){\bzdrh{1==NH--SO$_{2}$;2==OCH$_{2}$CH$_{2}$OCH$_{3}$;% 5==\box4}}% \end{picture}% }% \end{verbatim} Finally, the substituent D is placed at the ortho position to a hydroxyl group on a benzene ring. \begin{verbatim} \setbox4=\hbox{% \bzdrv{1==OH;2==\box5;4==OC$_{16}$H$_{33}$;5==CH$_{3}$}}% \mbox{\box4} \end{verbatim} The formula stored in \verb/\box4/ is printed by means of the command \verb/\box4/, giving the following structure. \setbox4=\hbox{% \begin{picture}(0,0)(996,370)% % \put(996,370){\circle{50}}% \put(0,0){\bzdrh{1==O$_{2}$N;5==SO$_{3}$CH$_{3}$;4==N=N}}% \end{picture}}% \setbox5=\hbox{% \begin{picture}(0,0)(-250,712)% % \put(-250,712){\circle{50}}% \put(0,0){\naphdrh{1==SO$_{2}$NH;5==OH;8==\box4}}% \end{picture}% }% \setbox4=\hbox{% \begin{picture}(0,0)(-285,370)% % \put(-285,370){\circle{50}}% \put(0,0){\bzdrh{1==NH--SO$_{2}$;5==\box5}}% \end{picture}% }% \setbox5=\hbox{% \begin{picture}(0,0)(-285,370)% % \put(-285,370){\circle{50}}% \put(0,0){\bzdrh{1==NH--SO$_{2}$;2==OCH$_{2}$CH$_{2}$OCH$_{3}$;% 5==\box4}}% \end{picture}% }% \setbox4=\hbox{% \bzdrv{1==OH;2==\box5;4==OC$_{16}$H$_{33}$;5==CH$_{3}$}}% \medskip \begin{center} \begin{picture}(4000,2000)(0,-1000) \put(0,0){\mbox{\box4}} \end{picture} \end{center} One of the merits of the present methodology is that we can use relative coordinates in each step of combining two structures. Hence, the calculation of coordinates is simpler than that based on the method of the preceding chapter. The structural formula of adonitoxin can be written in a similar way, where two complex substituents stored in \verb/\box0/ and \verb/\box1/ are placed on a steroid skeleton. \begin{verbatim} \setbox0=\hbox{% \begin{picture}(0,0)(369,257)% % \put(369,257){\circle{50}}% \put(0,0){\fiveheterov[e]{3==O}{4D==O}} \end{picture}}% \setbox1=\hbox{% \begin{picture}(0,0)(772,530)% % \put(772,530){\circle{50}}% \put(0,0){\pyranose{1Sb==O;1Sa==H;2Sb==H;2Sa==OH;3Sb==H;3Sa==OH;% 4Sb==HO;4Sa==H;5Sb==H;5Sa==CH$_{3}$}}% \end{picture}}% \setbox2=\hbox{% \steroid{{{10}}==\lmoiety{HCO\kern-.7em};{{14}}==OH;% {{13}}==\lmoiety{H$_{3}$C};% {{16}}==OH;{{17}}==\box0;3==\box1}}% \medskip \begin{center} %\fbox{ \begin{picture}(2500,1800)(-600,-300) \put(0,0){\mbox{\box2}} \end{picture} %} \end{center} \end{verbatim} These commands produce \setbox0=\hbox{% \begin{picture}(0,0)(369,257)% % \put(369,257){\circle{50}}% \put(0,0){\fiveheterov[e]{3==O}{4D==O}} \end{picture}}% \setbox1=\hbox{% \begin{picture}(0,0)(772,530)% % \put(772,530){\circle{50}}% \put(0,0){\pyranose{1Sb==O;1Sa==H;2Sb==H;2Sa==OH;3Sb==H;3Sa==OH;% 4Sb==HO;4Sa==H;5Sb==H;5Sa==CH$_{3}$}}% \end{picture}}% \setbox2=\hbox{% \steroid{{{10}}==\lmoiety{HCO\kern-.7em};{{14}}==OH;% {{13}}==\lmoiety{H$_{3}$C};% {{16}}==OH;{{17}}==\box0;3==\box1}}% \medskip \begin{center} %\fbox{ \begin{picture}(2500,1800)(-600,-300) \put(0,0){\mbox{\box2}} \end{picture} %} \end{center}