From jwe@emx.utexas.edu Thu Mar  8 10:25:48 1990
Posted-Date:  Thu, 8 Mar 90 01:49:33 -0600
To: morrison@cs.ubc.ca, dbuerger@cup.portal.com, rick@soma.neusc.bcm.tmc.edu,
        luis@rice.edu, HOMH@qucdn.queensu.ca,
        shahoumi%koh-sun5.usc.edu@usc.edu, naucse!naucse!jdc@cs.arizona.edu
Subject: TeX/LaTeX chemical formula macros

As promised, here are the chemical structure formula macros.  These
macros are described in

@ARTICLE (
 author = "Roswitha T. Haas and Kevin C. O'Kane",
  title = "Typesetting Chemical Structure Formulas with the Text 
           Formatter \TeX/\LaTeX",
journal = Computers \& Chemistry
   year = "1987",
 volume = "11",
 number = "4",
  pages = "251--271" )

I did not have anything to do with writing the macros, but have been
given permission to distribute them by one of the authors:

> Received: From ORNLSTC(POSTMAST) by UTCHPC with Jnet id 8507
>           for CHPF127@UTCHPC; Fri,  4 Aug 89 13:26 CST
> Date:     Fri,  4 Aug 89 14:25 EST
> Original_From:  IRAVAX::HAASR
> Subject:  Dr. Eaton's letter of July 28, 89
> To:       chpf127@utchpc
>
> Dr. Eaton, thank you for your letter of July 28, 1989.  I have no
> objections against submitting the chemical structure macros to the
> LaTeX style archive.
>                             Sincerely, Roswitha Haas


There is a significant amount of documentation that goes along with
the macros -- all together about 200k in macros and docs.

Let me know if you have any trouble unpacking the macros, or something
gets lost along the way.

Also, to Luis Soltero and Rick Gray:  Thanks for the offer to archive
the macros.  If you do end up putting them somewhere for anonymous
ftp, how about posting a note to the net?

I offered them to the Clarkson archive a while back, but I don't think
they were ever made available.  Apparently the manager of the
collection wanted a much shorter (?) documentation file.  As I am not
the author, I don't think it is really appropriate for me to chop up
the documentation.  In any case, I hope you find these useful.

--
John Eaton (not really a Dr. yet, but I hope to play one eventually)
jwe@emx.utexas.edu
Department of Chemical Engineering
The University of Texas at Austin
Austin, Texas  78712

-----------------------------------cut here----------------------------------
#!/bin/sh
#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
#
#	Run the following text with /bin/sh to create:
#	ReadMe
#	appdb.tex
#	appdc.tex
#	chap3a.tex
#	chap4.tex
#	chap5.tex
#	chap6a.tex
#	chap6b.tex
#	chap6c.tex
#	chap6d.tex
#	macros.tex
# This archive created: Fri Jun  9 15:56:18 1989
cat << \SHAR_EOF > ReadMe
INSTRUCTIONS FOR THE USE OF THE CHEMICAL STRUCTURE TEX MACROS
AND THE TEX SOURCE FILES WITH DOCUMENTATION:

File macros.tex contains all the macros.  The other files are also TeX
source files and contain instructions and other useful information.
The files called chap*.tex are chapters from my thesis.  Files
appdb.tex and appdc.tex contain information on numeric values of
coordinates in the structure diagrams and on slopes possible in LaTeX,
respectively.

To run a file like chap5.tex through TeX/LaTeX, you first have to look
at the \input statements at the beginning of the files and make sure
that these files are in your directory.  The easiest way to include
ALL macros would be a statement \input {macros.tex}.  Since I could
not do that on our system because of TeX memory limitations, I had to
put individual macros (or groups of macros) into separate files and
use statements such as \input{purine.tex} where file purine.tex
contains the macro (\newcommand) called purine.  Separate files such
as purine.tex are not part of the files sent to you now; you would
have to cut them out of macros.tex if necessary.

The macros called initial and reinit are always needed when the
chemical structure macros are used.

Author:

Roswitha Haas
EMCT Information Program
Oak Ridge National Laboratory
P.O. Box 2008
Oak Ridge, TN  37831-6050


Reference:

@ARTICLE (
 AUTHOR = "Roswitha T. Haas and Kevin C. O'Kane",
 TITLE = "Typesetting Chemical Structure Formulas with the Text Formatter
          \TeX/\LaTeX",
 JOURNAL = "Computers and Chemistry",
 YEAR = "1987",
 VOLUME = "11",
 NUMBER = "4",
 PAGES = "251--271" )
SHAR_EOF
cat << \SHAR_EOF > appdb.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \input{init.tex}
  \begin {document}    
  \setcounter{page}{118}
  \textfont1=\tenrm
 
 \centerline{APPENDIX B}
 \vspace{4mm}
 \centerline{COORDINATES OF POINTS OF ATTACHMENT}
 \vspace{4mm}
 
 The tables in this appendix list coordinates of points of
 attachment that will probably be used most frequently
 with the techniques described in chapter V.
  Table B.1 lists the coordinates of the six corners
 of the carbon sixring and the coordinates at the end of the six
 bonds extending from the sixring.
   
 \vspace{2mm}
 \centerline{Table B.1: Points of attachment in the sixring}
 \vspace{3mm}
 \hspace{1.8cm}
 \begin{minipage}{10cm}
 \begin{tabular}{|c|l|l|}
  \hline
  Sixring Position & Ring Corner & End of Bond \\
  \hline
  1                & \ (342,200)   & \ (470,277)   \\[-2mm]
  2                & \ (342,0)     & \ (470,-77)   \\[-2mm]
  3                & \ (171,-103)  & \ (171,-203)  \\[-2mm]
  4                & \ (0,0)       & \ (-128,-77)  \\[-2mm]
  5                & \ (0,200)     & \ (-128,277)  \\[-2mm]
  6                & \ (171,303)   & \ (171,403)   \\
  \hline
 \end{tabular}
\end{minipage}
     
 \vspace{4mm}
 The ring structures typeset by the macros 
 \verb+\+fivering, 
 \verb+\+naphth, 
 \verb+\+steroid, 
 \verb+\+hetifive, 
 \verb+\+heticifive, 
 \verb+\+pyrazole, 
 \verb+\+hetisix, 
 \verb+\+pyrimidine, and
 \verb+\+purine have identical coordinates at positions that are
 equivalent to the sixring positions in regard to the printed
 diagram. (The position numbers are not necessarily the same
 as those of the sixring.)
  \newpage
 Table B.2 lists the coordinates of other points of attachment
 in structures typeset by various macros.
       
\vspace{2mm}
 \centerline{Table B.2: Points of attachment in various structures}

 \vspace{3mm}
 \hspace{1.1cm}
 \begin{minipage}{11cm}
 \begin{tabular}{|l|l|l|}
  \hline
  \ Macro             & Position Description      & Coordinates \\
  \hline
  \verb+\+cbranch   & begin of left bond        & \ (-150,33) \\[-2mm]
  \verb+\+cbranch   & end of right bond         & \ (230,33)  \\[-2mm]
  \verb+\+cright    & begin of left bond        & \ (-150,33) \\[-2mm]
  \verb+\+cleft     & end of right bond         & \ (230,33)  \\[-2mm]
  \verb+\+chemup    & end of vertical bond      & \ (33,-150) \\[-2mm]
  \verb+\+cdown     & end of vertical bond      & \ (33,220)  \\[-2mm]
  \verb+\+threering & ring position 1           & \ (300,0)   \\[-2mm]
  \verb+\+threering & end of bond on 1          & \ (428,77)  \\[-2mm]
  \verb+\+naphth    & ring position 1           & \ (513,303) \\[-2mm]
  \verb+\+naphth    & end of bond on 1          & \ (513,403) \\[-2mm]
  \verb+\+naphth    & ring position 2           & \ (684,200) \\[-2mm]
  \verb+\+naphth    & end of bond on 2          & \ (812,277) \\[-2mm]
  \verb+\+steroid   & end of vert. bond on 17   & \ (1026,706)\\[-2mm]
  \verb+\+hetthree  & end of bond on 3          & \ (580,30)  \\[-2mm]
  \verb+\+pyranose  & end of alpha bond         & \ (688,100) \\[-2mm]
  \verb+\+pyranose  & end of beta bond          & \ (688,-100)\\[-2mm]
  \verb+\+furanose  & end of alpha bond         & \ (553,-63) \\[-2mm]
  \verb+\+furanose  & end of beta bond          & \ (553,63)  \\[-2mm]
  \verb+\+furanose  & end of vert. long bond    & \ (448,380) \\[-2mm]
  \verb+\+purine    & point below N(9)          & \ (513,-130)\\[-2mm]
  \verb+\+fuseiv    & upper point of attachment & \ (0,200)   \\[-2mm]
  \verb+\+fuseiv    & lower point of attachment & \ (0,0)     \\[-2mm]
  \verb+\+fuseup    & upper point of attachment & \ (-171,303)\\[-2mm]
  \verb+\+fuseup    & lower point of attachment & \ (0,200)   \\[-2mm]
  \verb+\+fuseiii   & upper point of attachment & \ (0,200)   \\[-2mm]
  \verb+\+fuseiii   & lower point of attachment & \ (0,0) \\
  \hline
  \end{tabular}
  \end{minipage}

 \end{document}
SHAR_EOF
cat << \SHAR_EOF > appdc.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \renewcommand{\baselinestretch}{1.5}
  \setlength{\parindent}{1cm}
  \raggedbottom
  \setlength{\itemsep}{-2mm}
  \input{init.tex}
  \begin {document}    
  \setcounter{page}{120}
  \initial
 
 \centerline{APPENDIX C}
 \vspace{4mm}
 \centerline{SLOPES OF LINES DRAWN WITH LATEX}
 \vspace{4mm}

 Table C.1 lists the first quadrant slopes of lines that can be
 typeset with LaTeX, together with the corresponding degrees of
 angle. The integers ${\rm x_s}$ and ${\rm y_s}$ represent the 
 slope in LaTeX's line-drawing statement \\ 
 \centerline{$\backslash $put(x,y) \{$\backslash $line(${\rm x_s}$,${\rm y_s}$)
\{length\}\}. } Corresponding angles in the other quadrants can be
 generated by preceding ${\rm x_s}$ and/or ${\rm y_s}$ with 
 a minus sign.

 \centerline{Table C.1: Slopes of lines possible with LaTeX}
 
 \vspace{3mm}
 \hspace{3.1cm}
 \begin{minipage}{10cm}   
 \begin{tabular}{|l|l|l|}
       \hline
  ${\rm x_s}$, ${\rm y_s}$ & tan$\theta $(${\rm y_s}$/${\rm x_s}$) &
  $\theta $(degrees) \\
       \hline
  \ 1,0 & \ \ 0.00 & \ \ 0.0 \\[-3mm]
  \ 6,1 & \ \ 0.17 & \ \ 9.5 \\[-3mm]
  \ 5,1 & \ \ 0.20 & \ 11.3  \\[-3mm]
  \ 4,1 & \ \ 0.25 & \ 14.0  \\[-3mm]
  \ 3,1 & \ \ 0.33 & \ 18.5  \\[-3mm]
  \ 5,2 & \ \ 0.40 & \ 21.8  \\[-3mm]
  \ 2,1 & \ \ 0.50 & \ 26.5  \\[-3mm]
  \ 5,3 & \ \ 0.60 & \ 31.0  \\[-3mm]
  \ 3,2 & \ \ 0.67 & \ 33.7  \\[-3mm]
  \ 4,3 & \ \ 0.75 & \ 36.8  \\[-3mm]
  \ 5,4 & \ \ 0.80 & \ 38.7  \\[-3mm]
  \ 6,5 & \ \ 0.83 & \ 39.8  \\[-3mm]
  \ 1,1 & \ \ 1.00 & \ 45.0  \\[-3mm]
  \ 5,6 & \ \ 1.20 & \ 50.2  \\[-3mm]
  \ 4,5 & \ \ 1.25 & \ 51.3  \\[-3mm]
  \ 3,4 & \ \ 1.33 & \ 53.2  \\[-3mm]
  \ 2,3 & \ \ 1.50 & \ 56.3  \\[-3mm]
  \ 3,5 & \ \ 1.67 & \ 59.0  \\[-3mm]
  \ 1,2 & \ \ 2.00 & \ 63.5  \\[-3mm]
  \ 2,5 & \ \ 2.50 & \ 68.2  \\[-3mm]
  \ 1,3 & \ \ 3.00 & \ 71.5  \\[-3mm]
  \ 1,4 & \ \ 4.00 & \ 76.0  \\[-3mm]
  \ 1,5 & \ \ 5.00 & \ 78.7  \\[-3mm]
  \ 1,6 & \ \ 6.00 & \ 80.5  \\[-3mm]
  \ 0,1 & \ \ $\infty $& \ 90.0 \\
       \hline
 \end{tabular}
 \end{minipage}


 \end{document}
 





SHAR_EOF
cat << \SHAR_EOF > chap3a.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{4}   
  \setcounter{topnumber}{2}     
  \setcounter{bottomnumber}{2}
  \renewcommand{\topfraction}{.5}
  \renewcommand{\bottomfraction}{.5}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \input{init.tex}
  \input{bonds.tex}
  \input{six.tex}
  \input{cright.tex}
  \input{cdown.tex}
  \input{tbranch.tex}
  \input{cto.tex}
  \input{cbranch.tex}
  \input{hetthreea.tex}
  \input{threering.tex}
  \begin {document}    
  \setcounter{page}{11}
  \textfont1=\tenrm
  \initial
  \setcounter{chapter}{3}
 
 \centerline{CHAPTER III}
 \vspace{0.4cm}
 \centerline{TEX/LATEX CODE FOR COMPONENTS OF ORGANIC}
 \centerline{CHEMICAL STRUCTURE DIAGRAMS}
 \vspace{0.4cm}
 \centerline{1. CONVENTIONS FOR DRAWING THE DIAGRAMS}
 \vspace{0.4cm}

 The chemical structure of a molecule is defined by the spatial
 arrangement of the atoms and the bonding between them.
 Chemists use several standard methods for representing the
 structures two-dimensionally by diagrams called structural
 formulas; and this thesis will develop mechanisms for printing
 such diagrams using the TeX/LaTeX system.

 A very common structure representation, sometimes called a
 dash structural formula, uses the element symbols for the 
 atoms and a dash for each covalent bond in the compound.
 Thus the dash represents the pair of shared electrons that
 constitutes the bond. Two dashes ($=$) represent a double
 bond and three dashes ($\equiv $) a triple bond. ---
 It is usually neither necessary nor practical to represent
 each bond in a molecule explicitly by a dash. 
 Some molecules and some bonds are so common that a complete
 dash formula would not be used except at a very introductory
 level of presenting chemical information. 
 A condensed structural formula is one alternative. It does
 not contain dashes but uses the convention that atoms
 bonded to a carbon are written immediately after that
 carbon and otherwise atoms are written from left to right
 in the order in which they occur in the real structure.
 The following two structural formulas are a dash formula
 and a condensed formula, respectively, for the same
 compound, ethanol.  
 \vspace{-0.5cm}
 \[ \parbox{4.5cm} {
    \begin{picture}(400,900)(0,-110)
     \put(0,0)   {\cbranch{H}{S}{H}{S}{C}{S}{}{S}{H} }
     \put(240,0) {\cbranch{H}{S}{}{Q}{C}{S}{O---H}{S}{H} }
    \end{picture}  }
    \hspace{1.5cm}
    {\rm CH_{3}CH_{2}OH}  \]
 \newpage
 Multiple bonds are usually not implied unless a very common
 group, such as the cyano group, is shown. It can be found
 as -C$\equiv $N or simply as -CN.

 Another alternative to a complete dash formula is a diagram
 where the symbols for carbon and for hydrogen on carbon are
 not shown. Each corner and each open-ended bond in these
 diagrams implies a carbon atom with as many hydrogen
 atoms bonded to it as there are free valences. This
 representation is the customary one for ring structures
 (structures with a closed chain of atoms). Thus, the
 following two diagrams both represent the compound
 cyclopropane.
 \[ \hetthree{Q}{H}{H}{H}{H}{S}{S}{C}
    \hspace{3cm}  \yi=330
    \threering{Q}{Q}{Q}{Q}{Q}{Q}{Q}{Q}{Q} \]

 \reinit
 The three different kinds of structure representation can
 be combined in one diagram, such that in part of the
 diagram all bonds are represented by dashes and all
 atoms by an element symbol, in another part a condensed
 structural formula fragment is used, and in still
 another part a cyclic fragment with implied carbon
 and hydrogen atoms occurs.

 The rest of this chapter describes how LaTeX can be used
 to position and typeset the bond lines and condensed
 formula strings that are the components of structure
 diagrams.

 It should be mentioned that there are no binding rules
 for many aspects of the two-dimensional representations
 of a chemical structure. Structures and fragments of
 structures can be oriented in different ways depending
 on the availability of space, the emphasis given to
 a certain part of a structure, or the spatial
 relationship of the parts to each other.
 Thus, a cyclopropane ring can be represented in various
 orientations, $\bigtriangleup $, $\bigtriangledown $,
 and others. Also, the angles between
 the bond lines can be different in different representations
 of one and the same compound. Since most molecules do not
 have all their atoms lying in one plane it would not 
 even be possible to reproduce all bond angles in a   
 two-dimensional representation. The structures shown in    
 this thesis adopt the orientations and bond angles
 found to prevail in Solomons' textbook (Solomons 84),
 the organic chemistry text used for several years at
 the University of Tennessee.
 
 There are some methods to indicate the real,
 three-dimensional structure (the stereochemistry)
 of a molecule in the two-dimensional representation:
 A dashed line and a wedge instead of a full bond
 line mean that the real bond extends below or
 above the plane, respectively. 
 
 \vspace{4mm}
 \centerline{2. BOND LINE DRAWING AND POSITIONING}
 \vspace{0.4cm}
 \begin{flushleft}
  \underline{A. Review of TeX/LaTeX Facilities for Line-Drawing}
 \end{flushleft}
 
 The easiest way to produce horizontal and vertical lines representing
 chemical bonds is by the use of keyboard characters and simple control
 sequences provided by TeX.  By typing one, two, or three hyphens,
 a normal hyphen, a medium dash designed for number ranges, and a
 punctuation dash are produced, - -- ---, respectively. When a hyphen
 is typed in TeX's math mode, it is interpreted as a minus sign and
 the spacing around it will be different from text mode. ---
 The equal sign can represent a double bond for chemistry typesetting.
 It can be typed in text mode and in math mode, again resulting in   
 different spacing around the symbol. --- The control sequence
 \verb+\+equiv can be used as a triple bond ($\equiv $). It has to
 be typed in math mode.
 
 Vertical lines are available through the keyboard character or the
 control sequences \verb+\+vert and \verb+\+mid, all three to be
 entered in math mode.
 A double vertical bar is produced by \verb+\+$|$ or \verb+\+Vert,
 again both in math mode.

 The spacing around all these symbols can be controlled by adding 
 extra (positive or negative) space with the horizontal spacing
 commands. The symbols, just as any other part of a line, can also
 be raised or lowered respective to the normal baseline. The length
 and height of the symbols however depend on the font currently 
 in use.

 Where control of length and height of the bond lines is needed,
 TeX's or LaTeX's command sequences for printing horizontal and 
 vertical ``rules'' can be used.  The systems recognize several
 length units, including the inch, centimeter, millimeter, and
 printer point (Knuth 84, p. 57). One printer point (pt), an often
 used unit in typesetting, measures about 0.35 mm. --- LaTeX's
 rule-printing command has the format \\                    
 \centerline{$\backslash $rule[raise-length] \{width\}
 \{height\} . }
 Thus it can be used to produce horizontal and vertical rules.
 Using the \verb+\+rule command one can also print multiple
 bond lines of user-controlled length, e.~g.  $\dbond{16}{19} $,
 $\tbond{16}{20} $, with the short control sequences \verb+\+dbond
 and \verb+\+tbond defined in this thesis. The vertical spacing
 between the bonds depends on the current line spacing in the
 document and may have to be adjusted. The control sequences
 are set up for math mode.
 
 When bond lines other than horizontal and vertical ones are to
 be printed, and when a coordinate system is needed to control
 placement of structure components relative to one another, 
 LaTeX's picture environment (Lamport 86, pp. 101-111) is a
 necessity. 

 A picture environment uses length units which are dimensionless
 and have to be defined by the user before entering the 
 environment. This is done by the \verb+\+setlength command.
 In this study, \verb+\+setlength \{\verb+\+unitlength\}  
 \{0.1pt\} is the definition used for most diagrams. Such a small
 unitlength was chosen to have fine control over the appearance
 of the diagram.

 The picture environment starts with the statement\\
 \centerline{$\backslash $begin\{ picture\} (width, height) }
 where picture width and height reserve space on the page 
 and are specified in terms of unitlengths. Optionally, one
 can include the coordinates of the lower left corner of the
 picture: \\
 \centerline{$\backslash $begin\{ picture\} (width, height)
 (${\rm x_i\mbox{,}y_i}$).}
 The default value for these coordinates is (0,0).---
 Objects are placed into the picture with the \verb+\+put
 command with their reference point at the coordinates (x,y):    
 \verb+\+put(x,y) \{ picture object\} .

 The picture objects of most interest to this study are
 straight lines. They are drawn by the \verb+\+line
 command:\\
 \centerline{$\backslash $line(${\rm x_s\mbox{,}y_s}$) \{length\} }
 where the coordinate pair specifies the slope of the line, 
 and the nonnegative value of length specifies the length
 of the projection of the line on the x-axis for all 
 nonvertical lines, and the length of the line for vertical
 lines. The reference point of a line is one of its ends. 
 Thus the statement \\
 \centerline{$\backslash $put(x,y) 
  \{$\backslash $line(${\rm x_s\mbox{,}y_s}$) \{len\} \}  }
 draws a line that begins at (x,y), has a slope of ${\rm y_s\mbox{/}x_s}$,
 and extends for length len as explained above.

 Only a limited number of slopes is available through the line
 fonts in LaTeX. The possible values for ${\rm x_s}$ and ${\rm y_s}$ are
 integers between -6 and +6, inclusive. These values translate
 into 25 different absolute angle values, which are listed  
 in appendix C.
 
 \vspace{0.4cm}
 \begin{flushleft}
  \underline{B. Bonds in Structural Formulas Written on One Line}
 \end{flushleft}
 
 The application of some of the bond-drawing mechanisms for this
 simplest type of structural diagrams is illustrated in figure 3.1.

 \begin{figure}\centering
  \begin{picture}(900,900)
   \put(0,700)  {3.1a \ $CH\equiv C-CH=CH_{2}$}
   \put(0,450)  {3.1b \ $CH$\raise.1ex\hbox{$\equiv$}$C-CH=CH_{2}$}
   \put(0,200)  {3.1c \ $CH\tbond{14}{20} C\sbond{14} 
                         CH\dbond{14}{19} CH_{2}$}
  \end{picture}
  \caption{One-line structural formulas}
 \end{figure}

 For figure 3.1a only keyboard characters and the TeX command
 \verb+\+equiv were used to produce the bonds. Figure 3.1b
 shows a slight improvement through raising the triple bond.
 Figure 3.1c was printed using the \verb+\+sbond, 
 \verb+\+dbond, and \verb+\+tbond command sequences from
 this thesis, choosing a length of 14 pt for the bonds.
 It can be seen that each of the formulas in figure 3.1 is a
 creditable representation of the structure. Depending on the
 design of the page, the reason for displaying the structure
 at a particular place, and the emphasis put on features of the
 structure in the text, one would choose shorter or longer
 bonds and take more or less trouble to produce the structure.

 The picture environment is not needed for one-line structural
 formulas, unless one of these formulas has to be attached to
 another structural fragment, as in figure 3.2. Then the 
 coordinate system of the picture environment makes it
 possible to fit the two fragments together (see chapter~V for
 details).
 
 % figure 3.2
 \begin{figure}[h]
  \hspace{5cm}
  \parbox{70 pt}  {
   \begin{picture}(400,200)
    \put(-155,0) {$CH_{3}-CH-CH_{2}-CH_{2}-CH_{2}-CH_{3}$}
   \end{picture}  }

  \hspace{5cm}   \yi=200  \pht=600
  \sixring{Q}{Q}{Q}{Q}{Q}{}{D}{D}{D} \\
  \caption{One-line structure in picture environment}
 \end{figure}
 \reinit

 \vspace{0.4cm}
 \begin{flushleft}
  \underline{C. Bonds in Acyclic Structures with Vertical Branches}
 \end{flushleft}
 
 Structure diagrams with vertical, single- or double-bonded, branches,
 going up or down, are frequently seen. Several experiments with TeX
 and LaTeX were made to see how this type of structure can be
 handled. One method is to align the vertical bonds by using the
 mechanisms for tabbing or for printing tables and matrices.
 Here a structure such as the one shown in figure 3.3 is treated
 as a set of columns as indicated by the vertical dividing lines
 drawn into the second version of this structure in figure 3.3.

 % figure 3.3
 \begin{figure}
  \hspace{1cm}
  \begin{minipage}{180pt}
  \begin{tabbing}
   $CH_{3}CH_{2}$\= $CH$\= $CHCH_{2}$\= $CHCH_{2}CH_{3}$\+ \kill
                    $Br$\>           \> $CH_{3}$       \\ [-10pt]
    \hspace{2pt}$\vert $\>           \> \hspace{2pt}$\vert $ \- \\ [-9pt]
   $CH_{3}CH_{2}$\> $CH$\> $CHCH_{2}$\> $CHCH_{2}CH_{3}$\+ \+ \\ [-9pt]
     \hspace{2pt}   $\vert $                                  \\ [-9pt]
                    $CH_{2}CH_{3}$
  \end{tabbing}
  \end{minipage}
  \hspace{2.5cm}
 \begin{minipage}{180pt}         
  \begin{tabbing}
   $CH_{3}CH_{2}$\= $\vert CH$\= $\vert CHCH_{2}$\= $\vert CHCH_{2}CH_{3}$
                                                     \+ \kill
                    $\vert Br$\> $\vert $        \> $\vert CH_{3}$
                                                    \\ [-10pt]
   $\vert $\hspace{2pt}$\vert $\> $\vert $       \> $\vert $\hspace{2pt}
                                                    $\vert $ \- \\ [-9pt]
   $CH_{3}CH_{2}$\> $\vert CH$ \> $\vert CHCH_{2}$\> $\vert CHCH_{2}CH_{3}$
                                                    \+ \\ [-9pt]
         $\vert $\> $\vert $\hspace{2pt}$\vert $  \> $\vert $
                                                    \\ [-9pt]
         $\vert $\> $\vert CH_{2}CH_{3}$
   \end{tabbing}
   \end{minipage}
   \caption{Vertical branches}
  \end{figure}

 The structure diagram in figure 3.3 uses \verb+\+vert for the vertical
 bonds and LaTeX's tabbing environment for the alignment. One can also
 use ``rules'' as the vertical bonds in order to give the horizontal
 and vertical bonds the same lengths. Furthermore, vertical bonds can
 also be double bonds. The following examples illustrate these features.

 \[ \tbranch{O}{D}{H_{2}N-}{C-NH_{2}}{}{}{13} \hspace{2cm}
    \tbranch{}{}{CH_{3}-CH_{2}-}{C-CH_{3}}{D}{NH}{13} \hspace{2cm}
    \tbranch{}{}{H-}{C=\ }{S}{Br}{13}\tbranch{}{}{}{C-H}{S}{Br}{13} \]

 Similar structures were also generated with TeX's \verb+\+halign
 mechanism which forms templates for the columns rather than setting
 tab stops. For the purpose of printing the structure diagrams, no
 clearcut advantage was seen in one or the other method of
 alignment. In each case the vertical spacing depends on the line
 spacing in the document.
 
 The alternative method of producing these structures is the use
 of the picture environment. It provides better control over
 horizontal and vertical spacing and over bond lengths. Also,
 as illustrated in section 2B. of this chapter,
 using a picture environment makes
 it possible to attach one structural fragment to another at 
 a specific place. Thus, although the picture environment is not
 necessary for drawing structures with vertical branches, it 
 has several advantages, and writing LaTeX code for this
 implementation is not more difficult than writing the code
 for the tabbing method of alignment. 
 \newpage

 \begin{flushleft}
  \underline{D. Bonds in Structures Containing Slanted Bond Lines}
 \end{flushleft}
  
 Structure diagrams with slanted bond lines are frequently used for
 acyclic compounds and have to be used to depict almost all cyclic
 structures. Two examples are shown here:

 \[ \cdown{$CH_{3}$}{S}{$N^{+}$}{D}{$O$}{S}{$O^{-}$}
    \hspace{3cm} \sixring{$COOH$}{$OCOCH_{3}$}{Q}{Q}{Q}{Q}{S}{S}{C} \]
 
 In developing diagrams for such structures in this thesis the 
 conventions described in section 1. of this chapter are followed. 
 Thus the symbol for carbon is not
 printed for the carbons that are ring members, but it is usually 
 printed in acyclic structures, unless the acyclic structure fragment
 is a long chain, or space for the diagram is limited.

 The picture environment is always needed for slanted lines. It was
 explained in section 2A. of this chapter that LaTeX can draw lines
 only with a finite number of slopes. This is not a severe limitation
 for creating the structure diagrams, since the conventions for
 structure representation allow variations in the angles.
 The representation does not have to reflect the true
 atomic coordinates. In fact many chemistry publications contain 
 structure diagrams with angles significantly deviating from the real
 bond angles, even where those could have been used easily. Thus,
 Solomons' text (Solomons 84) 
 shows the carboxylic acid group often in this form \\
 \pht=600
 \[ \cright{}{S}{C}{D}{O}{S}{OH} \]
 \pht=900
 with an angle of about $90^0$ between the OH and doublebonded O,
 whereas the true angle is close to $120^0$. --- The angles used
 in this thesis for the regular hexagon of the sixring deviate by
 % \parbox{4mm}{+\vspace{-18pt}\\ $-$}~$1^0$ from $120^0$ 
  $\pm 1^{0}$ from $120^{0}$
  because of LaTeX's limited
 number of slopes. This difference is not big enough to be
 detected as a flaw.
 
 To write the LaTeX statement for a slanted bond line, one chooses the
 origin and the slope and then uses trigonometric functions to calculate
 the LaTeX ``length'' of the line for the desired real length. Once the
 LaTeX length is determined, the coordinates of the end point of the 
 line can be calculated in case the end point is needed as the origin
 of a connecting line. --- The origin and length of slanted double
 bonds were also calculated with standard methods from trigonometry.
 As an example, figure 3.4 shows how coordinates of the origin were
 calculated for the inside part of a ring double bond that is at a
 distance d from the outside bond.

 \setlength{\unitlength}{1pt}   % figure 3.4
 
 \begin{figure}[b]
  \begin{picture}(300,250)(0,-100)
   \thicklines
   \put(0,0)       {\line(5,3)  {120}}
   \put(120,72)    {\line(5,-3) {120}}
   \put(240,0)     {\line(0,-1) {100}}
   \put(215,-6)    {\line(-5,3) {88}}
   \thinlines
   \put(120,72)    {\circle*{4}}
   \put(125,72)    {($x$,$y$)}
   \put(127,47)    {\circle*{4}}
   \put(132,47)    {($x_d$,$y_d$)}
   \put(120,72)    {\line(0,-1) {16}}
   \put(120,72)    {\line(-3,-5){9}}
   \put(111,56)    {\line(1,0)  {16}}
   \put(127,56)    {\line(0,-1) {9}}
   \put(111,56)    {\line(5,-3) {16}}
   \put(111,62)    {\scriptsize d}
   \put(116,46)    {\scriptsize d}
   \put(112,17)    {{\small $\theta =30^{0}$}}
   \put(114,28)    {\vector(0,1){27}}
   \put(270,35) {$x_{d}=x-d\sin ${\small $\theta $}$+d\cos ${\small $\theta $}}
   \put(270,5)  {$y_{d}=y-d\sin ${\small $\theta $}$-d\cos ${\small $\theta $}}
  \end{picture}
  \caption{Calculating position and length of double bond.}
 \end{figure}

 \reinit  

 The LaTeX command \verb+\+multiput is similar to \verb+\+put and provides
 a shortcut for the coding of structures where several bond lines of the
 same slope and length occur at regular intervals. Multiput has the
 format\\ 
 \centerline{$\backslash $multiput(x,y)(${\rm \Delta x\mbox{,}\Delta y}$) 
   \{n\}\{object\} ,  }
 where n is the number of objects, e. g. lines. A structure diagram
 for which several \verb+\+multiput statements are appropriate is
 the structure of vitamin A shown in figure 3.5. 

 \begin{figure}[b]
  \hspace{2cm}
  \parbox{5cm}   {
   \begin{picture}(900,900)(-300,-300)
    \put(342,200)   {\line(0,-1)  {200}}
    \put(342,0)     {\line(-5,-3) {171}}
    \put(171,-103)  {\line(-5,3)  {171}}
    \put(0,0)       {\line(0,1)   {200}}
    \put(0,200)     {\line(5,3)   {171}}
    \put(171,303)   {\line(5,-3)  {171}}
    \put(322,180)   {\line(0,-1)  {160}}
    \put(342,0)     {\line(5,-3)  {128}}
    \put(171,303)   {\line(5,3)   {128}}
    \put(171,303)   {\line(-5,3)  {128}}
    \multiput(342,200)(342,0){5}{\line(5,3){171}}
    \multiput(513,303)(342,0){4}{\line(5,-3){171}}
    \multiput(527,270)(342,0){4}{\line(5,-3){135}}
    \multiput(855,303)(684,0){2}{\line(0,1){160}}
    \put(1881,275){=O}
   \end{picture}   }
   \caption{Diagram using $\backslash $multiput}
 \end{figure}

 The size of objects in a picture environment can be scaled in a simple
 way by changing the unitlength. Figure 3.6 illustrates scaling and 
 two problems associated with it. Changing the unitlength changes the
 length of the lines only, not the width of the lines or the size of   
 text characters. Thus ``it does not provide true magnification and
 reduction'' (Lamport 86, p. 102). However, the size of the text
 characters can be varied separately, as will be discussed in the
 next section of this chapter.      
 \pht=750
 % figure 3.6
 \begin{figure}[b]\centering
   \setlength{\unitlength}{.07pt}
   \sixring{$OH$}{Q}{Q}{Q}{Q}{$Br$}{S}{D}{S}
   \hspace{1.5cm}
   \setlength{\unitlength}{0.08pt}
   \sixring{$OH$}{Q}{Q}{Q}{Q}{$Br$}{S}{D}{S}
   \hspace{1.5cm}  \yi=150
   \setlength{\unitlength}{0.15pt}
   \sixring{$OH$}{Q}{Q}{Q}{Q}{$Br$}{S}{D}{S}
   \caption{Scaling (unitlength=0.07pt, 0.08pt, 0.15pt)}
 \end{figure}

 \reinit
 The smallest diagram in figure 3.6 illustrates a limitation that
 is unfortunate for the printing of structure diagrams. The shortest
 slanted line that can be printed by LaTeX's line fonts is
 one with an x-axis projection of about 3.6 mm.
 If a shorter slanted line is requested, LaTeX just prints
 nothing. A chemist would occasionally want to draw shorter lines,
 especially for the purpose of generating dashed lines indicating
 stereochemical features.

 \vspace{0.4cm}   
 \centerline{3. ATOMIC SYMBOLS AND CONDENSED STRUCTURAL FRAGMENTS}
 \vspace{0.4cm}
 Special considerations for the printing of condensed structural
 fragments are required since many of them contain subscripts.
 TeX considers the printing of subscripts a part of mathematics 
 typesetting which has to be done in the special math mode.
 It was pointed out in chapter I that typesetting of mathematics
 documents is one of the strong points of TeX; the fonts of type 
 for the math mode are designed to agree with all conventions
 of high quality mathematics publishing. Each typestyle in math
 mode consists of a family of three fonts (Knuth 84, p. 153),
 a textfont for normal symbols, a scriptfont for first-level
 sub- and superscripts, and a scriptscriptfont for higher-level
 sub- and superscripts. When structural fragments such as
 ${\rm C_{2}H_{5}}$ are typeset, the textfont is used
 for the C and the H.

 As TeX enters math mode it selects textfont1 as the textfont
 unless otherwise instructed. Textfont1 is defined by the TeX
 macros as math italic, a typestyle that prints letters (not
 numbers) similar to the italic style, but with certain 
 features adapted for mathematics typesetting. The italic
 style letters, lower and upper case, are the ones commonly
 seen in typeset mathematical formulas. Chemical formulas
 on the other hand are not usually printed with slanted
 letters. In this thesis, basically two methods were employed
 to produce chemistry-style letters in TeX's math mode which
 has to be used because of the presence of subscripts.
 
 For a document that contains many chemical formulas it is
 convenient to redefine textfont1 at the beginning of the
 TeX input file. The statement \newline \verb+\+textfont1=\verb+\+tenrm
 was used at the beginning of this document and causes TeX
 to select the roman font as the textfont in math mode.
 The roman typestyle is the one normally used by TeX
 outside of math mode and it is the style in which this
 thesis is printed. The tenrm style, which is slightly
 smaller than the twelverm size of the text in this document,
 was chosen because it appears to look better for the
 chemical formulas which consist largely of capital letters.
 When different typesizes are used in this way, all the 
 atomic symbols and formulas in any one structure, even
 those without subscripts, have to be printed in math mode
 so that they all have the same size. --- It could be a       
 problem with this method of selecting the roman font for
 math mode that the lowercase Greek letters (and some other
 symbols used in mathematics) are not available in this
 font. To print these one can temporarily redefine
 textfont1 to math italic with the statement
 \verb+\+textfont1=\verb+\+tenmi. One can also switch to
 a math font different from the default textfont1.
 Using one of LaTeX's font definitions, \verb+\+small,
 a statement \{\verb+\+small\$\verb+\+theta \$\} will
 print the Greek letter.
 
 Another method for avoiding the math italic style for letters
 in chemical formulas is to select the roman style in each
 individual instance where a formula has to be printed in
 math mode. A statement such as \$\{\verb+\+rm C\_2H\_5\}\$
 produces ${\rm C_{2}H_{5}}$ at the size of type currently used
 in the document. When the typestyle is thus selected within
 math mode, enclosed by dollar signs, TeX changes the style
 of the letters of the alphabet only; the lowercase Greek
 letters and math symbols remain available.

 The size of the letters in chemical formulas can be changed
 with the ten size declarations provided by LaTeX (Lamport 86,
 p. 200) or with TeX's declarations. (Some of TeX's declarations
 are not defined in LaTeX (Lamport 86, p.205)). The size
 declaration has to be written outside of math mode.
 One place in chemistry typesetting where a 
 smaller typesize is desirable is the writing on reaction
 arrows. The size in the following example is scriptsize:
 \newpage

 \advance \yi by 100
 \[ HC\equiv CH + H_{2}O   
  \parbox{92pt} {\cto{Hg^{++}}{18\%\ H_{2}SO_{4},\ 90^{0}}{14}}     
                                         CH_{3}-CHO \]

 Finally, condensed structural formulas sometimes have to be
 right-justified to be attached to the main structural diagram.
 Figure 3.7 illustrates this for the positioning of the
 substituent in the 4-position of the pyrazole ring. LaTeX 
 makes this positioning convenient with the \verb+\+makebox
 command, especially in the picture environment where the command
 has the format \\
 \centerline{$\backslash $makebox(width,height)[alignment]\{content\} }
 (Lamport 86, p. 104). The one-line piece of text that constitutes
 the content of the (imaginary) box can be aligned with the
 top, bottom, left side, or right side of the box.
 \reinit

 \begin{figure}[h]\centering
  \parbox{\xbox pt}             {
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(200,-84)        {\line(5,3)    {110}}        % bond 1,2
    \put(342,200)        {\line(0,-1)   {140}}        % bond 3,2
    \put(342,200)        {\line(-1,0)   {342}}        % bond 3,4
    \put(0,200)          {\line(0,-1)   {200}}        % bond 4,5
    \put(0,0)            {\line(5,-3)   {140}}        % bond 5,1
    \put(135,-130)       {$N$}                          % N-1 in ring
    \put(310,-30)        {$N$}                          % N-2 in ring
     \put(171,-137) {\line(0,-1)   {83}}         % subst. on
          \put(150,-283) {$C_{6}H_{5}$}                      %  on N-1
     \put(370,-17)  {\line(5,-3)   {100}}        % subst. on
          \put(475,-100) {$C_{6}H_{5}$}                      %  N-2
     \put(335,211)  {\line(5,3)  {128}}   % outside
                 \put(349,189)  {\line(5,3)  {128}}   %  double O
                 \put(475,250)  {$O$}                   %  on C-3
     \put(0,200)    {\line(-5,3)   {128}}        % single subst.
          \put(-430,234) {\makebox(300,87)[r]{$CH_{3}COCH_{2}CH_{2}$}}
     \put(-7,11)    {\line(-5,-3){128}}   % outside
                 \put(7,-11)    {\line(-5,-3){128}}   %  double O
                 \put(-200,-130){$O$}                   %  on C-5
  \end{picture}              }     % end pyrazole macro
  \caption{Right-justification of substituent formula}
 \end{figure}


 \end{document}

SHAR_EOF
cat << \SHAR_EOF > chap4.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{4}   
  \setcounter{topnumber}{2}     
  \setcounter{bottomnumber}{2}
  \renewcommand{\topfraction}{.5}
  \renewcommand{\bottomfraction}{.5}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \input{init.tex}
  \input{six.tex}
  \input{cright.tex}
  \input{purine.tex}
  \begin {document}    
  \setcounter{page}{24}
  \setcounter{chapter}{4}
  \textfont1=\tenrm
  \initial
 
 \centerline{CHAPTER IV}
 \vspace{0.4cm}
 \centerline{MACROS FOR TYPESETTING CHEMICAL STRUCTURE FRAGMENTS}
 \vspace{0.4cm}
 \centerline{1. GENERAL ORGANIZATION OF A STRUCTURE MACRO}
 \vspace{0.4cm}
 The macro facility in TeX/LaTeX was used to define mnemonics for
 typesetting frequently occurring structure fragments such as 
 common ring structures and branching patterns. 
 Chapter VI describes the complete system of
 macros designed for this thesis. All of the macros
 are defined with the LaTeX declaration \verb+\+newcommand which
 has the format \\
 \centerline{$\backslash $newcommand\{$\backslash $commandname\}
 [n]\{replacement text\} .  }
 (TeX calls these definitions macros, whereas LaTeX just uses the
 more general word ``command.'')\ In the definition, n is an integer     
 from 1 to 9 and gives the number of arguments if any are used.
 The arguments are represented in the replacement text by
 parameters of the form \#1, \#2 etc. 
 
 A macroname, like the name of any control sequence in TeX, 
 can contain letters only, not numerals.  Where it was considered
 important in this thesis to indicate a numbering scheme in
 a macroname, either the full word for the number or Roman
 numerals in lower case letters were used. Thus \verb+\+hetisix
 is a mnemonic for a hetero sixring with one hetero atom, and
 \verb+\+fuseiv indicates a fusing fragment with four atoms. ---
 In some macronames the mnemonic as such is preceded by ``c''
 or ``chem,'' for ``chemistry.'' This was mainly done where the 
 mnemonic was already used for a control sequence in TeX
 or LaTeX. Thus, chemical structure fragments that point
 ``right'' or ``left'' are drawn by the macros \verb+\+cright
 and \verb+\+cleft since TeX employs control sequences
 \verb+\+right and \verb+\+left with different meanings.
 
 All the structure-drawing macro definitions in this thesis
 follow the same pattern in their organization. The actual
 structure-drawing LaTeX code is preceded by a ``box''
 declaration.    
 The diagrams are produced in a box because it is sometimes
 desirable to move the diagram as a whole.
 In all but one of the macros, the box is the LaTeX
 ``picture''; in the macro \verb+\+tbranch,
 which uses the tabbing environment, the box is
 the LaTeX minipage. Box dimensions in the
 macros are made flexible through the use of global variables.
 --- The structure-drawing code itself consists of unconditional    
 and of conditional statements.  The macro arguments are used to
 vary parts of the structure diagram, such as substituents
 and multiple bonds. --- Those features of a structure macro
 that have not been discussed before are described in more
 detail in the following sections.

 \vspace{0.4cm}
 \noindent A. \underline{Box Constructions with Global Variables}
  
 Integer variables such as the ones used here for box dimensions
 have to be stored in one of TeX's 256 numerical registers and can
 be given symbolic names with TeX's \verb+\+newcount declaration
 (Knuth 84, pp. 118-121). The variables used in the macros of
 this thesis are defined and initialized in the macro          
 \verb+\+initial which should be part of the preamble of an input
 file for chemistry typesetting using this system (see chapter VI
 for a summary of the preamble). A user can then change the 
 variables by simple assignment, e. g. \verb+\+xi=400.
 When several variables have been changed, it is convenient to
 reset all of them, including the unitlength, to their initial
 values with the macro \verb+\+reinit.

 The role of the LaTeX picture for line-drawing was discussed
 in chapter III, but the picture is also a box.
 As such it is processed in horizontal mode, as part of a line.
 Within a horizontal box, line breaks can never occur. --- 
 The macros use variables for all numerical 
 parameters in the picture declaration.
 Thus, the picture declaration in the macros has the form \\
 \centerline{$\backslash $begin\{picture\}($\backslash $pw,
 $\backslash $pht)($\backslash -$xi, $\backslash -$yi)  }
 The picture width and height, \verb+\+pw and \verb+\+pht,
 specify the nominal size used by TeX to determine how much
 room to leave for the box. The diagram in the box can extend
 beyond these dimensions, but an adjoining box is typeset next
 to the preceding one according to the specified width.
 The user needs control over the picture width in cases where
 several such boxes are put on one line, especially for the
 horizontal connection of structure fragments (see chapter V).
 --- Control over the picture height is important because
 some chemical structures take up more vertical space than
 others. The picture width and height are initialized to 400
 and 900 respectively, which is about 1.4$\times $3.2 cm with
 the unitlength of 0.1 points.
 
 Variables are used for the coordinates of the 
 lower left corner, \verb+\+xi and \verb+\+yi, so that the
 user can change the placement of the diagram within the
 picture window. This is not often necessary for individual
 structures since they can be conveniently centered by
 the display mechanisms discussed later in this chapter;
 and also the whole picture can be shifted horizontally by
 adding horizontal space in front of it with the 
 \verb+\+hspace command.  But shifting the diagram within
 the picture is employed for one of the methods of
 the horizontal and vertical
 connection of structure fragments discussed in chapter V.
 It was considered to be most convenient to put the minus
 signs in front of \verb+\+xi and \verb+\+yi in the declaration,
 since one thinks of the lower left corner of a coordinate
 system as having negative coordinates. With this declaration,
 an increase in the absolute \verb+\+xi and \verb+\+yi values
 shifts the diagram to the right and up. The coordinates
 \verb+\+xi and \verb+\+yi are initialized to 0 and 300
 respectively, which places the coordinate origin about 1~cm
 above the bottom of the picture window with the unitlength
 of 0.1 points.

 The minipage, the box used in the macro \verb+\+tbranch,
 is a paragraph box, which allows line breaks. Only the width
 is specified for a paragraph box since the height is
 controlled by the number of lines that will be produced by
 a given amount of text. The variable used in this system
 for the width of paragraph boxes is \verb+\+xbox. The number
 value assigned to \verb+\+xbox is interpreted as printer
 points.

 \pagebreak
 \vspace{0.4cm}
 \noindent B. \underline{Use of TeX's Conditional Facility}
 
 TeX's conditional facility is very similar to those of other
 high-level languages; it has the form: \\
 \centerline{$\backslash $if(condition)(true text)
  $\backslash $else(false text) $\backslash $fi  }
 (Knuth 84, p. 207 ff.).  Nesting is possible.
 The TeX \verb+\+if primitive has over ten different forms
 for testing numbers, processing modes, or tokens.
 The form used in the chemical structure macros is          
 \verb+\+ifx${\rm \langle token_{1}\rangle \langle
 token_{2}\rangle}$, which tests for the equality of the
 (character code, category code) pair of two tokens.
 
 In the structure macros, the \verb+\+ifx tests the
 arguments. When the arguments are single characters,
 such as ``S'', ``D'', or ``C'' for single bond, double
 bond, and circle, respectively, the application is    
 straightforward.  The character ``Q'' is used as argument
 where ``no action'' --- no substituent, no additional bond
 --- is a desired option at a particular place in a structure
 diagram. Thus, the coding for ring positions where substituents
 are an option is:

 \begin{tabbing}
  move in some\= $\backslash $ifx\#nQ\= print the substituent \#n
                                        $\backslash $fi\+ \kill
                 $\backslash $ifx\#nQ\>                      \\
                 $\backslash $else   \> draw a bond line \+  \\
                 print the substituent \#n $\backslash $fi
  \end{tabbing}

 The parameter n represents the substituent formula. --- 
 The explicit no-action symbol makes it possible to distinguish
 three different cases at a particular ring position: no action,
 just a bond line extending from the ring, and a bond line with 
 a substituent at the position. As an example, the purine macro
 was used with an argument of Q for the 9-position in the 
 left-hand diagram and with an empty set argument in the
 right-hand diagram:
 \[ \purine{Q}{D}{Q}{D}{Q}{$NH_{2}$}{Q}{D}{Q}
    \hspace{3cm}\purine{Q}{D}{Q}{D}{Q}{$NH_{2}$}{Q}{D}{}  \]
 One would use the bond-line-only option in cases where another
 structure fragment in a picture is to be attached to the bond.
 --- The character Q was chosen because it is not part of any
 element symbol and is not commonly used as a structural symbol
 otherwise.
 
 When the parameter after the \verb+\+ifx is substituted by a
 text string representing a multi-character substituent, TeX
 actually compares the first character of the string with its
 second character, since these are the first two tokens 
 encountered. Thus, a substituent that begins with two identical
 characters always makes the condition true. In such cases,
 one has to ensure that the string as a whole is compared by
 enclosing it in a box, e. g. \verb+\+mbox\{${\rm NNHC_{6}H_{5}}$\}.
  
 TeX's conditional facility can also be used to impart some
 chemical intelligence to a macro by causing screen messages
 to be generated when the user supplies a combination of
 arguments that is chemically not possible. Such a combination
 would be a ring double bond (argument 7=``D'') and a 
 circle denoting aromaticity (argument 9=``C'') for the
 carbon sixring. A section of code  
 
 \begin{tabbing}
  move in \= $\backslash $ifx\#7D  $\backslash $ifx\#9C
          \= $\backslash $message\{Error: $\ldots $\}\+ \kill
          $\backslash $ifx\#7D  $\backslash $ifx\#9C \> \+ \\
          $\backslash $message\{Error: $\ldots $\} \- \\
          $\backslash $fi  $\backslash $fi
  \end{tabbing}
 
 will produce the message on the screen while the input
 file is processed by TeX to give the DVI file. The user
 can then correct the mistake and reprocess the input file
 before sending the DVI file to the output device. --- 
 Error messages were not placed into all macros, just into
 the \verb+\+sixring macro to demonstrate this feature.
 
 In addition to the simple \verb+\+if statements TeX has
 an \verb+\+ifcase construction of the form \\
 \indent \verb+\+ifcase(number)(text for case 0) \verb+\+or
         (text for case 1) \verb+\+or $\ldots $ \\
 \indent \ \ \ \verb+\+or (text for case n) \verb+\+else
         (text for all other cases)  \verb+\+fi  \\
 (Knuth 84, p~210). When the \verb+\+ifcase statement
 is used in a macro and the case number is passed as an
 argument, many different actions can be requested 
 through one argument. For a larger number of cases, the
 TeX code with \verb+\+ifcase is somewhat more elegant
 than a series of individual \verb+\+if statements.
 --- A suitable application for the chemical structure  
 macros is the placement of double bonds in various
 positions of a structure, where the position number,
 or a numeric code for a combination of positions,
 is passed as the case number.  One version of the
 sixring macro, \verb+\+sixringb, contains an
 \verb+\+ifcase construct.
  

 \vspace{0.4cm}
 \centerline{2. USE OF STRUCTURE MACROS}
 \vspace{0.4cm}
 \noindent A. \underline{Invoking the Structure Macros}

 In order to typeset a chemical structure through invoking one
 of the macros in this system, the user must know how the structure
 will be oriented on  the page, besides knowing, of course,
 the function of each argument. The structures in this system can
 not be rotated; they are oriented according to common practices
 in chemistry, but occasionally the user will have to adapt
 a model structure to the given orientation. Chapter VI shows
 for each macro a typical structure produced by it, to illustrate
 the orientation and the position numbers. In this section it
 will be demonstrated with two representative macros how this
 information is to be used.

 The macro \verb+\+cright typesets structures or structure 
 fragments of the general form
 \pht=600
 \[ \cright{$R^{1}$}{S}{$Z$}{S}{$R^{5}$}{S}{$R^{7}$} \hspace{1cm}
    \mbox{.} \]
 The arguments 1, 3, 5, and 7 are the substituents or groups
 $R^{1}$, $Z$, $R^{5}$, and $R^{7}$. Arguments 2, 4, and 6 trigger
 the drawing of bonds between $R^{1}$ and $Z$, between $Z$ and $R^{5}$,
 and between $Z$ and $R^{7}$, respectively. The bonds can be single
 or double bonds, from arguments ``S'' and ``D'' respectively, 
 and the bond between $R^{1}$ and $Z$ does not have to be present.
 A typical structure is shown in figure 4.1, where the caption
 is the invoking code. Since the second argument for figure 4.1
 is ``Q,'' no bond is drawn between ${\rm R^{1}}$ and Z; and
 ${\rm R^{1}}$, which is in a \verb+\+makebox (see chapter III.3),
 is moved next to Z. Figure 4.2 shows two additional structures
 drawn with the \verb+\+cright macro.
 
 \begin{figure}[h]\centering
  \cright{$CH_{3}$}{Q}{$CH$}{S}{$COOCH_{3}$}{S}{$COOCH_{3}$}
  \caption{$\backslash $cright\{\$CH\_3\$\}\{Q\}\{\$CH\$\}
     \{S\}\{\$COOCH\_3\$\}\{S\}\{\$COOCH\_3\$\}   }
  \end{figure}
 
 
 \begin{figure}[h]                % figure 3.2
  \hspace{3cm}
  \cright{$CH_{3}CH$}{D}{$C$}{S}{$CH_{3}$}{S}{$CH_{3}$}
  \hspace{3cm}
  \cright{$R$}{S}{$C$}{S}{$O^{-}$}{D}{${NH_{2}}^{+}$}
  \caption{Structures drawn with the $\backslash $cright macro}
 \end{figure}

 The macro \verb+\+sixring typesets the very common carbon sixring.
 For this structure and all the ring structures, the user has to
 know how the system of macros assigns position numbers to the
 ring atoms. The assignment follows chemical nomenclature rules
 where applicable. However in the case of single-ring structures
 where all ring atoms are carbons,
 the assignment of position
 number 1 is arbitrary. In this system of macros, the sixring is 
 numbered as follows: \\
 \pht=900
 \[ \sixring{$R^{1}$}{$R^{2}$}{$R^{3}$}{$R^{4}$}{$R^{5}$}{$R^{6}$}
    {S}{S}{S} \hspace{2cm}  \mbox{.}  \]



 The first six arguments are the formulas for the optional 
 substituents in the respective positions. The user has to
 refer to the position assignment to supply the text strings
 in the correct form, e. g. a sulfonic acid group for positions
 4 and 5 would be typed in as $HO_{3}S$, whereas it would be
 $SO_{3}H$ for all other positions. --- The remaining three
 arguments can produce alternating ring double bonds, but each
 of them has a second function. Argument 7 can produce a second
 substituent at position 1, argument 8 an outside double bond
 with substituent in position 3, and argument 9 a circle inside
 the ring denoting aromaticity. Where arguments have two 
 functions in this way, the different structural features
 generated are of course mutually exclusive chemically.
 Figure 4.3 shows a sixring structure with the corresponding
 LaTeX code as caption. The substituent in position 3 is passed
 as argument 8 since it is not the regular single-bonded
 substituent represented by argument 3.

 \begin{figure}[h]\centering   
  \sixring{$OH$}{Q}{Q}{Q}{$NC$}{Q}{$CH_{3}$}{$NH$}{D}
  \caption{$\backslash $sixring\{\$OH\$\}\{Q\}\{Q\}\{Q\}
     \{\$NC\$\}\{Q\}\{\$CH\_3\$\}\{\$NH\$\}\{D\}   }
 \end{figure}
  
 \vspace{0.4cm}
 \noindent B. \underline{Displaying Macro-Generated Diagrams
    within a Document}

 Since the macro-generated diagrams constitute TeX boxes, the          
 code for a diagram can be included anywhere in the input file
 and TeX will try to find a place for the diagram as a whole
 in the line and on the page. The diagrams, however, take up
 more space horizontally and vertically than a box of text;
 therefore TeX's line- and page breaking mechanisms would be
 strained, sometimes to such a degree that text squeezing or
 spreading would be apparent on the printed page.

 A convenient way to display one or several structures on one
 line by themselves and centered, is the math display environment,
 enclosed by LaTeX with brackets in the form \verb+\+[
 $\ldots $\verb+\+].  A modification of this environment puts
 consecutive equation numbers at the right edge of the line.
 When using math display one has to remember that the only
 spacing in math mode is around math operators, space inserted
 by the user is ignored. Also, a new    
 paragraph can not be started in math display. ---
 The diagrams in math display are printed at the place in
 the document where they are coded in the input file.
 Thus the display can still cause problems with pagebreaking,
 especially since the diagrams usually take up more vertical
 space than a math equation for which the environment is
 designed.

 The LaTeX figure environment was specially designed for larger
 displays, such as the structure diagrams (Lamport 86, pp.~59, 60,
 176, 177). A figure will usually not appear at the place in the
 document where the user has coded it; instead LaTeX finds space
 for it on the current page or the next one in such a way that
 an overfull page is never produced. The user has some control
 over the placement of figures with optional parameters such as
 top or bottom of a page, but LaTeX still makes the final
 decision, often producing surprising results.
 Since a figure is moved to a convenient place by
 LaTeX, the figure is called a ``float.''  In addition to the
 automatic space-finding, the figure environment has the
 advantage that it makes captions possible. Furthermore,
 several displayed objects, each with a caption, can be included
 in one figure environment; figures 4.4 and 4.5 present an 
 example, produced by the LaTeX code in figure 4.6. The code
 shows that each picture with its caption is enclosed in
 a \verb+\+parbox.
 
 \begin{figure}
 \parbox{.4\textwidth}{\centering
 \begin{picture}(\pw,\pht)(-\xi,-\yi)
   \put(90,0)    {\circle{180}}
   \put(90,90)   {\line(0,1)   {70}}         % behind and up
   \put(60,170)  {$COOH$}
   \thicklines
   \put(30,10)   {\line(-5,2)  {140}}        % in front
   \put(-415,30) {\makebox(300,87)[r]{$HO$}} %  and left
   \put(150,10)  {\line(5,2)   {140}}        % in front 
   \put(300,30)  {$H$}                       %  and right
   \thinlines
   \put(90,-90)  {\line(0,-1) {90}}          % behind and
   \put(60,-260) {$CH_{3}$}                  %  down
 \end{picture}     
 \caption{${\rm (S)-}$lactic acid}   }
 \hfill
 \parbox{.4\textwidth}{\centering
 \begin{picture}(\pw,\pht)(-\xi,-\yi)
   \put(90,0)    {\circle{180}}
   \put(90,90)   {\line(0,1)   {70}}         % behind and up
   \put(60,170)  {$COOH$}
   \thicklines
   \put(30,10)   {\line(-5,2)  {140}}        % in front
   \put(-415,30) {\makebox(300,87)[r]{$H$}}  %  and left
   \put(150,10)  {\line(5,2)   {140}}        % in front 
   \put(300,30)  {$OH$}                      %  and right
   \thinlines
   \put(90,-90)  {\line(0,-1) {90}}          % behind and
   \put(60,-260) {$CH_{3}$}                  %  down
 \end{picture}     
 \caption{${\rm (R)-}$lactic acid}  }
 \end{figure}

 \begin{figure}\centering
 \begin{verbatim}
    \begin{figure}                            
      \parbox{.4\textwidth}{\centering        
        \ccirc{$COOH$}{$HO$}{$H$}{$CH_{3}$}     
        %ccirc is a macro                     
      \caption{${\rm (S)-lactic acid}$}}  
      \hfill                                  
      \parbox{.4\textwidth}{\centering        
        \ccirc{$COOH$}{$H$}{$OH$}{$CH_{3}$}   
      \caption{${\rm (R)-lactic acid}$}}  
    \end{figure}                                                            
 \end{verbatim}
 \caption{LaTeX code for two captions in one figure}
 \end{figure}
 
 It should also be mentioned that all the display mechanisms
 discussed above can be used in a two-column document style
 which is the format of most scientific chemistry journals.   

 If the same structure is to be printed many times in a
 document, processing time can be saved by storing it in a
 LaTeX \verb+\+savebox. The structure-drawing code then has to 
 be processed once only. Applied to the chemistry macros,
 a statement \\
 \centerline{$\backslash $savebox1\{$\backslash $macroname
      \{${\rm arg_{1}}$\}\{${\rm arg_{2}}$\}$\ldots $ \}  }
 will process the code and save the typeset structure.
 A \verb+\+usebox1 statement, enclosed in a math display or
 figure environment, is then placed into the input file
 whereever the structure is to be printed. A \verb+\+savebox
 can also be given a symbolic name (Lamport 86, p. 101).

 \end{document}

SHAR_EOF
cat << \SHAR_EOF > chap5.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \input{init.tex}
  \input{hetisix.tex}
  \input{hetifive.tex}
  \input{furanose.tex}
  \input{pyranose.tex}
  \input{purine.tex}
  \input{six.tex}
  \input{fparts.tex}
  \input{cleft.tex}
  \input{cto.tex}
  \begin {document}    
  \setcounter{page}{35}
  \setcounter{chapter}{5}
  \textfont1=\tenrm
  \initial
  \len=4

 \centerline{CHAPTER V}
 \vspace{\len mm}
 \centerline{COMBINING STRUCTURES FROM SEVERAL MACROS}
 \vspace{\len mm}
 \centerline{1. GENERAL CONSIDERATIONS FOR COMBINING STRUCTURES}
 \centerline{IN THIS SYSTEM}
 \vspace{\len mm}
 Many individual
 structure diagrams can be typeset using just one of the macros
 together with condensed, one-line formulas; but often it will be
 necessary to combine the ring structure or the branched fragment
 from one macro with a structure part from another. To do this,
 the separate parts have to be precisely aligned horizontally and
 vertically. The typesetting of chemical equations containing
 structure diagrams also requires such alignments and is therefore
 included in this chapter.
 For the system of macros described here, alignment consists of moving
 each of the structure fragments as a whole, either within its 
 picture box or together with the box.
  
 In each structure diagram there are many different points to which
 other fragments can be attached. Similarly, one and the same   
 structure can be aligned in different ways with others to produce
 a chemical equation. For these reasons, it was not considered
 feasible to develop a symbolic language for alignment, such as
 ``attach(sixring) at(1) to(fivering) at(4).'' Instead, this
 system lets the user manipulate the placement of the structures
 at a lower level by using some of the numerical coordinates from
 the macros. While it may be considered a disadvantage that the
 user has to extract information from the macros, this method also
 puts a lot more control into the hands of the user. The type of
 user anticipated for this system will probably prefer this
 mechanism to an overdose of user-friendliness. Outright manipulation
 of coordinates is also well suited for the textual method of
 structure input employed in this system, since it helps the user
 to visualize the result.

 The information that is needed from a macro 
 to form a new structure \linebreak from fragments is the coordinate
 pair for the point of attachment in each fragment. A part of
 the code for the sixring and the relevant part of the structure
 is shown in figure 5.1 to illustrate briefly how these 
 coordinate pairs are obtained:
 If a fragment is to be attached directly to a ring position,
 for example to position 1, the coordinate pair is found in
 the unconditional part of the code as the origin of the bondline
 beginning at position 1. (The code for the bond is located by
 finding the respective line comment.) The coordinate pair in 
 this case would be (342,200). --- A fragment can also be attached
 to the end of a bond extending from the ring. These bonds are
 optional and part of the conditional code. The optional bond
 extending from position 1 is located through the comment
 ``substituent on 1.'' The x-coordinate at the end of this bond
 is $342 + 128 = 470$, since the length of the bond given in
 the code, 128 units, is the projection on the x-axis.
 The y increment from ring position 1 to the end of the bond
 is obtained from the slope of the line and the x increment
 of 128: ${\rm \Delta x(3\mbox{/}5)=77}$.
 Thus, the y-coordinate at the end of the bond is
 $200 + 77 = 277$ units. -- Appendix B lists the coordinates
 of the more commonly used points of attachment for the
 system of macros described here.
  
  \setlength{\unitlength}{.2pt}
 \begin{figure}[tb]
  \hspace{5cm}
  \begin{picture}(400,530)(0,-200)
   \put(342,200)   {\line(0,-1) {200}}
   \put(342,0)     {\line(-5,-3){171}}
   \put(171,303)   {\line(5,-3) {171}}
   \put(342,200)   {\line(5,3)  {128}}
   \thinlines
   \put(342,200)   {\vector(1,0){128}}
   \put(470,200)   {\vector(-1,0){128}}
   \put(470,200)   {\vector(0,1) {77}}
   \put(470,277)   {\vector(0,-1){77}}
   \put(320,160)   {{\scriptsize 1}}
   \put(320,0)     {{\scriptsize 2}}
   \put(370,150)   {{\scriptsize 128}}
   \put(490,220)   {{\scriptsize 77}}
  \end{picture}

 \begin{minipage}{14cm}
  \begin{verbatim}
    \begin{picture}(\pw,\pht)(-\xi,-\yi) 
     .....
     \put(342,200)     {\line(0,-1) {200}} % bond from 1 to 2
     \ifx#1Q
     \else\put(342,200){\line(5,3)  {128}} % substituent on 1
          \put(475,250){#1}            \fi   
     .....
    \end{picture}
  \end{verbatim}
 \end{minipage}

 \caption{Finding coordinates of points of attachment}
 \end{figure}   %figure 5.1 
 \setlength{\unitlength}{.1pt}

 Two conceptually different methods were used in this thesis 
 to combine structure fragments from different macros. ---     
 One method follows a suggestion in the LaTeX manual (Lamport 86,
 p. 110) to put subpictures into an encompassing picture with
 the \verb+\+put command: \\
 \centerline{$\backslash $put(x,y)\{$\backslash $begin\{picture\}
            $\ldots \backslash $end\{picture\} \ \ \}.  }
 The reference point (x,y) is the lower left corner of the 
 subpicture. When this technique is applied to the chemical
 structure macros, the macro invocation constitutes the
 subpicture. The user has to set up the encompassing picture
 and determine the coordinates of the reference points from     
 the coordinates of the points of attachment between structure
 fragments.

 The second method is somewhat less versatile; but there are
 applications for which it is preferable. In this method, the
 individual picture boxes are put next to one another on one
 line or on successive lines. The fragments in the separate
 pictures are aligned by shifting the coordinate system, i. e.
 by changing the \verb+\+xi and \verb+\+yi values in the
 picture declaration, in one or more of the pictures. 
 
 Finally, for the alignment of structures in a chemical
 equation, it is convenient to use a paragraph box
 construction (\verb+\+parbox) in addition to coordinate
 shifting. LaTeX centers a paragraph box vertically on the
 current line which contains, in the case of the chemical
 equation, textual items such as plus symbols, condensed
 formulas, and reaction arrows.

 Typical applications of all methods of combining structure 
 fragments will be described in the rest of this chapter.
 
 \pagebreak 
 \vspace{\len mm}
 \centerline{2. COMBINING FRAGMENTS TO FORM A NEW STRUCTURE}
 \vspace{\len mm}
 \noindent A. \underline{Attachment by the Subpicture Method}

 A simple example for this technique of structure-building is 
 shown in figure 5.2, where two different heterocycles are
 fitted together to produce the structure of nicotine.
 The LaTeX code to be entered by the user for this structure
 is given underneath the diagram.

 \begin{figure}[h]   % fig. 5.2
  \hspace{5cm}
  \begin{picture}(900,900)(0,0)
   \put(0,0)     {\hetisix{D}{Q}{}{Q}{Q}{Q}{D}{D}{N}  }
   \put(470,277) {\hetifive{$CH_{3}$}{Q}{Q}{Q}{Q}{S}{S}{S}{N}  }
   \put(135,330)   {A}
   \put(605,600)   {B}
  \end{picture}

 \begin{minipage}{14 cm}
  \begin{verbatim}
  \begin{picture}(900,900)(0,0)
   \put(0,0)     {\hetisix{D}{Q}{}{Q}{Q}{Q}{D}{D}{N} }
   \put(470,277) {\hetifive{$CH_{3}$}{Q}{Q}{Q}{Q}{S}{S}{S}{N}}
  \end{picture}
  \end{verbatim}
 \end{minipage}

 \caption{Nicotine structure with LaTeX code}
 \end{figure}

 The code in figure 5.2 illustrates how the user has to set up the 
 encompassing picture with the \verb+\+begin and \verb+\+end
 statements and estimated values for the picture width and height,
 both 900 units (about 3cm) in this example. Then the picture box
 of the pyridine ring is placed at the origin of the outer picture.
 Next, the points of attachment are found in the respective
 macros as ${\rm x_{AB}=470}$, ${\rm y_{AB}=277}$ for pyridine
 and ${\rm x_{BA}=0}$, ${\rm y_{BA}=0}$ for pyrrolidine.
 The coordinates of the reference point in the outer picture
 where the inner picture with the pyrrolidine ring has to be
 placed then are \\
 \centerline{${\rm x=x_{AB}-x_{BA}=470}$, \  
             ${\rm y=y_{AB}-y_{BA}=277}$.}
 It is assumed that the lower left corner of both subpictures has 
 the same coordinates, and this is the case when the macros
 are used.  When more than two ring structures are combined
 one after the other, the calculation of the reference points
 is appropriately extended.

 Since the macros for the various acyclic branched fragments also
 consist of picture boxes, these fragments can be used as    
 subpictures together with ring structures and with other
 acyclic fragments. Thus the structure of thymol in figure 5.3
 is produced from the \verb+\+sixring and the \verb+\+cdown
 macros. Again, the coordinates for the point of reference for
 the \verb+\+cdown picture are calculated from the points of
 attachment:\\
 \indent ${\rm x=x_{sixring}-x_{cdown}=\ \ 171-\ \ 33=\ \ 138}$\\
 \indent ${\rm y=y_{sixring}-y_{cdown}=-103-220=-323}$.\\
 Figure 5.4, the structure of penicillic acid, combines
 three subpictures, one from the \verb+\+cleft macro and two
 from the \verb+\+cbranch macro which draws vertical branches.

 \begin{figure}[h]   % fig. 5.3
  \hspace{6cm}
  \begin{picture}(500,1100)(0,-300)
   \put(0,0)       {\sixring{Q}{$OH$}{Q}{Q}{Q}{$CH_{3}$}{S}{S}{C} }
   \put(138,-323)  {\begin{picture}(\pw,\pht)(-\xi,-\yi)
                     \put(33,80)    {\line(0,1)  {140}}
                     \put(0,0)      {$CH$}
                     \put(0,0)      {\line(-5,-3){121}}
                     \put(80,0)     {\line(5,-3) {121}}
                     \put(-430,-150){\makebox(300,87)[r]{$H_{3}C$}}
                     \put(210,-140) {$CH_{3}$}
                    \end{picture}             }
   \end{picture}
 
  \begin{minipage}{14cm}
  \begin{verbatim}
    \begin{picture}(500,1100)(0,-300)  % estimated dimensions
      \put(0,0)     {\sixring ...                 }
      \put(138,-323){\cdown   ...                 }
    \end{picture}
   \end{verbatim}
  \end{minipage}

  \caption{Combining ring structure and acyclic subpictures}
 \end{figure}

 % I did not use the cdown macro, because this chapter needs
 % several macros and I did not want to run out of Tex memory.
 % But I tried the structure out with the macro.
 \yi=200


 \begin{figure}[t]   % fig. 5.4
  \hspace{4.5cm}
  \begin{picture}(900,600)(0,-100)
   \put(-405,160)  {\makebox(300,87)[r]{$H_{3}C$}}
   \put(0,70)      {\line(-1,1)        {100}}
   \put(-405,-185) {\makebox(300,87)[r]{$H_{2}C$}}
   \put(-9,9)      {\line(-1,-1)       {100}}
   \put(9,-9)      {\line(-1,-1)       {100}}
   \put(0,0)       {$C$}
   \put(90,33)     {\line(1,0)         {140}}
   \put(240,200)   {$O$}               
   \multiput(267,85)(26,0){2}          {\line(0,1){100}}
   \put(240,0)     {$C$}
   \put(330,33)    {\line(1,0)         {140}}
   \put(480,200)   {$OCH_{3}$}
   \put(520,85)    {\line(0,1)         {100}}
   \put(480,0)     {$C$}
   \multiput(570,20)(0,26){2}          {\line(1,0){140}}
   \put(720,0)     {$CHCOOH$}
  \end{picture}
  \caption{Combining acyclic subpictures}
 \end{figure}       
 
 % Again I did not actually use the macros here, but
 % I tried it out with them.
 
 Many structures contain condensed formula fragments between
 ring diagrams. The structure of the anesthetic piridocaine
 is shown as an example in figure 5.5.  In such a case one has
 to estimate the average horizontal space per character and move
 the second subpicture that much further to the right for each
 character, including the subscripts, in the condensed formula
 fragment. In the ten point size, in which the characters in 
 figure 5.5 are printed, the horizontal space per character
 is 6.8 points or 68 of the picture units.

  \pht=800
 \begin{figure}[h]   % fig. 5.5
  \hspace{4.5cm}
  \begin{picture}(1200,800)(0,0)
   \put(0,0)     {\sixring{$NH_{2}$}{$COOCH_{2}CH_{2}$}
                  {Q}{Q}{Q}{Q}{D}{D}{D}  }
   \put(1210,0)  {\hetisix{$H$}{Q}{Q}{Q}{Q}{}{Q}{}{$N$}  }
  \end{picture}
  \caption{Condensed formula fragment between rings}
 \end{figure}
 \reinit
 
 Other special cases occur where a diagram would become
 too crowded when the two fragments are put next to one
 another. (This does not necessarily reflect steric hindrance
 in the real, three-dimensional chemical structure.)
 In such cases the user can design a longer bondline and 
 put it into the outer picture between two points of attachment
 on macro-produced structure fragments. The structure of
 sucrose, shown in figure 5.6, illustrates this technique.
 For this structure, it was estimated that the x-offset
 between the bonding oxygen on glucose and the fructose
 ring should be at least 200 units to produce a diagram
 that does not appear crowded. Using this x-offset and
 a bonding angle of $45^{0}$ (the angle used in the pyranose
 macro for glucose), the user can then easily calculate the   
 point of reference for the fructose subpicture.


 \begin{figure}
  \hspace{3.5cm}
  \begin{picture}(1200,800)(0,-100)
   \put(0,0)     {\pyranose{$H$}{$O$}{}{$OH$}{$OH$}{}{}
                  {$HO$}{$HO$}     }
   \put(785,200) {\line(1,1){200}}
   \put(985,100) {\furanose{}{$CH_{2}OH$}{$HO$}{}{}{$OH$}{Q}{$HO$} }
  \end{picture}

  \begin{minipage}{14cm}
  \begin{verbatim}
   \put(0,0)     {\pyranose ....         }
   \put(785,200) {\line(1,1){200}}       }  % user-designed line
   \put(985,100) {\furanose ...          }
  \end{verbatim}
  \end{minipage}

  \caption{User-designed connecting bond line}
 \end{figure}

 An important special case of combining structure fragments is 
 the generation of fused ring systems. In a fused ring system
 more than one ring atom is shared between rings. ---
 A simple method for producing such diagrams is to print the
 shared bondlines from individual ring structures precisely 
 on top of each other. The bond lines have to have the same
 lengths, which is true in this system of macros for the
 five- and sixrings, the most frequently occurring ones.
 The shared lines don't appear to be heavier in the printed
 picture than other bond lines. Figure 5.7 shows the structure
 diagram of quinoline produced by this method together with
 the respective LaTeX code. These fused systems can of 
 course include substituents and multiple bond variations
 at all positions where the original macros made them
 possible. --- A relatively small number of single-ring
 fragments can produce a large number of fused systems 
 in this way, among them the very common fused systems
 of anthracene, phenanthrene, chrysene, indene, indol,
 benzimidazole, quinoline, and acridine.

 \begin{figure}    % fig. 5.7
  \hspace{6cm}
  \begin{picture}(900,900)(0,0)
   \put(0,0)   {\sixring{Q}{Q}{Q}{Q}{Q}{Q}{S}{D}{D}  }
   \put(342,0) {\hetisix{D}{Q}{Q}{Q}{Q}{Q}{D}{D}{$N$}}
  \end{picture}

  \begin{minipage}{14cm}
  \begin{verbatim}
   \begin{picture}(900,900)(0,0)
     \put(0,0)   {\sixring{Q}{Q}{Q}{Q}{Q}{Q}{S}{D}{D} }
     \put(342,0) {\hetisix{D}{Q}{Q}{Q}{Q}{Q}{D}{D}{N} }
   \end{picture}
   \end{verbatim}
   \end{minipage}
   \caption{Fusion of fully drawn rings}
 \end{figure}
  
 There are also some macros that draw fragments specifically
 designed for fusing. The following fragments \\
 \[ \fuseiv{Q}{Q}{Q}{Q}{Q}{Q}{Q}{Q}{Q} \hspace{2.6cm}
    \fuseup{Q}{Q}{Q}{Q}{Q}{Q}{Q}{Q}{Q}    \hspace{1.4cm}
    \fuseiii{Q}{Q}{Q}{Q}{Q}{Q}     \]
 are produced by the \verb+\+fuseiv, \verb+\+fuseup, and
 \verb+\+fuseiii macros. They can be attached to the five-
 and sixrings as subpictures. These fragments have the
 advantage that they can provide more options for double
 bond locations than a full ring structure within the
 constraint of nine arguments.
 
 \vspace{\len mm}
 \noindent B. \underline{Attachment by Shifting the Coordinate
                         System}

 This method is easy to use when a complex structure can be
 perceived as a series of fragments put next to one another
 horizontally, although not necessarily on exactly the same
 level. The structure of nicotine shown in figure 5.2
 belongs to this category. As an alternative to the code
 listed in figure 5.2, the following LaTeX statements can 
 be used to produce the nicotine diagram: \\
 \indent \verb+\+pw = 470 \\
 \indent \verb+\+hetisix $\ldots$ \\
 \indent \verb+\+advance \verb+\+yi by 277  \\
 \indent \verb+\+hetifive $\ldots$\ \ \ . \\
 The first statement here sets the picture width \verb+\+pw
 for the pyridine ring so that the rightside end of the
 picture box is at the x-coordinate of the point of attachment.
 Now LaTeX will put the next item on the line, in this case
 the picture box with the pyrrolidine ring, flush next to
 the pyridine box. When the structure is printed in a math
 display environment (see chapter II) where no spacing between
 items on a line is applied, there will be no space between
 the picture boxes. When the structure is put into a figure
 environment only, without math display, normal spacing
 occurs as it would happen between words on a line.
 The user then has to request negative horizontal space
 between invoking the pyridine and the pyrrolidine macro
 to correct for the spacing. A statement                
 \verb+\+hspace\{-11pt\} produced the right correction for the
 typestyle of this document.
    
 The statement \verb+\+advance \verb+\+yi by 277 causes the
 coordinate-shifting in the pyrrolidine picture.
 By increasing the y-coordinate, the pyrrolidine structure
 is shifted upwards so that the points of attachment
 of the two rings meet. In general, the coordinate shifts
 $\,\Delta $xi and $\,\Delta $yi applied to the second or any
 following picture are determined from the points of
 attachment (${\rm x_{AB}}$,${\rm y_{AB}}$) and 
 (${\rm x_{BA}}$,${\rm y_{BA}}$)
 (the terminology used for figure 5.2) as follows: \\
 \centerline{${\rm \Delta xi=x_{BA} \mbox{,}\; 
                   \Delta yi=y_{AB}-y_{BA} }$.}
 
 For vertical attachment, connecting one fragment to the 
 lower end of another by coordinate shifting, the following
 steps are necessary: The points of attachment of the
 upper and the lower fragment are shifted to the bottom
 and to the top of their respective picture boxes and
 the x-coordinates of attachment are aligned. The new
 \verb+\+xi and \verb+\+yi values are then \\
 \indent $\backslash {\rm yi_{upper}=-y_{upper} }$ \\
 \indent $\backslash {\rm xi_{lower}=x_{upper}-x_{lower} }$ \\
 \indent $\backslash {\rm yi_{lower}=\backslash pht_{lower}-
         y_{lower}+14}$(correction for vertical spacing). \\
 \indent For the structure of adenosine shown in figure 5.8
 the points of attachment on purine (at the bottom of
 N-9) and on deoxyribose (at the top of the long bond)
 have the coordinates (513,-130) and (448,380),
 respectively. Thus the structure was produced by the code 
 given underneath the diagram.
 The horizontal space is used here instead of the centering
 option. The blank lines \newpage 
 \noindent after each ring structure code are
 necessary to inform LaTeX that the next item should not
 be printed on the same line.
 
 \begin{figure}
  \hspace{5cm} \yi=130
  \purine{Q}{D}{Q}{D}{Q}{$NH_2$}{Q}{D}{Q}

  \hspace{5cm} \xi=65  \yi=534
  \furanose{N}{}{}{$OH$}{}{$OH$}{}{$HO$}

 \begin{minipage}{14cm}
 \begin{verbatim}
 \hspace{5cm}  \yi=130           \purine{ ... }
 (blank line)
 \hspace{5cm}  \xi=65   \yi=534  \furanose{ ... }
 (blank line)
 \caption{ ... }
 \end{verbatim}
 \end{minipage}

  \caption{Vertical attachment by coordinate shifting}
 \end{figure}

 
 \vspace{\len mm}
 \centerline{3. ALIGNING STRUCTURES IN AN EQUATION}
 \vspace{\len mm}
 In a chemical equation containing structure diagrams the 
 various constituents of the equation have to be horizontally
 aligned. The equation is typeset in LaTeX's horizontal mode
 on one line, the current printline. Text items such as  
 condensed formulas and plus symbols are put on the line
 as usual, their (imaginary) baseline determining the
 position of the line. The structure diagrams, as drawn
 by the macros, will not be vertically centered on the
 current line. They are drawn in picture boxes which are
 typeset on the line with the lower end of the (imaginary)
 box at the baseline of the current line. The picture boxes
 are positioned at this height without regard to the
 coordinates declared for the lower left corner of the
 box. To line up the vertical middle of the diagram in the
 box with the text of the line, one would have to shift the
 diagram downwards beyond the bottom of the declared picture.
 While this can be done, it might result in a lack of space
 under the equation, since LaTeX reserves space only according
 to the declared dimensions of the picture. Paragraph boxes
 on the other hand are normally centered on the vertical
 center of the current line. Paragraph boxes containing
 the macros are positioned somewhat differently, with 
 a point one third up from the bottom of the picture at
 the base of the current line. Thus there is one third of
 the declared picture below the base of the current line 
 which yields enough vertical space to set off the 
 equation from the succeeding text. 
 
 The equation in
 figure 5.9 was typeset by putting each macro-drawn
 diagram into a \verb+\+parbox. The y-coordinate of the
 lower end of the pictures is -300 as usual, which puts
 position 2 of the sixring and the CHOH part from the
 \verb+\+cleft macro at the base of the current line.
 The LaTeX code for the equation is shown underneath it
 in the figure.
 The y-coordinates of the structures and of the reaction
 arrow, in this case drawn by a macro, could be
 shifted individually as well to change the alignment.
 The TeX control sequence \verb+\+to ($\to $) can be used
 instead of the special reaction arrow for chemistry;
 ($\,\to $) is always centered on the line.
 
 Getting good-looking horizontal spacings within the
 equation usually requires some experimenting.
 As previously mentioned, there is no inter-item
 spacing in math mode. Therefore more explicit horizontal
 space has to be added when chemical equations are
 typeset in the math display environment.

 \begin{figure}
  \hspace{1.5cm}
  \parbox{40pt}{\sixring{Q}{$R^{2}$}{Q}{Q}{Q}{Q}{S}{S}{C} }
  \hspace{1cm} $+$ \hspace{1.5cm}
  \parbox{40pt}{\cleft{$CH_{3}$}{S}{$CHOH$}{S}                 
                      {$CH_{3}$}{Q}{}  }
  \parbox{40pt}{\cto{BF_{3}}{60^{0}}{3} }  
  \hspace{3mm}
  \parbox{40pt}{\sixring{$CH{(CH_3)}_2$}{$R^{2}$}{Q}{Q}{Q}{Q}{S}{S}{C} }
 
  \begin{minipage}{14cm}
  \begin{verbatim}
  \hspace{1.5cm}
  \parbox{40pt}{\sixring{Q}{$R^{2}$}{Q}{Q}{Q}{Q}{S}{S}{C} }
  \hspace{1cm}  $+$  \hspace{1.5cm}
  \parbox{40pt}{\cleft{$CH_{3}$}{S}{$CHOH$}{S}
                      {$CH_{3}$}{Q}{}        }
  \parbox{40pt}{\cto{BF_{3}}{60_{0}}{3}      }
  \hspace{3mm}
  \parbox{40pt}{\sixring{$CH{(CH_3)}_2$}{$R_{2}$}{Q}{Q}{Q}{Q}
                        {S}{S}{C}  }
  \end{verbatim}
  \end{minipage}
 
  \caption{Alignment in a chemical equation}
 \end{figure}
 
 \end{document}
SHAR_EOF
cat << \SHAR_EOF > chap6a.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \setlength{\itemsep}{-2mm}
  \input{init.tex}
  \input{tbranch.tex}
  \input{acyc.tex}
  \input{cbranch.tex}
  \input{ccirc.tex}
  \begin {document}    
  \setcounter{page}{47}
  \setcounter{chapter}{6}
  \textfont1=\tenrm
  \initial
 \len=4
 \newcommand{\ri}{No action is taken for any other value of
 the argument}
 
 \centerline{CHAPTER VI}
 \vspace{\len mm}
 \centerline{THE COMPLETE SYSTEM OF MACROS --- ITS DESIGN}
 \centerline{AND ITS USE}
 \vspace{\len mm}
 \centerline{1. GENERAL DESIGN CRITERIA}
 \vspace{\len mm}
 LaTeX code can be written to typeset a structure diagram for any
 chemical compound in such a way that the diagram conforms to
 accepted practices in chemistry publications.  The purpose
 of the macros in this thesis is to reduce the amount of 
 low-level, bond-by-bond coding necessary to typeset a particular
 structure.  The problem of designing a generally useful system
 of macros for this purpose has to be seen in the context
 of the large number of possible structures: More than 7 million
 chemical compounds are registered with the Chemical Abstracts
 Service, including 60,000 different ring systems, and
 innumerable additional structures are possible.
 The fragments to be typeset by the macros in this thesis were
 selected such that they could be helpful in producing the
 more common types of structures.  The arguments of each macro
 in turn were selected with the goal of making the respective
 fragment as flexible as possible, such that the more common
 known structures of this type can be typeset by a particular
 macro.  The selection criteria were informal, using the
 ``expert knowledge'' of the writer. --- Where a related 
 approach to displaying chemical structure diagrams was taken
 in previous work, a similar selection of fragments was made
 (Zimmerman 84)(Bendall 80,85). Both authors are chemists and
 present a collection of fragments without any attempt to
 justify their choices.
 
 For more flexibility, the user of the system of macros 
 presented in this thesis can effect many structural
 variations by defining an outer picture (see chapter V)
 and placing supplemental lines and atomic symbols into
 it in addition to the fragment(s) produced by the macros.
 It is estimated that the \newpage
 \noindent macros can provide shortcuts
 to the drawing of more than 50\% of the structures shown
 in the widely used textbook by Solomons (Solomons 84).

 The next section lists the individual macros in this system,
 each with a typical generic structure and directions for
 the use of all arguments.  Specific selection criteria for
 the fragment as such and the arguments are mentioned in
 many cases.  The fragments are listed in the traditional
 categories of organic chemistry: acyclic structures,   
 alicyclic structures (rings where all ring members are
 carbon atoms), and heterocyclic structures.  The number
 of arguments is given in brackets behind the macro name.
 
 \vspace{\len mm}
 \centerline{2. MACROS OF THE SYSTEM}
 \vspace{\len mm}
 \noindent A. \underline{Macros for Acyclic Fragments}

 \vspace{\len mm}
 \indent i. \underline{Macro $\backslash $cbranch[9]}. \ This macro   
 typesets structural fragments with vertical branches:
 \pht=700

 \[ \cbranch{$R^{1}$}{S}{$R^{3}$}{S}{$Z$}{S}{$R^{7}$}{S}{$R^{9}$} \]

 \begin{description}
  \item[{\rm \ \ \ \ \ \ Arguments 1, 3, 7, 9: }] The substituent formulas for 
                  ${\rm R^1}$, ${\rm R^3}$, ${\rm R^7}$, and
                  ${\rm R^9}$.
  \item[{\rm \ \ \ \ \ \ Argument 2: }] The bond between ${\rm R^1}$ and Z, 
                  ``S'' for a single bond and ``D''for a double
                  bond. No action is taken for any other value of
                  the argument.
  \item[{\rm \ \ \ \ \ \ Argument 4: }] The bond between ${\rm R^3}$ and Z,
                 ``S'' for a single bond and ``D'' for a double
                 bond. When the argument is ``Q'', no bond is
                 drawn and ${\rm R^3}$ is moved next to Z.
  \item[{\rm \ \ \ \ \ \ Argument 5: }] The center atom(s), Z. When the argument is 
                 a string of more than one character, argument~6
                 should not be ``S'' or ``D,'' and argument~7
                 should be an empty set.
 \newpage
  \item[{\rm \ \ \ \ \ \ Argument 6: }] The bond between Z and ${\rm R^7}$,
                 ``S'' for a single bond and ``D'' for a double
                 bond. No action is taken for any other value
                 of the argument.
  \item[{\rm \ \ \ \ \ \ Argument 8:} ] The bond between Z and ${\rm R^9}$,
                 ``S'' for a single bond and ``D'' for a double
                 bond. No action is taken for any other value
                 of the argument.
 \end{description}
  
 \vspace{\len mm}
 \indent ii. \underline{Macro $\backslash $tbranch[7]}. \ 
 This macro typesets structural fragments with vertical branches
 similar to \verb+\+cbranch. The main reason for including
 \verb+\+tbranch is to show the use of the LaTeX tabbing
 mechanism for printing structural fragments.
 Macro \verb+\+cbranch is the preferred macro for structures
 of this type.  In contrast to the other macros, \verb+\+tbranch
 provides the math mode for the substituent formulas in the
 macro code. Therefore substituent formula arguments do not
 have to be enclosed by \$ symbols.

 \[ \tbranch{R^1}{S}{R^3-}{Z-}{S}{R^6}{13}  \]

 \begin{description}
  \item[{\rm \ \ \ \ \ \ Arguments 1 and 6: }] The substituent formulas
       for ${\rm R^1}$ and ${\rm R^6}$.
  \item[{\rm \ \ \ \ \ \ Argument 2: }] The bond between ${\rm R^1}$
       and Z, ``S'' for a single bond and ``D'' for a double 
       bond. No action is taken for any other value of the
       argument.
  \item[{\rm \ \ \ \ \ \ Argument 3: }] Atom symbols and bonds to the
       left of Z. Single bonds have to be typed in as hyphens,
       double bonds as equal signs.
  \item[{\rm \ \ \ \ \ \ Argument 4: }] The center atom Z and any 
       bonds and atom symbols to its right. Single bonds have to
       be typed in as hyphens, double bonds as equal signs.
  \item[{\rm \ \ \ \ \ \ Argument 5: }] The bond between Z and 
       ${\rm R^6}$, ``S'' for a single bond and ``D'' for 
       a double bond. No action is taken for any other value
       of the argument.
 \newpage
  \item[{\rm \ \ \ \ \ \ Argument 7: }] An integer number which is interpreted
       as printer points of negative space between lines.
       The correct number for a document with double spacing
       is 13.
 \end{description}
 
 \vspace{\len mm}
 \indent iii. \underline{Macro $\backslash $ethene[4]}.
  \ This macro typesets an ethene fragment with four variable
 substituents:

 \[ \ethene{$R^1$}{$R^2$}{$R^3$}{$R^4$} \]

 Arguments 1 -- 4 are the substituent formulas represented by
 ${\rm R^1}$, ${\rm R^2}$, ${\rm R^3}$, and ${\rm R^4}$.
 
 \vspace{\len mm}
 \indent iv. \underline{Macro $\backslash $upethene[4]}.
  \ This macro is similar to \verb+\+ethene, but it draws
 the ethene double bond vertically:

 \[ \upethene{$R^1$}{$R^2$}{$R^3$}{$R^4$} \]
 
 The arguments have the same meaning as they do for 
 \verb+\+ethene.

 \vspace{\len mm}
 \indent v. \underline{Macro $\backslash $cright[7]}.
 \ This macro typesets the following fragment which is 
 often used for carboxylic acids and their derivatives:

 \[ \cright{$R^1$}{S}{$Z$}{S}{$R^5$}{S}{$R^7$}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1,5,7:}] The substituent formulas
      ${\rm R^1}$, ${\rm R^5}$, and ${\rm R^7}$.
 \newpage
 \item[{\rm \ \ \ \ \ \ Argument 2:}] The bond between ${\rm R^1}$
      and Z, ``S'' for a single bond and ``D'' for a double
      bond. For an argument of ``Q'', no bond is drawn and
      ${\rm R^1}$ is moved next to Z.
 \item[{\rm \ \ \ \ \ \ Argument 3:}] The center atom(s) Z.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] The bond between Z and 
      ${\rm R^5}$, ``S'' for a single bond and ``D'' for
      a double bond. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 6:}] The bond between Z and ${\rm R^7}$,
      ``S'' for a single bond and ``D'' for a double bond. \ri .
 \end{description}

 \vspace{\len mm}
 \indent vi. \underline{Macro $\backslash $cleft[7]}.
  \ This macro typesets a fragment similar to the one produced
 by \verb+\+cright, but opening to the left:
 
 \[ \cleft{$R^1$}{S}{$Z$}{S}{$R^5$}{S}{$R^7$}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 5, 7:}] The substituent formulas
      ${\rm R^1}$, ${\rm R^5}$, and ${\rm R^7}$.
 \item[{\rm \ \ \ \ \ \ Argument 2:}] The bond between ${\rm R^1}$
      and Z, ``S'' for a single bond and ``D'' for a double
      bond. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 3:}] The center atom(s) Z.
      When the argument is a string of more than one character,
      argument~6 should not be ``S'' or ``D'', and argument~7
      should be an empty set.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] The bond between ${\rm R^5}$     
      and Z, ``S'' for a single bond and ``D'' for a double
      bond. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 6:}] The bond between Z and
      ${\rm R^7}$, ``S''for a single bond and ``D'' for a
      double bond. \ri .
 \end{description}

 \vspace{\len mm}
 \newpage
 \indent vii. \underline{Macro $\backslash $chemup[7]}.
 \ This macro typesets the following fragment which can
 be used for small molecules with trigonal geometry:

 \[ \chemup{$R^1$}{S}{$Z$}{S}{$R^5$}{S}{$R^7$}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 5, 7:}] The substituent formulas
      ${\rm R^1}$, ${\rm R^5}$, and ${\rm R^7}$.
 \item[{\rm \ \ \ \ \ \ Argument 2:}] The bond between ${\rm R^1}$ and
      Z, ``S'' for a single bond and ``D'' for a double bond. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 3:}] The center atom Z.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] The bond between Z and ${\rm R^5}$,
      ``S'' for a single bond and ``D'' for a double bond. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 6:}] The bond between Z and ${\rm R^7}$,
      ``S'' for a single bond and ``D'' for a double bond. \ri .
 \end{description}

 \vspace{\len mm}
 \indent viii. \underline{Macro $\backslash $cdown[7]}.
  \ This macro typesets a fragment similar to the one produced
 by \verb+\+chemup, but opening downwards:

 \[ \cdown{$R^1$}{S}{$Z$}{S}{$R^5$}{S}{$R^7$}   \]

 The arguments have the same meaning as they do for \verb+\+chemup.

 \vspace{\len mm}
 \newpage
 \indent ix. \underline{Macro $\backslash $csquare[5]}.
 \ This macro typesets a fragment that is sometimes used when all
 four substituents on a center atom have to be shown explicitly:

 \[ \csquare{$R^1$}{$R^2$}{$Z$}{$R^4$}{$R^5$}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 2, 3, 4:}] The substituent formulas
      ${\rm R^1}$, ${\rm R^2}$, ${\rm R^4}$, and ${\rm R^5}$.
 \item[{\rm \ \ \ \ \ \ Argument 3:}] The center atom Z.
 \end{description}  
   
 \vspace{\len mm}
 \indent x. \underline{Macro $\backslash $ccirc[4]}.
 \ This macro typesets a fragment used to show the actual
 configuration at a tetrahedral atom. The tetrahedral atom itself
 is not shown and is assumed to be in the middle of the sphere
 represented by the circle. The bonds typeset as heavier lines
 and intersecting the circle are directed out of the plane of
 the paper, towards the viewer.

 \[ \ccirc{$R^1$}{$R^2$}{$R^3$}{$R^4$}   \]

 The arguments 1 -- 4
 are the substituent formulas ${\rm R^1}$, ${\rm R^2}$,
 ${\rm R^3}$, and ${\rm R^4}$.




 

 \end{document}
 





SHAR_EOF
cat << \SHAR_EOF > chap6b.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \setlength{\itemsep}{-2mm}
  \input{init.tex}
  \input{rings1.tex}
  \input{fused.tex}
  \input{sixb.tex}
  \input{terp.tex}
  \begin {document}    
  \setcounter{page}{54}
  \setcounter{chapter}{6}
  \textfont1=\tenrm
  \initial
  \len=4
  \newcommand{\ri}{No action is taken for any other value of 
                   the argument}

 \noindent B. \underline{Macros for Alicyclic Ring Systems}

 \vspace{\len mm}
 \indent i. \underline{Macro $\backslash $threering[9]}.
 \ This macro typesets the cyclopropane ring. The aromatic
 cyclopropenyl cation is drawn with a circle enclosing a plus
 sign inside the ring. The ring positions to which ${\rm R^1}$,
 ${\rm R^2}$, and ${\rm R^3}$ are attached are designated as
 position 1, 2, and 3, respectively:

 \[ \threering{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}{S}{Q}{Q}
    \hspace{3cm}
    \threering{$R^1$}{$R^2$}{$R^3$}{Q}{Q}{Q}{S}{Q}{C}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 6:}] An argument of ``Q'' 
      causes no action. All other argument values are used as
      the respective substituent formulas ${\rm R^1}$, ${\rm R^2}$,
      ${\rm R^3}$, ${\rm R^4}$, ${\rm R^5}$, and ${\rm R^6}$.
      The bond line to ${\rm R^2}$ is straight if the circle is in
      the ring or if there is no second substituent at position 2,
      and slanted otherwise.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D'' typesets
      a second bond between ring positions 1 and 3. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``Q'' causes 
      no action. All other argument values cause an outside double
      bond to be drawn from ring position 2, and the argument itself
      to be put at the end of the double bond as the substituent formula.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``C'' typesets
      a circle enclosing a plus sign inside the ring. All other
      argument values cause no action.
 \end{description}
 
 \vspace{\len mm}
 \indent ii. \underline{Macro $\backslash $fourring[9]}.
 \ This macro typesets the cyclobutane ring. The ring positions
 to which ${\rm R^1}$, ${\rm R^2}$, ${\rm R^3}$, and ${\rm R^4}$
 are attached are designated position 1, 2, 3, and 4, respectively.
 
 \[ \fourring{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}{S}{S}{Q} 
    \hspace{3cm}
    \fourring{Q}{Q}{Q}{Q}{Q}{Q}{Q}{D}{$R^9$} \]
 
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 6:}] An argument of ``Q'' causes
      no action. All other argument values are used as the respective
      substituent formulas ${\rm R^1}$, ${\rm R^2}$, ${\rm R^3}$,
      ${\rm R^4}$, ${\rm R^5}$, and ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D'' typesets
      a second bond between ring positions 1 and 2. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``D'' typesets
      a second bond between ring positions 3 and 4. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``Q'' causes
      no action. All other argument values cause an outside
      double bond to be drawn from ring position 2, and the
      argument itself to be put at the end of the double bond
      as substituent formula ${\rm R^9}$.
 \end{description}

 \vspace{\len mm}
 \indent iii. \underline{Macro$\backslash $fivering[9]}.
 \ This macro typesets the cyclopentane ring. The aromatic
 cyclopentadienyl anion is drawn with a circle enclosing a
 minus sign inside the ring. The ring positions to which 
 ${\rm R^1}$, ${\rm R^2}$, ${\rm R^3}$, ${\rm R^4}$, and
 ${\rm R^5}$ are attached are designated as position
 1, 2, 3, 4, and 5, respectively:

 \[ \fivering{$R^1$}{$R^2$}{Q}{$R^4$}{$R^5$}{$R^6$}{$R^7$}{$R^8$}{Q}
    \hspace{3cm}
    \fivering{Q}{Q}{$R^3$}{Q}{Q}{S}{S}{Q}{C}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 5:}] An argument of ``Q''
      causes no action. All other argument values are used as the
      respective substituent formulas ${\rm R^1}$, ${\rm R^2}$,
      ${\rm R^3}$, ${\rm R^4}$, and ${\rm R^5}$.
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``D'' typesets
      a second bond between ring positions 1 and 2. An argument
      of ``S'' causes no action. All other argument values are
      used as the substituent formula ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D'' typesets
      a second bond between ring positions 4 and 5. An argument
      of ``S'' causes no action.  All other argument values are
      used as the substituent formula ${\rm R^7}$.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``Q'' causes
      no action. All other argument values cause an outside
      double bond to be drawn from ring position 3, and the
      argument itself to be put at the end of the double bond
      as substituent formula ${\rm R^8}$.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``C'' typesets
      a circle enclosing a minus sign inside the ring. \ri .
 \end{description}

 \vspace{\len mm}
 \indent iv. \underline{Macro$\backslash $sixring[9]}.
 \ This macro typesets a carbon sixring as a regular hexagon. 
 A benzene ring can be drawn with alternating double bonds or
 with a circle inside the ring. The ring positions to which
 ${\rm R^1}$, ${\rm R^2}$, ${\rm R^3}$, ${\rm R^4}$, ${\rm R^5}$,
 and ${\rm R^6}$ are attached are designated as position
 1, 2, 3, 4, 5, and 6, respectively:

 \[ \sixring{$R^1$}{$R^2$}{Q}{$R^4$}{$R^5$}{$R^6$}{$R^7$}{$R^8$}{D}
    \hspace{3cm}
    \sixring{Q}{Q}{$R^3$}{Q}{Q}{Q}{S}{S}{C}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 6:}] An argument of ``Q'' causes
      no action. All other argument values are used as the respective
      substituent formulas ${\rm R^1}$, ${\rm R^2}$, ${\rm R^3}$,
      ${\rm R^4}$, ${\rm R^5}$, and ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D'' typesets
      a second bond between ring positions 1 and 2. An argument
      of ``S'' causes no action. All other argument values are
      used as the substituent formula ${\rm R^7}$.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``D'' typesets
      a second bond between ring positions 3 and 4. An argument
      of ``S'' causes no action. All other argument values cause
      an outside double bond to be drawn from ring position 3
      and the argument itself to be put at the end of the double
      bond as substituent formula ${\rm R^8}$.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``D'' typesets
      a second bond between ring positions 5 and 6. An argument
      of ``C'' typesets a circle inside the ring. \ri .
 \end{description}
 
 \vspace{\len mm}
 \indent v. \underline{Macro $\backslash $sixringa[9]}.
 \ This macro differs from \verb+\+sixring only in the positions
 of the double bonds. A value of ``D'' for arguments 7, 8, and 9
 puts a double bond between ring positions 1 and 6, ring positions
 2 and 3, and ring positions 4 and 5, respectively.
 Since the carbon sixring is so common, more options are needed
 for it than for the other rings.

 \vspace{\len mm}
 \indent vi. \underline{Macro $\backslash $sixringb[9]}.
 \ This macro is also very similar to \verb+\+sixring, but it
 allows all 17 chemically possible combinations of double bonds,
 including the three quinoid structures that can not be typeset
 with \verb+\+sixring or \verb+\+sixringa.

 \[ \sixringb{Q}{Q}{Q}{Q}{Q}{Q}{$R^7$}{$R^8$}{9}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 6:}] These arguments have the
      same meaning as in \verb+\+sixring.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``Q'' causes
      no action. All other argument values cause an outside 
      double bond to be drawn from ring position 6 and the
      argument itself to be put at the end of the double bond
      as substituent formula ${\rm R^7}$.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``Q'' causes
      no action. All other argument values cause an outside
      double bond to be drawn from ring position 3 and the
      argument itself to be put at the end of the double bond
      as substituent formula ${\rm R^8}$.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An integer number. The number
      zero causes the circle to be drawn inside the ring.
      All other integers are interpreted as a combination of
      ring double bonds according to the bit pattern corresponding
      to the decimal integer: A bit pattern of 000001 is interpreted
      as a double bond beginning at ring position 1, a bit pattern
      of 100000 (integer 32) as a double bond beginning at ring
      position 6. Thus, argument 9 for the diagram shown above
      is 9 (001001).
      No action occurs for argument values that correspond to
      a combination of double bonds which is chemically not
      possible, namely any combination with two adjoining
      double bonds.
 \end{description}
 
 \vspace{\len mm}
 \indent vii. \underline{Macro$\backslash $chair[8]}.
 \ This macro typesets the saturated carbon sixring in its most
 favorable conformation. The axial and equatorial bond lines
 to the substituents are always drawn by this macro, even when
 there is no substituent in a particular position. This is the
 usual practice in drawing the chair form.

 \[ \chair{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}{$R^7$}{$R^8$} \]

 The eight arguments represent the respective substituent formulas
 ${\rm R^1}$ -- ${\rm R^8}$.

 \pagebreak
 \indent viii. \underline{Macro $\backslash $naphth[9]}.
 \ This macro typesets the aromatic naphthalene ring system, 
 the fully saturated decalin ring system, and the         
 1,2,3,4-tetra\-hydro\-naphthalene shown in the diagram. The position
 numbers 1~--~8 are specified by the nomenclature rules of
 chemistry.

 \[ \naphth{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}{$R^7$}
           {$R^8$}{Q} \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1~--~8:}] An argument of Q causes
      no action. All other argument values are used as the 
      respective substituent formulas ${\rm R^1}$~--~${\rm R^8}$.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] A value of ``S'' typesets the
      ring system with no double bonds (decalin). A value of ``D''
      typesets the aromatic system naphthalene with alternating
      double bonds. All other argument values draw the partially
      saturated system shown above.
 \end{description}
 
 \vspace{\len mm}
 \indent ix. \underline{Macro $\backslash $terpene[9]}. 
 \ This macro typesets the bicyclo(2.2.1)heptane ring system
 found in such terpenes as borneol, camphor, and fenchol.
 The position numbers 1~--~7 are specified by the 
 nomenclature rules of chemistry.

 \[ \terpene{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}
            {M}{$R^8$}{Q}   \hspace{3.5cm}
    \terpene{Q}{Q}{Q}{Q}{Q}{Q}{Q}{O}{$R^9$} \]
 
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1~--~6:}]  An argument of ``Q''
       causes no action. All other argument values are used
       as the respective substituent formulas ${\rm R^1}$~--~
       ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``M''
       prints two methyl groups on bonds extending from
       carbon \#7.  All other arguments cause no action.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``Q''
      causes no action. An argument of ``O'' prints an
      oxo group at carbon \#2. All other argument values
      are used as a second substituent on carbon \#2,
      shown as ${\rm R^8}$.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``Q''
      causes no action. An argument of ``D'' prints a second bond
      between positions 2 and 3. All other argument values
      are used as a second substituent on carbon \#3, 
      shown as ${\rm R^9}$.
 \end{description}  


 \vspace{\len mm}
 \indent x. \underline{Macro $\backslash $steroid[9]}.
 \ This macro typesets the steroid skeleton. The position
 numbers are specified by the nomenclature rules. The 
 arguments are selected such that common types of steroids
 can be printed. Cholesterol, estradiol, progesterone,
 and cortisone are some of the steroids that can be produced.
 \pht=1600  \pw=1200

 \[ \steroid{$R^{11}$}{D}{$R^3$}{Q}{Q}{D}{$R^{20}$}
     {$R^{21}$}{$R^{17}$}  \]

 \pht=900  \pw=400
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Argument 1:}] An argument of ``D'' 
      prints a second bond between positions 1 and 2.
      An argument of ``Q'' causes no action. All other
      argument values cause an outside double bond to be
      drawn from position 11 and the argument itself to be
      put at the end of the double bond as substituent
      formula ${\rm R^{11}}$.
 \newpage
 \item[{\rm \ \ \ \ \ \ Argument 2:}] An argument of ``D''
      prints a second bond between positions 3 and 4
      (this double bond is shown in the diagram).
      An argument of ``Q'' causes no action. All other
      argument values cause an outside double bond to be
      drawn from position 3 and the argument itself to be
      put at the end of the double bond.          
 \item[{\rm \ \ \ \ \ \ Argument 3:}] An argument of ``Q''
      causes no action. All other argument values cause
      a single bond to be drawn from position 3 and the
      argument itself to be put at the end of the bond
      as substituent formula ${\rm R^3}$.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] An argument of ``D''
      prints a second bond between positions 4 and 5.
      All other argument values cause no action.
 \item[{\rm \ \ \ \ \ \ Argument 5:}] An argument of ``D''
      prints a second bond between positions 5 and 6.
      An argument of ``Q'' causes no action. All other
      argument values cause an outside double bond 
      to be drawn from position 17 and the argument
      itself to be put at the end of the double bond.
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``D''
      prints a second bond between positions 5 and 10
      (shown in the diagram). An argument of ``M''
      prints the methyl group containing carbon \#19 and the
      bond to it.
      \ri .
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``Q''
      causes no action. All other argument values print
      the substituent formula beginning with carbon \#20,
      represented by ${\rm R^{20}}$ in the diagram, and the
      bond to it.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``Q''
      causes no action. All other argument values print
      the substituent formula beginning with carbon \#21,
      represented by ${\rm R^{21}}$ in the diagram,
      and the bond to it.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``Q''
      causes no action. All other argument values print
      the second substituent on carbon \#17 and the bond 
      to it. This substituent is shown in the diagram
      as ${\rm R^{17}}$.
 \end{description}


 
\end{document}





SHAR_EOF
cat << \SHAR_EOF > chap6c.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \setlength{\itemsep}{-2mm}
  \input{init.tex}
  \input{rings2.tex}
  \input{hetthree.tex}
  \input{hetfive.tex}
  \begin {document}    
  \setcounter{page}{62}
  \setcounter{chapter}{6}
  \textfont1=\tenrm
  \initial
  \len=4
 \newcommand{\ri}{All other argument values cause no action}
 \newcommand{\rhq}{An argument of ``Q'' causes no action. \ }

 \noindent C. \underline{Macros for Heterocyclic Ring Systems}

 \vspace{\len mm}
 \indent i. \underline{Macro $\backslash $hetthree[8]}.
 \ This macro typesets a 3-membered ring with one hetero atom.
 The common ring structures of this type are epoxides (oxirane)
 and ethylene imine (aziridine). Ring positions 1, 2, and 3 are
 the positions to which ${\rm R^1}$, ${\rm R^2}$, and ${\rm R^3}$   
 are attached.

 \[ \hetthree{${\rm R^1}$}{${\rm R^2}$}{${\rm R^3}$}{${\rm R^4}$}
               {Q}{S}{H}{N}  \]
 
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 5:}] An argument of ``Q''
      causes no action. All other argument values are used as 
      the respective substituent formulas ${\rm R^1}$ -- ${\rm R^5}$.
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``S'' typesets
      a bond to the left of ring atom \#2. An argument of ``H''
      puts ---H to the left of ring atom \#2. For all other
      argument values, no bond is drawn and ${\rm R^2}$ is moved
      next to ring atom \#2.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``S'' typesets
      a bond to the right of ring atom \#3. An argument of ``H''
      puts H--- to the right of ring atom \#3. For all other
      argument values, no bond is drawn and ${\rm R^3}$ is
      moved next to ring atom \#3.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] The atom symbol for the
      hetero atom.
 \end{description}

 \vspace{\len mm}
 \indent ii. \underline{Macro $\backslash $hetifive[9]}.
 \ This macro typesets 5-membered rings with one hetero atom.
 Thus it can be used to print the pyrrole, furan, and
 thiophene ring systems, and their hydrogenated versions.
 The arguments are selected such that common compounds like
 proline, pyrrolidone, maleic anhydride, and vitamin C
 can be printed. Ring positions 1, 2, 3, 4, and 5 are the
 positions to which ${\rm R^1}$ -- ${\rm R^5}$ are attached.
 
 \[ \hetifive{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{D}{Q}{D}{$N$}
    \hspace{3cm}
    \hetifive{Q}{O}{Q}{Q}{O}{Q}{D}{Q}{O}  \]
 
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1,3,4:}] An argument of ``Q''
      causes no action. All other argument values are used
      as the respective substituent formulas ${\rm R^1}$,
      ${\rm R^3}$, and ${\rm R^4}$. 
 \item[{\rm \ \ \ \ \ \ Argument 2:}] An argument value of ``Q''
      causes no action. An argument value of ``O'' puts an
      outside double bond with an O in ring position 2.
      All other argument values are used as the substituent
      formula ${\rm R^2}$ with a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 5:}] An argument value of ``Q''
      causes no action. An argument value of ``O'' puts an
      outside double bond with an O in ring position 5.
      All other argument values are used as the substituent
      formula ${\rm R^5}$ with a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``D'' draws
      a second bond between ring positions 2 and 3. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D'' draws
      a second bond between ring positions 3 and 4. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``D'' draws
      a second bond between ring positions 4 and 5. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 9:}] The atomic symbol of the
      hetero atom.
 \end{description}

 \vspace{\len mm}
 \indent iii. \underline{Macro $\backslash $heticifive[9]}.
 \  This macro typesets a 5-membered ring with 2 hetero atoms
 separated by a carbon atom. Thus it can be used to print ring
 systems such as imidazole, thiazole, and oxazole. The arguments
 were selected by considering actually occurring compounds
 containing these ring systems. Ring positions 1, 2, 3, 4, and 5
 are the positions to which ${\rm R^1}$ -- ${\rm R^5}$ are
 attached.
 
 \[ \heticifive{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{Q}{$R^7$}
    {$N$}{$N$}     \hspace{3cm}
    \heticifive{Q}{O}{Q}{Q}{Q}{Q}{D}{N}{O} \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 3, 5:}] An argument of ``Q''
      causes no action. All other argument values are used as 
      the respective substituent formulas ${\rm R^1}$, ${\rm R^3}$,     
      and ${\rm R^5}$. 
 \item[{\rm \ \ \ \ \ \ Argument 2:}] An argument of ``Q''causes no
      action. An argument of ``O'' puts an outside double bond
      with an O in ring position 2. All other argument values
      are used as the substituent formula ${\rm R^2}$ with
      a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] An argument of ``Q''causes
      no action. An argument of ``O'' puts an outside double bond
      with an O in ring position 4. All other argument values
      are used as the substituent formula ${\rm R^4}$ with a 
      single bond.
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``D'' draws 
      a second bond between ring positions 2 and 3. \ri .
 \item[{\rm \ \ \ \ Argument 7:}] An argument of ``Q'' causes
      no action. An argument of ``D'' draws a second bond
      between ring positions 4 and 5. All other argument values
      are used as the substituent formula ${\rm R^7}$, the second
      substituent at ring position 5.
 \item[{\rm \ \ \ \ \ \ Arguments 8 and 9:}] The atomic symbols of the
      hetero atoms in position 1 and 3, respectively.
 \end{description}

 \vspace{\len mm}
 \newpage
 \indent iv. \underline{Macro $\backslash $pyrazole[8]}.
 \ The pyrazole ring is found in a number of drugs, such as
 aminopyrine. Ring positions 1, 2, 3, 4, and 5 are the 
 positions to which ${\rm R^1}$ -- ${\rm R^5}$ are attached.
 \yi=200   \pht=750

 \[ \pyrazole{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{Q}{D}{Q}
    \hspace{3cm}
    \pyrazole{$R^1$}{Q}{Q}{Q}{O}{D}{Q}{Q}  \]

 \reinit
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 2, 4:}] An argument of ``Q''
      causes no action. All other argument values are used as
      the respective substituent formulas ${\rm R^1}$, ${\rm R^2}$,
      and ${\rm R^4}$.
 \item[{\rm \ \ \ \ \ \ Argument 3:}] An argument of ``Q'' causes
      no action. An argument of ``O'' puts an outside double
      bond with an O in ring position 3. All other argument
      values are used as the substituent formula ${\rm R^3}$
      with a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 5:}] An argument of ``Q'' causes
      no action. An argument of ``O'' puts an outside double
      bond with an O in ring position 5. All other argument
      values are used as the substituent formula ${\rm R^5}$
      with a single bond.
 \item[{\rm \ \ \ \ \ \ Arguments 6, 7, 8:}] An argument of ``D''
      draws a second bond between ring positions 2 and 3,
      ring positions 3 and 4, and ring positions 4 and 5,
      respectively. \ri .
 \end{description}
  
 \vspace{\len mm}
 \indent v. \underline{Macro $\backslash $hetisix[9]}.
 \ This macro typesets a six-membered ring with one hetero
 atom. Thus it can be used to print ring systems such as
 pyridine and pyran. The arguments were selected by  
 considering actually occurring compounds such as the
 B vitamins niacin and pyridoxine and the coumarin ring
 system. Ring positions 1 -- 6 are the positions to which
 ${\rm R^1}$ -- ${\rm R^6}$ are attached.

 \[ \hetisix{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}       
            {D}{D}{$N$}
    \hspace{3cm}
    \hetisix{Q}{Q}{Q}{Q}{Q}{Q}{$R^7$}{Q}{O}    \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Argument 1:}] An argument of ``Q'' causes
      no action. An argument of ``D'' prints a second bond
      between positions 1 and 6. All other arguments values
      are used as the substituent formula ${\rm R^1}$.
 \item[{\rm \ \ \ \ \ \ Arguments 2 -- 6:}] An argument of ``Q''
      causes no action. All other argument values are used as    
      the respective substituent formulas ${\rm R^2}$ -- 
      ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``Q'' causes
      no action. An argument of ``D'' prints a second bond
      between positions 2 and 3. All other argument values
      cause an outside double bond to be drawn from position
      2 and the argument itself to be put at the end of the
      double bond as ${\rm R^7}$.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``D'' prints
      a second bond between positions 4 and 5. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 9:}] The atomic symbol of the
      hetero atom.
 \end{description}

 \vspace{\len mm}
 \indent vi. \underline{Macro $\backslash $pyrimidine[9]}.
      The pyrimidine ring occurs in such important compounds
      as cytosine, thymine, uracil, and the barbiturates.
      The arguments of the macro were selected such that
      these compounds can be typeset. Ring positions 1 -- 6
      are the positions to which ${\rm R^1}$ -- ${\rm R^6}$
      are attached.

 \[ \pyrimidine{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}
               {Q}{Q}{D}
    \hspace{3cm}
    \pyrimidine{$H$}{O}{$H$}{O}{$R^5$}{O}{Q}{$R^8$}{Q} \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 3, 5:}] An argument of ``Q''
      causes no action. All other argument values are used
      as the respective substituent formulas ${\rm R^1}$, 
      ${\rm R^3}$, and ${\rm R^5}$. 
 \item[{\rm \ \ \ \ \ \ Argument 2:}] An argument of ``Q'' causes
      no action. An argument of ``O'' causes an outside double
      bond with an O to be drawn at position 2. All other
      argument values are used as the substituent formula
      ${\rm R^2}$ with a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] An argument of ``Q'' causes
      no action. An argument of ``O'' causes an outside double
      bond with an O to be drawn at position 4. All other
      argument values are used as the substituent formula
      ${\rm R^4}$ with a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``Q'' causes
      no action. An argument of ``O'' causes an outside double
      bond with an O to be drawn at position 6. All other
      argument values are used as the substituent formula
      ${\rm R^6}$ with a single bond.
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D''
      prints a second bond between positions 1 and 2. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``Q'' causes
      no action. An argument of ``D'' prints a second bond
      between positions 3 and 4. All other argument values
      are used as the second substituent in position 5, 
      ${\rm R^8}$.
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``D''
      prints a second bond between positions 5 and 6. \ri .
 \end{description}
 
 \vspace{\len mm}
 \indent vii. \underline{Macro $\backslash $pyranose[9]}.
 \ This macro was developed specifically for monosaccharide
 structures. Carbon \#1 is at the position to which 
 ${\rm R^1}$ is attached. Structures from this macro look
 best with substituent formulas in 10 point size (shown)
 or even smaller.

 \[ \pyranose{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}
             {$R^7$}{$R^8$}{$R^9$}  \]

 Arguments 1 -- 9 are used as the respective substituent
 formulas ${\rm R^1}$ -- ${\rm R^9}$. \rhq 

 \vspace{\len mm}
 \indent viii. \underline{Macro $\backslash $furanose[8]}.
 \ This macro was also developed specifically for
 monosaccharide structures. Carbon \#1 is at the position
 to which ${\rm R^1}$ is attached. Structures look best
 with substituent formulas in 10 point size (shown)
 or even smaller.

 \[ \furanose{$R^1$}{$R^2$}{$R^3$}{$R^4$}{$R^5$}{$R^6$}
             {$R^7$}{$R^8$}     \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Argument 1:}] \rhq An argument of ``N''
      prints a long vertical bond at position 1,  
      used for attachment to
      purine and pyrimidine bases to form nucleosides.
      All other argument values are used as the substituent
      formula ${\rm R^1}$.
 \item[{\rm \ \ \ \ \ \ Arguments 2 -- 8}] \rhq  All other 
      argument values are used as the respective substituent
      formulas ${\rm R^2}$ -- ${\rm R^8}$.
 \end{description}
    
 \vspace{\len mm}
 \indent ix. \underline{Macro $\backslash $purine[9]}.
 \ The purine ring system occurs in such important compounds
 as adenine, guanine, caffeine, and uric acid. The arguments
 of the macro were selected such that these compounds can
 be typeset. Positions 1, 2, 3, 6, 7, 8, and 9 are indicated
 in the following diagram by the respective substituent
 formulas.

 \[ \purine{$R^1$}{$R^2$}{$R^3$}{Q}{$R^6$}{Q}{$R^7$}
           {$R^8$}{$R^9$}   \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1, 3, 6, 7, 9:}] \rhq
      All other argument values are used as the respective
      substituent formulas ${\rm R^1}$ $\ldots$ ${\rm R^9}$.
 \item[{\rm \ \ \ \ \ \ Argument 2:}] An argument of ``D'' prints
      a second bond between positions 2 and 3. All other 
      argument values cause an outside double bond to be
      printed at position 2 and the argument itself to be put
      at the end of the double bond as the substituent formula
      ${\rm R^2}$.
 \item[{\rm \ \ \ \ \ \ Argument 4:}] An argument of ``D'' prints
      a second bond between positions 1 and 6. \ri .
 \item[{\rm \ \ \ \ \ \ Argument 5:}] \rhq . All other argument
      values cause an outside double bond to be printed at
      position 6 and the argument itself to be put at the end
      of the double bond as the substituent formula 
      ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``D'' prints
      a second bond between positions 7 and 8. All other
      argument values cause an outside double bond to be
      printed at position 8 and the argument itself to be put
      at the end of the double bond as the substituent
      formula ${\rm R^8}$.
 \end{description}




 \end{document}




        
 
 





SHAR_EOF
cat << \SHAR_EOF > chap6d.tex

  \documentstyle[12pt]{report}
  \nofiles                          
  \def\LATEX{\LaTeX}
  \let\TEX = \TeX               
  \setcounter{totalnumber}{5}   
  \setcounter{topnumber}{3}     
  \setcounter{bottomnumber}{3}
  \setlength{\oddsidemargin}{3.9cm}     %real measurement 1.5in
  \setlength{\textwidth}{5.7in}         %right margin is now 1in
  \setlength{\topmargin}{1cm}
  \setlength{\headheight}{.6cm}
  \setlength{\textheight}{8.5in}
  \setlength{\parindent}{1cm}
  \renewcommand{\baselinestretch}{1.5}
  \raggedbottom
  \setlength{\itemsep}{-2mm}
  \input{init.tex}
  \input{fparts.tex}
  \input{cto.tex}
  \input{bonds.tex}
  \begin {document}    
  \setcounter{page}{70}
  \setcounter{chapter}{6}
  \textfont1=\tenrm
  \initial
  \newcommand{\rhq}{An argument of ``Q'' causes no action. \ }
  \newcommand{\ri}{All other argument values cause no action. }
 \len=4
  
 \vspace{\len mm}
 \noindent D. \underline{General Utility Macros}

 \vspace{\len mm}
 \indent i. \underline{Macro $\backslash $fuseiv[9]}.
 \ This macro typesets a fragment that is designed to be
 connected at two places to another ring system with the
 effect of fusing an additional sixring to that system.
 The fragment can be fused to positions 1 and 2 of the
 carbon fivering and the carbon sixring, and to positions
 2 and 3 of the \verb+\+hetifive and \verb+\+hetisix rings
 without changing
 the unitlength and the \verb+\+yi coordinate.
 \yi=200  \pht=750

 \[ \fuseiv{$R^1$}{$R^2$}{$R^3$}{$R^4$}{D}{$R^6$}{Q}{Q}{D} \]

 \reinit
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 4:}]  \rhq  All other argument
 values are used as the substituent formulas ${\rm R^1}$ --
 ${\rm R^4}$.
 \item[{\rm \ \ \ \ \ \ Argument 5:}]  An argument of ``D''
      prints a second bond between the upper point of 
      attachment and position 1 (this double bond is shown
      in the diagram). \ri
 \item[{\rm \ \ \ \ \ \ Argument 6:}] \rhq  An argument of ``D'' prints
      a second bond between positions 1 and 2. All other argument
      values are used as the substituent formula ${\rm R^6}$.
 \item[{\rm \ \ \ \ \ \ Argument 7:}]  An argument of ``D''
      prints a second bond between positions 2 and 3. All other
      argument values cause no action.
 \item[{\rm \ \ \ \ \ \ Argument 8:}] \rhq  An argument of ``D'' prints
      a second bond between positions 3 and 4.  All other 
      argument values are used as a second substituent in
      position 3 (not shown in the diagram).
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``D'' prints
      a second bond from the lower point of attachment to
      position 4 (this double bond is shown in the diagram).
      All other argument values cause no action.
 \end{description}
 \newpage
 \indent ii. \underline{Macro $\backslash $fuseup[9]}.
 \ This macro typesets a fragment that is designed to be
 connected at two places to another ring system with the
 effect of fusing an additional sixring to that system
 at an angle. The fragment can be fused to positions 
 1 and 6 of the carbon sixring and positions 3 and 4 of
 the \verb+\+hetisix rings without changing the unitlength
 and the \verb+\+yi coordinate.
 \advance \yi by -500 

 \[ \fuseup{$R^1$}{$R^2$}{$R^3$}{$R^4$}{D}{Q}{D}{Q}{D} \]

 \yi=300
 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 4:}] \rhq  All other
      argument values are used as the respective substituent
      formulas ${\rm R^1}$ -- ${\rm R^4}$.
 \item[{\rm \ \ \ \ \ \ Argument 5:}] An argument of ``D'' prints
      a second bond from the upper point of attachment to
      position 1 (the resulting double bond is shown in the
      diagram). \ri    
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``D'' prints
      a second bond between positions 1 and 2. \ri  
 \item[{\rm \ \ \ \ \ \ Argument 7:}] An argument of ``D'' prints
      a second bond between positions 2 and 3 (the resulting 
      double bond is shown in the diagram). \ri 
 \item[{\rm \ \ \ \ \ \ Argument 8:}] An argument of ``D'' prints 
      a second bond between positions 3 and 4. \ri 
 \item[{\rm \ \ \ \ \ \ Argument 9:}] An argument of ``D'' prints
      a second bond between position 4 and the lower point
      of attachment (the resulting double bond is shown in
      the diagram). \ri 
 \end{description}
 \newpage
 \indent iii. \underline{Macro $\backslash $fuseiii[6]}.
 \ This macro typesets a fragment that is designed to be
 connected at two places to another ring system with the
 effect of fusing an additional fivering to that system.
 The fragment can be fused to positions 1 and 2 of the
 carbon fivering and sixring, and to positions 2 and 3 of
 the \verb+\+hetifive and \verb+\+hetisix rings  
 without changing the unitlength and the \verb+\+yi
 coordinate.
 \pht=600

 \[ \fuseiii{$R^1$}{$R^2$}{$R^3$}{$R^4$}{Q}{D}   \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 -- 4:}] \rhq  All other
      arguments are used as the respective substituent
      formulas ${\rm R^1}$ -- ${\rm R^4}$.
 \item[{\rm \ \ \ \ \ \ Argument 5:}] \rhq  All other argument
      values are used as a second substituent in position~2
      (not shown in the diagram).
 \item[{\rm \ \ \ \ \ \ Argument 6:}] An argument of ``D''
      prints a second bond between positions 1 and 2. \ri 
 \end{description}

 \vspace{\len mm}
 \indent iv. \underline{Macro $\backslash $cto[3]}.
 \ This macro draws a reaction arrow and puts the requested
 character strings representing reagents and reaction
 conditions on top and below the arrow, respectively.
 The arrow is made long enough to accommodate the longer
 of the strings. The vertical position of the arrow can be
 changed by changing the \verb+\+yi value.
 \pw=1500

 \[ \cto{string\  on\  top\  of\  the\  arrow}{string\  below}{26} \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Arguments 1 and 2:}] The character 
      strings above and below the arrow, respectively.
 \item[{\rm \ \ \ \ \ \ Argument 3:}] An integer, the number of characters -- 
      including subscripts -- in the longer string.
 \end{description}
 
 \vspace{\len mm}
 \indent v. \underline{Macro $\backslash $sbond[1]}.
 \ This macro draws a horizontal single bond of a specified
 length, vertically centered on a line. It should be used
 for structural formulas that do not use the picture
 environment and are written on one line.

 \[ \sbond{20}  \]

 The argument is an integer, expressing the length of the
 bond in printer points (1 pt = .35 mm).
 
 \vspace{\len mm}
 \indent vi. \underline{Macro $\backslash $dbond[2]}.
 \  This macro draws a horizontal double bond of a
 specified length. It should be used for structural
 formulas that do not use the picture environment and
 are written on one line.

 \[ \dbond{20}{19}  \]

 \begin{description}
 \item[{\rm \ \ \ \ \ \ Argument 1:}] An integer, expressing
      the length of the bond in printer points.
 \item[{\rm \ \ \ \ \ \ Argument 2:}] An integer, expressing
      the amount of vertical space by which the bonds have
      to be pushed together to give the desired vertical
      distance. In a document with double spacing, the
      number 19 produced the spacing in the double bond
      shown above. 
 \end{description}

 \vspace{\len mm}
 \indent vii. \underline{Macro $\backslash $tbond[2]}.
 \ This macro is similar to \verb+\+dbond, except that it
 draws a triple bond:

 \[ \tbond{20}{20}  \]

 The meaning of the arguments is the same as in 
 \verb+\+dbond. The number 20 was used as argument 2.
 \vspace{\len mm}
  

 \centerline{3. COMMON REQUIREMENTS FOR THE USE OF THE SYSTEM}
 \vspace{\len mm}
 So far in this thesis it has been explained how to write
 LaTeX code to produce a chemical structure diagram at a
 particular place in a document. This section will discuss the
 mandatory and the optional statements at the beginning of an
 input file that make the system of macros accessible and
 its use more practical and convenient. Figure 6.1 contains
 these statements together with the two required declarations
 at the beginning of a LaTeX file, lines (1) and (9).
 (The line numbers are for reference only, they are not used
 in the input file.)

 The part of the input file preceding the \verb+\+begin\{document\}
 statement is called the ``preamble'' in the LaTeX Manual.
 In addition to the statements shown here, the preamble usually
 contains declarations pertaining to text formatting details
 such as margin width, text height on a page, and space between
 lines. 

 The statement in line (2) of figure 6.1 is necessary if the
 structure-drawing macros of this thesis are to be used for
 the preparation of a document. This statement reads the file
 init.tex into TeX's memory, a file that contains two short
 macros, \verb+\+initial and \verb+\+reinit. Macro \verb+\+initial
 defines the command sequences \verb+\+xi, \verb+\+yi, \verb+\+pw,
 \verb+\+pht, \verb+\+xbox, and \verb+\+len  as integer variables
 and assigns a count register to each of them.  The use of the
 first four variables in the picture declaration and the use
 of \verb+\+xbox in a minipage or parbox environment was
 explained in chapter III. The counter \verb+\+len is a general
 purpose integer variable for the user. All the variables
 except \verb+\+len are also given initial values. ---
 Furthermore, the unitlength for the picture environments is
 set to 0.1 printer points in \verb+\+initial. This is the
 recommended unitlength for the chemical structure diagrams,
 but it can be changed anywhere in the document. ---
 Line (11) from figure 6.1 expands \verb+\+initial. 

 The macro \verb+\+reinit simply resets all the parameters
 to their initial values from \verb+\+initial. It is a
 convenience, especially for cases where more than one
 variable needs to be reset.

 \begin{figure}\centering
  \begin{minipage}{8cm}
  \begin{verbatim}
   (1)  \documentstyle[12pt]{report}
   (2)  \input{init.tex}
   (3)  \input{rings1.tex}
   (4)  \setcounter{totalnumber}{4}
   (5)  \setcounter{topnumber{2}
   (6)  \setcounter{bottomnumber}{2}
   (7)  \renewcommand{\topfraction}{.5}
   (8)  \renewcommand{\bottomfraction}{.5}
   (9)  \begin{document}
   (10) \textfont1=\tenrm
   (11) \initial
  \end{verbatim}
  \end{minipage}
  \caption{Statements at the beginning of a LaTeX file}
 \end{figure}
 
 The statement in line (3) of figure 6.1  reads a file                      
 with structure-drawing macros. There will usually be
 several such statements, reading in different macros or
 sets of macros. At the installation where this work was
 done the TeX memory is not large enough to read in all
 the chemistry macros. TeX's own macros already take up
 13\% of the reserved memory and when the LaTeX macros are
 added, two thirds of the memory are used before an
 input file is processed. --- Reading in just part of the 
 structure-drawing macros for any given document has the
 advantage of saving processing time.
 
 Lines (4) -- (8) in figure 6.1 affect the placement of
 ``floats'' on the page. The only floats discussed in this
 thesis are the diagrams produced in the figure
 environment (see chapter III). In defining the style
 of a document -- the report style is designated by line (1) -- 
 the LaTeX program sets default values for the maximum
 total number of floats on a page (three), the maximum
 number of floats at the top of the page (two), and at
 the bottom of the page (one). These values can be 
 changed for documents with an unusually large number
 of figures. Thus, lines (4) -- (6) increase the 
 maximum number of floats to 4, evenly distributed on
 the page. It is then necessary to change the counters
 \verb+\+topfraction and \verb+\+bottomfraction to
 reflect the distribution of figures on the page.

 Finally, line(10) is the optional redefinition of the
 math textfont, discussed in chapter III. This definition
 can be changed anywhere in the document.

  \end{document}
                                                                                                                                                         
 
 





SHAR_EOF
cat << \SHAR_EOF > macros.tex
  \newcommand{\initial}  {
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % Macro initial declares variables and initializes the       %
   % variables and the unitlength.  Macro reinit resets the     %
   % values of the variables and the unitlength to the          %
   % original values.                                           %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %
     \setlength{\unitlength}{.1pt}
     \newcount\xi        \newcount\yi
     \xi=0               \yi=300
     % coordinates of lower left corner
     \newcount\pht       \pht=900            % picture height
     \newcount\pw        \pw=400             % picture width
     \newcount\xbox      \xbox=50            % width of minipage
     \newcount\len  }    % general purpose variable     
     % end macro initial
  \newcommand{\reinit}   {\xi=0   \yi=300    \xbox=50  
              \setlength{\unitlength}{.1pt}
              \pht=900 \pw=400  }   % end macro reinit
 \newcommand{\cbranch}[9]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The cbranch macro draws vertical branches as single and    %
  % double bonds, up and down.                                 %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  \begin{picture}(\pw,\pht)(-\xi,-\yi)
               \put(0,200)    {#1}                 % upper subst.
   \ifx#2S     \put(40,85)    {\line(0,1)  {100}}  % single up
   \else\ifx#2D\multiput(27,85)(26,0){2}           % double up   
                              {\line(0,1)  {100}} \fi \fi
   \ifx#4Q     \put(-305,0)   {\makebox(300,87)[r]{#3}}
                              % left substituent without bond 
   \else       \put(-455,0)   {\makebox(300,87)[r]{#3}} \fi
                              % left substituent with bond
   \ifx#4S     \put(-150,33)  {\line(1,0)  {140}}  % single left
   \else\ifx#4D\multiput(-150,20)(0,26){2}         % double left
                              {\line(1,0)  {140}} \fi \fi
               \put(0,0)      {#5}                 % center 
                                                   %  atom(s)
   \ifx#6S     \put(90,33)    {\line(1,0)  {140}}  % single right
   \else\ifx#6D\multiput(90,20)(0,26){2}           % double right
                              {\line(1,0)  {140}} \fi \fi
               \put(240,0)    {#7}                 % right subst.
   \ifx#8S     \put(40,-15)   {\line(0,-1) {100}}  % single down
   \else\ifx#8D\multiput(27,-15)(26,0){2}          % double down
                              {\line(0,-1) {100}} \fi \fi
               \put(0,-210)   {#9}                 % lower subst.
  \end{picture}           }   % end cbranch macro
 \newcommand{\tbranch}[7]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Macro tbranch draws structures with vertical branches,     %
  % single or double bonds, going up or down.                  %
  % This macro uses the LaTeX tabbing mechanism.               %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  \begin{minipage}{\xbox pt}
   \begin{tabbing}
    $#3$\= $#4$\+ \kill
           $#1$   \\ [-#7pt]     % print top subst.
    \ifx#2S                      % vertical bond going up
           \hspace{4pt}\rule{0.4pt}{8pt}  \\ [-#7pt]\fi
    \ifx#2D
           \hspace{2pt}\rule{0.4pt}{8pt}  
           \hspace{-2pt}\rule{0.4pt}{8pt} \\ [-#7pt]\fi
           \- \kill
    $#3$\> $#4$\+ \\ [-#7pt]     % substituents on print line
    \ifx#5S                      % vertical bond going down
           \hspace{4pt}\rule{0.4pt}{8pt}  \\ [-#7pt]\fi
    \ifx#5D
           \hspace{2pt}\rule{0.4pt}{8pt}    
           \hspace{-2pt}\rule{0.4pt}{8pt} \\ [-#7pt]\fi
           $#6$
  \end{tabbing}
 \end{minipage}    }             % end tbranch macro
 \newcommand{\ethene}[4]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a horizontal ethene fragment with    %
  % four variable substituents.                              %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(-405,170)  {\makebox(300,87)[r]{#1}}       % upper left
                                                    %  subst.  
    \put(-405,-185) {\makebox(300,87)[r]{#3}}       % lower left
                                                    %  subst.
    \put(0,70)      {\line(-1,1)        {100}}      % NW bond
    \put(0,0)       {\line(-1,-1)       {100}}      % SW bond
    \put(0,0)       {C}                             % left C
    \multiput(90,20)(0,25){2} {\line(1,0){140}}     % double bond
    \put(240,0)     {C}                             % right C
    \put(315,70)    {\line(1,1)         {100}}      % NE bond
    \put(315,0)     {\line(1,-1)        {100}}      % SE bond
    \put(425,170)   {#2}                            % upper right
                                                    %  subst.
    \put(425,-170)  {#4}                            % lower right
                                                    %  subst.
   \end{picture}               }              % end ethene macro
 \newcommand{\upethene}[4]   {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a vertical ethene fragment with four   %
  % variable substituents.                                     %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(-430,360)           {\makebox(300,87)[r]{#1}} % NW subst.
    \put(-430,-150)          {\makebox(300,87)[r]{#2}} % SW subst.
    \put(210,370)            {#3}                      % NE subst.
    \put(210,-140)           {#4}                      % SE subst.
    \put(0,300)              {\line(-5,3)  {121}}      % NW bond
    \put(0,230)              {C}                       % upper C
    \put(20,80)              {\line(0,1)   {140}}      % vertical
    \put(46,80)              {\line(0,1)   {140}}      %  d. bond
    \put(0,0)                {C}                       % lower C
    \put(0,0)                {\line(-5,-3) {121}}      % SW bond
    \put(80,300)             {\line(5,3)   {121}}      % NE bond
    \put(80,0)               {\line(5,-3)  {121}}      % SE bond
   \end{picture}             }              % end upethene macro            
 \newcommand{\cright}[7]        {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a trigonal fragment, opening to the     %
  % right. The fragment has a variable center atom and three    %
  % variable substituents. Bonds can be single or double.       %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \ifx#2Q \put(-305,-15){\makebox(300,87)[r]{#1}}   % left sub.
     \else  \put(-455,-15){\makebox(300,87)[r]{#1}} \fi
    \ifx#2S \put(-150,33)    {\line(1,0)   {140}} \fi % single 
                                                      % hor. bond
    \ifx#2D \put(-150,20)    {\line(1,0)   {140}}     % hor.
            \put(-150,46)    {\line(1,0)   {140}} \fi %  d. bond
    \put(0,0)                {#3}                     % center
                                                      %  atoms
    \ifx#4S \put(80,70)      {\line(1,1)   {100}} \fi % NE single
                                                      %  bond
    \ifx#4D \put(71,79)      {\line(1,1)   {100}}
            \put(89,61)      {\line(1,1)   {100}} \fi % NE double
    \put(185,170)            {#5}                     % NE subst.
    \ifx#6S \put(80,0)       {\line(1,-1)  {100}} \fi % SE single
    \ifx#6D \put(71,-9)      {\line(1,-1)  {100}}     % SE double
            \put(89,9)       {\line(1,-1)  {100}} \fi %  bond
    \put(185,-170)           {#7}                     % SE subst.
   \end{picture}             }               % end cright macro
 \newcommand{\cleft}[7]      {
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % This macro typesets a trigonal fragment, opening to the     %
 % left. The fragment has a variable center atom and three     %
 % variable substituents. Bonds can be single or double.       %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % 
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(-405,160)           {\makebox(300,87)[r]{#1}} % NW subst.
    \ifx#2S \put(0,70)       {\line(-1,1)  {100}} \fi  % NW single
                                                       %  bond
    \ifx#2D \put(9,79)       {\line(-1,1)  {100}}      % NW double
            \put(-9,61)      {\line(-1,1)  {100}} \fi  %  bond
    \put(0,0)                {#3}                      % center 
                                                       %  atoms(s)
    \ifx#4S \put(0,0)        {\line(-1,-1) {100}} \fi  % SW single
    \ifx#4D \put(-9,9)       {\line(-1,-1) {100}}      % SW double
            \put(9,-9)       {\line(-1,-1) {100}} \fi  %  bond
    \put(-405,-185)          {\makebox(300,87)[r]{#5}} % SW subst.
    \ifx#6S \put(90,33)      {\line(1,0)   {140}} \fi  % hor.
                                                       %  single
    \ifx#6D \put(90,20)      {\line(1,0)   {140}}      %  double
            \put(90,46)      {\line(1,0)   {140}} \fi  %  bond
    \put(240,0)              {#7}                      % right sub.
   \end{picture}             }               % end cleft macro
 \newcommand{\chemup}[7]        {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a trigonal fragment, opening          %
  % upwards.  The fragment has a variable center atom and     %
  % three variable substituents.  Bonds are single or         %
  % double.                                                   %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(-430,130)           {\makebox(300,87)[r]{#1}} % NW subst.
    \ifx#2S \put(0,70)       {\line(-5,3)  {121}} \fi  % NW single
    \ifx#2D \put(7,81)       {\line(-5,3)  {121}}      % NW double
            \put(-7,59)      {\line(-5,3)  {121}} \fi  %    bond
    \put(0,0)                {#3}                      % center 
                                                       %  atom(s)
    \ifx#4S \put(33,-10)     {\line(0,-1)  {140}} \fi  % vertical 
                                                       %  single
    \ifx#4D \put(20,-10)     {\line(0,-1)  {140}}      % vertical
            \put(46,-10)     {\line(0,-1)  {140}} \fi  %  double
    \put(0,-230)             {#5}                      % bottom
                                                       %  subst.
    \ifx#6S \put(80,70)      {\line(5,3)   {121}} \fi  % NE single
    \ifx#6D \put(73,81)      {\line(5,3)   {121}}      % NE double
            \put(87,59)      {\line(5,3)   {121}} \fi  %    bond
    \put(210,140)            {#7}                      % NE subst.
  \end{picture}              }                % end chemup macro
 \newcommand{\cdown}[7]      {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a trigonal fragment, opening            %
  % downwards. The fragment has a variable center atom and      %
  % three variable substituents. Bonds are single or double.    %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(0,230)              {#1}                      % upper sub.
    \ifx#2S \put(33,80)      {\line(0,1)   {140}} \fi  % vert. 
                                                       %  single
    \ifx#2D \put(20,80)      {\line(0,1)   {140}}      %  double
            \put(46,80)      {\line(0,1)   {140}} \fi
    \put(0,0)                {#3}                      % center 
                                                       %  atom(s)
    \ifx#4S \put(0,0)        {\line(-5,-3) {121}} \fi  % SW single
    \ifx#4D \put(-7,11)      {\line(-5,-3) {121}}      % SW double
            \put(7,-11)      {\line(-5,-3) {121}} \fi  %    bond
    \put(-430,-150)          {\makebox(300,87)[r]{#5}} % SW subst.
    \ifx#6S \put(80,0)       {\line(5,-3)  {121}} \fi  % SE bond
    \ifx#6D \put(87,11)      {\line(5,-3)  {121}}      % SE double
            \put(73,-11)     {\line(5,-3)  {121}} \fi  %    bond
    \put(210,-140)           {#7}                      % SE subst.
   \end{picture}             }               % end cdown macro
 \newcommand{\csquare}[5]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a fragment that consists of a variable  %
  % center atom with four variable substituents pointing to     %
  % the four corners of a square.                               %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(-405,160)           {\makebox(300,87)[r]{#1}} % NW subst.
    \put(0,70)               {\line(-1,1)  {100}}      % NW bond
    \put(0,0)                {#3}                      % center 
                                                       %  atom
    \put(0,0)                {\line(-1,-1) {100}}      % SW bond 
    \put(-405,-185)          {\makebox(300,87)[r]{#4}} % SW subst.
    \put(80,70)              {\line(1,1)   {100}}      % NE bond
    \put(185,170)            {#2}                      % NE subst.
    \put(80,0)               {\line(1,-1)  {100}}      % SE bond
    \put(185,-170)           {#5}                      % SE subst.
  \end{picture}              }                % end csquare macro       
 \newcommand{\ccirc}[4]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The ccirc macro draws a circle with 2 substituents          %
  % infront of the circle and 2 behind it to give a             %
  % threedimensional impression.                                %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
 \begin{picture}(\pw,\pht)(-\xi,-\yi)
   \put(90,0)    {\circle{180}}
   \put(90,90)   {\line(0,1)   {70}}        % behind and up
   \put(60,170)  {#1}
   \thicklines
   \put(30,10)   {\line(-5,2)  {140}}       % in front
   \put(-415,30) {\makebox(300,87)[r]{#2}}  %  and left
   \put(150,10)  {\line(5,2)   {140}}       % in front 
   \put(300,30)  {#3}                       %  and right
   \thinlines
   \put(90,-90)  {\line(0,-1) {90}}         % behind and
   \put(60,-260) {#4}                       %  down
 \end{picture}     }                % end ccirc macro

 \newcommand{\threering}[9]     {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The threering macro typesets the cyclopropane ring       %
  % with optional substituents, an optional double bond,     %
  % and a plus inside the ring for aromaticity.              %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
       \put(300,0)     {\line(-3,-5) {150}}     % bond 1 to 2
       \put(150,-244)  {\line(-3,5)  {150}}     % bond 2 to 3
       \put(0,0)       {\line(1,0)   {300}}     % bond 3 to 1
       \ifx#7D \put(40,-40){\line(1,0){220}}\fi % double 3 to 1
       \ifx#1Q                                  % subst. on 1
         \else\put(300,0)    {\line(5,3)   {128}}
              \put(433,50)   {#1}           \fi
       \ifx#2Q                                  % subst. on 2
         \else\ifx#9C \put(150,-244) {\line(0,-1){100}}
                      \put(114,-424) {#2}  % on straight bond
                 \else\put(150,-244) {\line(5,-3)  {128}}
                      \put(283,-344) {#2} \fi \fi % slanted 
       \ifx#2Q                                  % subst. on 2
         \else\ifx#5Q \put(150,-244) {\line(0,-1){100}}
                      \put(114,-424) {#2}  % on straight bond
                 \else\put(150,-244) {\line(5,-3)  {128}}
                      \put(283,-344) {#2} \fi \fi % slanted 
       \ifx#3Q                                  % subst. on 3
         \else\put(0,0)      {\line(-5,3)  {128}}
              \put(-430,34) {\makebox(300,87)[r]{#3}} \fi
       \ifx#4Q                                  % second subst. 
         \else\put(300,0)    {\line(5,-3)  {128}} %  on 1
              \put(433,-100) {#4}           \fi
       \ifx#5Q                                  % second subst. 
         \else\put(150,-244) {\line(-5,-3) {128}} %  on 2
              \put(-280,-360){\makebox(300,87)[r]{#5}}  \fi
       \ifx#6Q                                  % second subst. 
         \else\put(0,0)      {\line(-5,-3) {128}} %  on 3
              \put(-430,-116){\makebox(300,87)[r]{#6}} \fi
       \ifx#8Q
         \else\multiput(135,-244)(30,0){2}      % outside 
              {\line(0,-1)   {100}}             %  double
              \put(114,-424) {#8}           \fi %  on 2
       \ifx#9C \put(150,-90){\circle{120}}   % circle with +
               \put(110,-120){+}            \fi
       \end{picture}            }   % end cycloprop. macro
 \newcommand{\fourring}[9]      {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The fourring macro typesets the cyclobutane ring with      %
  % optional substituents and double bonds.                    %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
      \put(300,300)   {\line(0,-1)  {300}}      % bond 1 to 2
      \put(300,0)     {\line(-1,0)  {300}}      %      2 to 3
      \put(0,0)       {\line(0,1)   {300}}      %      3 to 4
      \put(0,300)     {\line(1,0)   {300}}      %      4 to 1
      \ifx#7D\put(260,260){\line(0,-1){220}}\fi % double 1 to 2
      \ifx#8D\put(40,40)  {\line(0,1) {220}}\fi % double 3 to 4
      \ifx#1Q                                   % subst. on 1
        \else\put(300,300){\line(5,3) {128}}  
             \put(433,350){#1}              \fi
      \ifx#2Q                                   % subst. on 2
        \else\put(300,0)  {\line(5,-3){128}}
             \put(433,-100){#2}             \fi
      \ifx#3Q                                   % subst. on 3
        \else\put(0,0)    {\line(-5,-3){128}}
             \put(-430,-116){\makebox(300,87)[r]{#3}} \fi
      \ifx#4Q                                   % subst. on 4
        \else\put(0,300)  {\line(-5,3) {128}}
             \put(-430,334){\makebox(300,87)[r]{#4}}  \fi
      \ifx#5Q                                   % second subst. 
        \else\put(300,300){\line(5,-3) {128}}   %  on 1
             \put(433,200){#5}              \fi
      \ifx#6Q                                   % second subst. 
        \else\put(0,300)  {\line(-5,-3){128}}   %  on 4
             \put(-430,184){\makebox(300,87)[r]{#6}}  \fi
      \ifx#9Q                                   % outs. double 
        \else\multiput(280,-5)(20,30){2}        %  and subst.
             {\line(1,-1){100}} \put(405,-140){#9}   \fi % on 2
    \end{picture}         }             % end cyclobutane macro
   \newcommand{\fivering}[9]    {
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % This macro typesets the cyclopentane ring with optional    %
    % substituents and double bonds. A minus sign in a circle    %
    % can be put inside the ring to denote aromaticity.          %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %
       \begin{picture}(\pw,\pht)(-\xi,-\yi)
        \put(342,200)    {\line(0,-1)   {200}}       % bond 1 to 2
        \put(342,0)      {\line(-5,-3)  {171}}       % bond 2 to 3
        \put(171,-103)   {\line(-5,3)   {171}}       % bond 3 to 4
        \put(0,0)        {\line(0,1)    {200}}       % bond 4 to 5
        \put(0,200)      {\line(1,0)    {342}}       % bond 5 to 1
        \ifx#1Q                                      % subst. on 1 
          \else\put(342,200)   {\line(5,3)  {128}}
               \put(475,250)   {#1}              \fi
        \ifx#2Q                                      % subst. on 2
          \else\put(342,0)     {\line(5,-3) {128}}
               \put(475,-100)  {#2}              \fi
        \ifx#3Q                                      % subst. on 3
          \else\put(171,-103)  {\line(0,-1) {100}}
               \put(150,-283)  {#3}              \fi
        \ifx#4Q                                      % subst. on 4
          \else\put(0,0)       {\line(-5,-3){128}}
               \put(-430,-116) {\makebox(300,87)[r]{#4}}  \fi
        \ifx#5Q                                      % subst. on 5
          \else\put(0,200)     {\line(-5,3) {128}}
               \put(-430,234)  {\makebox(300,87)[r]{#5}}  \fi
        \ifx#6D\put(316,174)   {\line(0,-1) {148}}   % double 1,2
          \else\ifx#6S
                 \else\put(342,200) {\line(5,-3) {128}}
                      \put(475,100){#6}   \fi        % second sub.
        \fi                                          %  on 1
        \ifx#7D\put(26,26)     {\line(0,1)  {148}}   % double 4,5
          \else\ifx#7S
                 \else\put(0,200){\line(-5,-3){128}} % second sub. 
                      \put(-430,84){\makebox(300,87)[r]{#7}}  \fi
        \fi                                          %  on 5
        \ifx#8Q                                      % outs. double 
          \else\multiput(156,-103)(30,0){2}          %  and subst. 
               {\line(0,-1) {100}} \put(135,-283){#8}  \fi  % on 3
        \ifx#9C\put(171,60)    {\circle{210}}        % circle and 
               \put(130,35)    {$-$}       \fi       %  minus
      \end{picture}          }                 % end 5-ring macro
  \newcommand{\sixring}[9]   {
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % The sixring macro draws standard carbon sixrings in the    %
   % shape of a regular hexagon. There are optional ring        %
   % double bonds and substituents.                             %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(342,200)  {\line(0,-1)  {200}}          % bond 1 to 2
    \put(342,0)    {\line(-5,-3) {171}}          % bond 2 to 3
    \put(171,-103) {\line(-5,3)  {171}}          % bond 3 to 4
    \put(0,0)      {\line(0,1)   {200}}          % bond 4 to 5      
    \put(0,200)    {\line(5,3)   {171}}          % bond 5 to 6
    \put(171,303)  {\line(5,-3)  {171}}          % bond 6 to 1
    \ifx#7D                                      % d. bond 1,2 
      \put(316,174)   {\line(0,-1)  {148}}       
      \else \ifx#7S                              % 2. sub. on 1
            \else\put(342,200) {\line(5,-3) {128}}
                 \put(475,100) {#7}    \fi  \fi
    \ifx#8D
      \put(162,-67)   {\line(-5,3)  {126}}       % double 3 to 4
      \else\ifx#8S
           \else\put(156,-203) {\line(0,1){100}} % outside 
                                                 %  double and
                \put(186,-203) {\line(0,1){100}} %  subst. on 3
                \put(135,-283) {#8}    \fi  \fi
    \ifx#9D
      \put(36,191)    {\line(5,3)   {126}} \fi   % double 5 to 6   
    \ifx#9C \put(171,100) {\circle{250}}   \fi   % circle for 
                                                 %  aromaticity
    \ifx#1Q                                      % subst. on 1
      \else\put(342,200)  {\line(5,3){128}}
           \put(475,250)  {#1}             \fi
    \ifx#2Q
      \else\put(342,0)    {\line(5,-3){128}}     % subst. on 2
           \put(475,-100)    {#2}          \fi
    \ifx#3Q
      \else\put(171,-203) {\line(0,1){100}}
           \put(150,-283) {#3}             \fi   % subst. on 3
    \ifx#4Q
       \else\put(0,0)     {\line(-5,-3){128}}    % subst. on 4
            \put(-430,-116){\makebox(300,87)[r]{#4}}  \fi
    \ifx#5Q
      \else\put(0,200)    {\line(-5,3){128}}     % subst. on 5
           \put(-430,234) {\makebox(300,87)[r]{#5}}   \fi
    \ifx#6Q
      \else\put(171,303)  {\line(0,1){100}}      % subst. on 6
           \put(150,410)  {#6}             \fi
    \ifx#7D  \ifx#9C \message{Error: ring double bond 
                             simultaneous with circle}
    \fi   \fi
   \end{picture}           }                % end sixring macro
  \newcommand{\sixringa}[9]   {
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % This macro differs from the original sixring macro only    %
   % in the position of the double bonds in the ring.           %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
       \put(342,200)  {\line(0,-1)  {200}}          % bond 1 to 2
       \put(342,0)    {\line(-5,-3) {171}}          % bond 2 to 3
       \put(171,-103) {\line(-5,3)  {171}}          % bond 3 to 4
       \put(0,0)      {\line(0,1)   {200}}          % bond 4 to 5      
       \put(0,200)    {\line(5,3)   {171}}          % bond 5 to 6
       \put(171,303)  {\line(5,-3)  {171}}          % bond 6 to 1
       \ifx#7D                                      % double 1,6 
         \put(306,191)   {\line(-5,3)  {126}}       
         \else \ifx#7S                              % second subst. 
               \else\put(342,200) {\line(5,-3) {128}}
                    \put(475,100) {#7}    \fi  \fi  %  on 1
       \ifx#8D
         \put(178,-67)   {\line(5,3)   {126}}       % double 3,2
         \else\ifx#8S
              \else\put(156,-203) {\line(0,1){100}} % outs. double 
                   \put(186,-203) {\line(0,1){100}} %  and subst. 
                   \put(135,-283) {#8}    \fi   \fi %  on 3
       \ifx#9D
         \put(26,26)     {\line(0,1)   {148}} \fi   % double 4,5   
       \ifx#9C \put(171,100) {\circle{250}}   \fi   % circle for
                                                    %  aromaticity
       \ifx#1Q                                      % subst. on 1
         \else\put(342,200)  {\line(5,3){128}}
              \put(475,250)  {#1}             \fi
       \ifx#2Q
         \else\put(342,0)    {\line(5,-3){128}}     % subst. on 2
              \put(475,-100)    {#2}          \fi
      \ifx#3Q
         \else\put(171,-203) {\line(0,1){100}}
              \put(150,-283) {#3}             \fi   % subst. on 3
       \ifx#4Q
          \else\put(0,0)     {\line(-5,-3){128}}    % subst. on 4
               \put(-430,-116){\makebox(300,87)[r]{#4}} \fi
       \ifx#5Q
         \else\put(0,200)    {\line(-5,3){128}}     % subst. on 5
              \put(-430,234) {\makebox(300,87)[r]{#5}}  \fi
       \ifx#6Q
         \else\put(171,303)  {\line(0,1){100}}      % subst. on 6
              \put(150,410)  {#6}             \fi
       \ifx#7D  \ifx#9C \message{Error: ring double bond with 
                                        circle} \fi   \fi
      \end{picture}           }             % end sixringa macro
  \newcommand{\sixringb}[9]   {
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % This variation of the sixring can typeset all combina-     %
   % tions of double bonds in the ring through argument 9.      %
   % A para-quinoid structure is also possible.                 %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % macros to typeset the ring double bonds:
  \newcommand{\di}   {\put(316,174){\line(0,-1){148}}} %double 1-2
  \newcommand{\dii}  {\put(178,-67){\line(5,3) {126}}} %double 2-3
  \newcommand{\diii} {\put(162,-67){\line(-5,3){126}}} %double 3-4
  \newcommand{\dfour}{\put(26,26)  {\line(0,1) {148}}} %double 4-5
  \newcommand{\dv}   {\put(36,191) {\line(5,3) {126}}} %double 5-6
  \newcommand{\dsix} {\put(306,191){\line(-5,3){126}}} %double 6-1
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
       \put(342,200)  {\line(0,-1)  {200}}          % bond 1 to 2
       \put(342,0)    {\line(-5,-3) {171}}          % bond 2 to 3
       \put(171,-103) {\line(-5,3)  {171}}          % bond 3 to 4
       \put(0,0)      {\line(0,1)   {200}}          % bond 4 to 5      
       \put(0,200)    {\line(5,3)   {171}}          % bond 5 to 6
       \put(171,303)  {\line(5,-3)  {171}}          % bond 6 to 1
       \ifx#7Q                                      
        \else\put(158,303) {\line(0,1) {100}}       % outs. double
             \put(184,303) {\line(0,1) {100}}       %  bond and 
             \put(130,420) {#7}    \fi              %  sub. on 6
       \ifx#8Q
        \else\put(156,-203){\line(0,1){100}}        % outs. double 
             \put(186,-203){\line(0,1){100}}        %  bond and 
             \put(135,-283) {#8}   \fi              %  sub.on 3
       % 17 double bond combinations:
       \ifcase#9 \put(171,100) {\circle{250}}        % circle 
         \or \di \or \dii \or \or diii \or \di \diii % arg 9=1-5       
         \or \or \or dfour \or \dfour \di            % arg 9=6-9
         \or \dfour \dii \or \or \or \or \or \or \dv % arg 9=10-16
         \or \dv \di \or \dv \dii \or \or \dv \diii  % arg 9=17-20
         \or \dv \diii \di \or \or \or \or \or \or   % arg 9=21-27
         \or \or \or \or \or \dsix \or \or \dsix \dii %      28-34
         \or \or \dsix \diii \or \or \or             % arg 9=35-39
         \or \dsix \dfour \or \or \dsix \dfour \dii  % arg 9=40-42
       \fi
       \ifx#1Q                                      % subst. on 1
         \else\put(342,200)  {\line(5,3){128}}
              \put(475,250)  {#1}       \fi
       \ifx#2Q
         \else\put(342,0)    {\line(5,-3){128}}     % subst. on 2
              \put(475,-100)    {#2}    \fi
      \ifx#3Q
         \else\put(171,-203) {\line(0,1){100}}
              \put(150,-283) {#3}       \fi         % subst. on 3
       \ifx#4Q
          \else\put(0,0)     {\line(-5,-3){128}}    % subst. on 4
               \put(-430,-116){\makebox(300,87)[r]{#4}}  \fi
       \ifx#5Q
         \else\put(0,200)    {\line(-5,3){128}}     % subst. on 5
              \put(-430,234) {\makebox(300,87)[r]{#5}}   \fi
       \ifx#6Q
         \else\put(171,303)  {\line(0,1){100}}      % subst. on 6
              \put(150,410)  {#6}       \fi
       \ifx#7D  \ifx#9C \message{Error: ring double bond with
                                        circle}  \fi  \fi
      \end{picture}           }              % end sixringb macro
  \newcommand{\chair}[8]       {
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % The chair macro typesets the saturated carbon sixring in   %
   % its most favorable conformation. Axial and equatorial      %
   % substituents can be attached in 4 positions.               %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
      \put(0,0)       {\line(3,-4)  {170}}      % bond 1 to 2
      \put(170,-226)  {\line(3,1)   {403}}      %      2 to 3
      \put(573,-91)   {\line(6,-1)  {210}}      %      3 to 4
      \put(783,-126)  {\line(-3,4)  {170}}      %      4 to 5
      \put(613,100)   {\line(-3,-1) {403}}      %      5 to 6
      \put(210,-35)   {\line(-6,1)  {210}}      %      6 to 1
                                          % bonds to subst. :
      \put(0,0)       {\line(0,1)   {100}}      % axial on 1
      \put(170,-226)  {\line(0,-1)  {100}}      % axial on 2
      \put(573,-91)   {\line(0,1)   {100}}      % axial on 3
      \put(783,-126)  {\line(0,-1)  {100}}      % axial on 4
      \put(613,100)   {\line(0,1)   {100}}      % axial on 5
      \put(210,-35)   {\line(0,-1)  {100}}      % axial on 6
      \put(0,0)       {\line(-3,-1) {128}}      % eq. on 1
      \put(170,-226)  {\line(-3,1)  {128}}      % eq. on 2
      \put(573,-91)   {\line(3,-1)  {128}}      % eq. on 3
      \put(783,-126)  {\line(3,1)   {128}}      % eq. on 4
      \put(613,100)   {\line(3,-1)  {128}}      % eq. on 5
      \put(210,-35)   {\line(-3,1)  {128}}      % eq on 6
                                          % variable subst.:
      \ifx#1Q\else\put(-30,110)     {#1}    \fi % axial on 1
      \ifx#2Q\else\put(140,-406)    {#2}    \fi % axial on 2
      \ifx#3Q\else\put(543,9)       {#3}    \fi % axial on 3
      \ifx#4Q\else\put(753,-306)    {#4}    \fi % axial on 4
      \ifx#5Q\else\put(-430,-85) {\makebox(300,87)[r]{#5}}
      \fi                                       % eq. on 1
      \ifx#6Q\else\put(-260,-226){\makebox(300,87)[r]{#6}}
      \fi                                       % eq. on 2
      \ifx#7Q\else\put(415,-230) {\makebox(300,87)[r]{#7}}
      \fi                                       % eq. on 3
      \ifx#8Q\else\put(916,-115)    {#8}    \fi % eq. on 4
     \end{picture}              }         % end chair macro
 \newcommand{\naphth}[9]        {       
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets the naphthalene ring system.           %
  % One or both rings can be saturated. An optional sub-       %
  % stituent is possible at each ring position.                %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
    \begin{picture}(\pw,\pht)(-\xi,-\yi)
     \multiput(0,200)(342,0){2}   {\line(5,3) {171}} % 7,8; 8a,1
     \multiput(171,303)(342,0){2} {\line(5,-3){171}} % 8,8a; 1,2
     \multiput(0,0)(342,0){3}     {\line(0,1) {200}} % 6,7;4a,8a
                                                     % 3,2
     \multiput(0,0)(342,0){2}     {\line(5,-3){171}} % 6,5; 4a,4
     \multiput(171,-103)(342,0){2}{\line(5,3) {171}} % 5,4a; 4,3
     \ifx#1Q
       \else\put(513,303)         {\line(0,1) {100}}  % sub. on 1
            \put(492,410)         {#1}    \fi
     \ifx#2Q
       \else\put(684,200)         {\line(5,3) {128}}  % sub. on 2
            \put(817,250)         {#2}    \fi
     \ifx#3Q
       \else\put(684,0)           {\line(5,-3){128}}  % sub. on 3
            \put(817,-100)        {#3}    \fi
     \ifx#4Q
       \else\put(513,-103)        {\line(0,-1){100}}  % sub. on 4
            \put(492,-283)        {#4}    \fi
     \ifx#5Q
       \else\put(171,-103)        {\line(0,-1){100}}  % sub. on 5
            \put(150,-283)        {#5}    \fi
     \ifx#6Q
       \else\put(0,0)             {\line(-5,-3){128}} % sub. on 6
            \put(-430,-116) {\makebox(300,87)[r]{#6}}   \fi  
     \ifx#7Q
       \else\put(0,200)           {\line(-5,3) {128}} % sub. on 7
            \put(-430,234)  {\makebox(300,87)[r]{#7}}   \fi
     \ifx#8Q
       \else\put(171,303)         {\line(0,1)  {100}} %sub. on 8
            \put(150,410)         {#8}    \fi
     \ifx#9S                                          %all single
       \else\put(316,174)         {\line(0,-1) {148}} %double 
                                                      %  4a,8a
            \put(162,-67)         {\line(-5,3) {126}} %double 5,6
            \put(36,191)          {\line(5,3)  {126}} %double 7,8
     \fi
     \ifx#9D\put(648,191)         {\line(-5,3) {126}} %double 2,1
            \put(520,-67)         {\line(5,3)  {126}} %double 4,3
     \fi
   \end{picture}       }                % end naphthalene macro
 \newcommand{\terpene}[9]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets the bicyclo(2.2.1)heptane ring         %
  % system with optional methyl groups at the one-carbon       %
  % bridge.                                                    %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
 \begin{picture}(\pw,\pht)(-\xi,-\yi)
  \put(0,0)       {\line(5,1)  {196}}        % bond 5 to 4
  \put(196,39)    {\line(5,-2) {186}}        % bond 4 to 3
  \put(382,-35)   {\line(2,5)  {66}}         % bond 3 to 2
  \put(448,130)   {\line(-5,2) {186}}        % bond 2 to 1
  \put(262,204)   {\line(-5,-1){196}}        % bond 1 to 6
  \put(66,165)    {\line(-2,-5){66}}         % bond 6 to 5
  \put(196,39)    {\line(0,1)  {330}}        % long part of
                                             %  bridge
  \put(262,204)   {\line(-2,5) {66}}         % shorter part
                                             %  of bridge
  \ifx#1Q                                    % subst. on 1
    \else\put(262,204)   {\line(4,3)  {120}}
         \put(387,267)   {#1}            \fi
  \ifx#2Q                                    % subst. on 2
    \else\put(448,130)   {\line(4,3)  {120}}
         \put(573,193)   {#2}            \fi
  \ifx#3Q                                    % subst. on 3
    \else\put(382,-35)   {\line(5,-2) {120}}
         \put(507,-121)  {#3}            \fi
  \ifx#4Q                                    % subst. on 4
    \else\put(196,39)    {\line(2,-5) {56}}
         \put(231,-180)  {#4}            \fi
  \ifx#5Q                                    % subst. on 5
    \else\put(0,0)       {\line(-5,-2){139}}
         \put(-441,-95)  {\makebox(300,87)[r]{#5}}  \fi
  \ifx#6Q                                    % subst. on 6
    \else\put(66,165)    {\line(-4,3) {120}}
         \put(-362,216)  {\makebox(300,87)[r]{#6}}  \fi
  \ifx#7M\put(196,369)   {\line(4,3)  {120}} % methyl
         \put(196,369)   {\line(-4,3) {120}} %  groups
         \put(321,432)   {\small ${\rm CH_3}$}           
         \put(-226,425)                      %  on bridge
         {\makebox(300,87)[r]{\small ${\rm CH_3}$}} \fi
  \ifx#8Q\else
  \ifx#8O\put(443,142)   {\line(5,2)  {130}} % double-
         \put(453,118)   {\line(5,2)  {130}} %  bonded
         \put(583,155)   {$O$}               %  O on 2
    \else\put(448,130)   {\line(5,-2) {120}} % sec. subst.
         \put(573,44)    {#8}  \fi       \fi %  on 2
  \ifx#9Q\else
  \ifx#9D\put(368,-1)    {\line(2,5) {46}}   % double 3 to 2                  
    \else\put(382,-35)   {\line(4,3) {120}}  % second subst.
         \put(507,28)    {#9}    \fi     \fi %  on 3
 \end{picture}    }   % end terpene macro
 \newcommand{\steroid}[9]        {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets the steroid skeleton. Optional double  %
  % bonds and substituents make it possible to print the       %
  % structures of common steroids.                             %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
       \multiput(0,0)(342,0){3}    {\line(0,1) {200}} %3-2,
                                                      % 5-10,7-8
       \multiput(513,303)(342,0){3}{\line(0,1) {200}} %9-11,14-13,
                                                      %  15-16
       \multiput(0,200)(342,0){3}  {\line(5,3) {171}} %2-1,
                                                      % 10-9,
                                                      % 8-14
       \multiput(0,0)(342,0){2}    {\line(5,-3){171}} %3-4, 5-6
       \multiput(171,-103)(342,0){2}{\line(5,3) {171}} %4-5, 6-7
       \multiput(171,303)(342,0){2}{\line(5,-3){171}} %1-10, 9-8
       \multiput(513,503)(342,0){2}{\line(5,3) {171}} %11-12,
                                                      % 13-17
       \multiput(684,606)(342,0){2}{\line(5,-3){171}} %12-13,
                                                      % 17-16
       \put(855,303)               {\line(1,0) {342}} %14-15
       \put(855,503)               {\line(0,1) {128}} % methyl 18
       \put(795,638)               {\small ${\rm CH_3}$}
       \ifx#1D\put(36,191)         {\line(5,3)  {126}}% double
        \else\ifx#1Q                                  %  1 to 2
              \else\put(520,514)   {\line(-5,3)  {128}}
                   \put(506,492)   {\line(-5,3)  {128}}
                   \put(83,547)    {\makebox(300,87)[r]{#1}} \fi
       \fi                            % outside double & subst. 11  
       \ifx#2D\put(162,-67)        {\line(-5,3) {126}} % double 
        \else\ifx#2Q                                   %  4 to 3
              \else\put(-7,11)     {\line(-5,-3) {128}}
                   \put(7,-11)     {\line(-5,-3) {128}}
                   \put(-430,-116) {\makebox(300,87)[r]{#2}} \fi
       \fi                            % outside double & subst. 3
       \ifx#3Q
        \else\put(0,0)       {\line(-5,-3){128}}           % subst.         
             \put(-430,-116) {\makebox(300,87)[r]{#3}} \fi %  on 3
       \ifx#4D\put(178,-67)  {\line(5,3)  {126}}     \fi % double 
                                                         %  4 to 5
       \ifx#5D\put(378,9)    {\line(5,-3) {126}}         % double 
                                                         %  6 to 5
        \else\ifx#5Q
               \else\multiput(1011,606)(30,0){2} {\line(0,1) {100}}
                    \put(985,713)         {#5}         \fi
       \fi                             % outside double & subst. 17    
       \ifx#6D\put(316,174)  {\line(0,-1) {148}}     \fi % double 
                                                         % 5 to 10
       \ifx#6M\put(342,200)  {\line(0,1)  {128}}         % methyl 
                                                         %  19
              \put(282,335)  {\small ${\rm CH_3}$}     \fi
       \ifx#7Q
        \else\put(1026,606)  {\line(0,1)  {100}}         % lower  
                                                         %  subst.
             \put(995,713)   {#7}                    \fi %  part 
                                                         %  on 17
       \ifx#8Q
        \else\put(1026,791)  {\line(0,1)  {100}}         % upper 
                                                         %  subst.
             \put(995,900)   {#8}                    \fi %  part
                                                         %  on 17
       \ifx#9Q
        \else\put(1026,606)  {\line(1,0)  {128}}         % the other
             \put(1160,575)  {#9}                    \fi %  subst.
                                                         %  on 17
     \end{picture}       }                    % end steroid macro

 \newcommand{\hetthree}[8]       {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The hetthree macro draws a three-membered ring with one    %
  % hetero atom.                                               %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  \begin{picture}(\pw,\pht)(-\xi,-\yi)
   \put(170,-170)  {#8}                        % hetero atom
   \put(0,0)       {C}                         % C-2
   \put(360,0)     {C}                         % C-3
   \put(80,30)     {\line(1,0)  {270}}         % bond 2-3
   \put(70,-10)    {\line(1,-1) {100}}         % bond 2-1
   \put(350,-10)   {\line(-1,-1){100}}         % bond 3-1
   \ifx#1Q                                     % substituent
     \else\put(210,-180) {\line(0,-1){80}}     %  on het. atom
          \put(180,-340) {#1}               \fi
   \ifx#6S\put(-10,30)   {\line(-1,0){140}}    % subst. on C-2
          \put(-460,-10) {\makebox(300,87)[r]{#2}} % with hor.
                                                   % bond
     \else\ifx#6H\put(-90,30)   {\line(-1,0) {140}}% bond and H
                 \put(-70,0)    {H}                %  on C-2
                 \put(-540,-10) {\makebox(300,87)[r]{#2}}
          \else  \put(-310,-10) {\makebox(300,87)[r]{#2}} \fi \fi
                                                   % no bond on 2
   \ifx#7S\put(440,30)   {\line(1,0) {140}}    % subst. on C-3
          \put(590,0)    {#3}                  %  with hor. bond
     \else\ifx#7H\put(430,0)    {H}            %  bond with H
                 \put(510,30)   {\line(1,0)  {140}}
                 \put(660,0)    {#3}
          \else  \put(445,0)    {#3}   \fi \fi % no bond on 3
   \ifx#4Q
     \else\put(40,80)    {\line(0,1) {140}}    % second subst.
          \put(-225,220) {\makebox(300,87)[r]{#4}} \fi % on C-2
   \ifx#5Q
     \else\put(400,80)   {\line(0,1) {140}}    % second subst.
          \put(360,230)  {#5}              \fi %  on C-3
  \end{picture}   }      % end hetthree macro
 \newcommand{\hetifive}[9]       {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The hetifive macro typesets a five-membered ring with one     %
  % hetero atom.                                                  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(342,0)          {\line(-5,-3) {140}}         % bond 2,1
    \put(342,0)          {\line(0,1)   {200}}         % bond 2,3
    \put(342,200)        {\line(-1,0)  {342}}         % bond 3,4
    \put(0,200)          {\line(0,-1)  {200}}         % bond 4,5
    \put(0,0)            {\line(5,-3)  {140}}         % bond 5,1
    \ifx#1Q
     \else\put(171,-137) {\line(0,-1)  {83}}          % subst.on 
          \put(135,-283) {#1}                     \fi % het.atom
    \ifx#2Q
     \else\ifx#2O\put(349,11) {\line(5,-3) {128}}     % outside
                 \put(335,-11){\line(5,-3) {128}}     %  double O
                 \put(475,-120)            {O}        %  on C-2
          \else\put(342,0)    {\line(5,-3) {128}}     % single
               \put(475,-100) {#2}                \fi %  subst.
    \fi                                               %  on C-2
    \ifx#3Q
     \else\put(342,200)  {\line(5,3)   {128}}         % subst. on
          \put(475,250)  {#3}                     \fi %  C-3
    \ifx#4Q
     \else\put(0,200)    {\line(-5,3)  {128}}         % subst. on
          \put(-430,234) {\makebox(300,87)[r]{#4}}\fi %  C-4
    \ifx#5Q
     \else\ifx#5O\put(-7,11)  {\line(-5,-3) {128}}    % outside
                 \put(7,-11)  {\line(-5,-3) {128}}    %  double O
                 \put(-200,-130)            {O}       %  on C-5
          \else\put(0,0)      {\line(-5,-3) {128}}    % single 
               \put(-430,-116){\makebox(300,87)[r]{#5}} \fi % sub.
    \fi                                               %  on C-5
    \ifx#6D\put(316,26)       {\line(0,1)  {148}} \fi % double 2,3
    \ifx#7D\put(316,174)      {\line(-1,0) {290}} \fi % double 3,4
    \ifx#8D\put(26,174)       {\line(0,-1) {148}} \fi % double 4,5
    \put(135,-130)            {#9}                    % hetero atom
  \end{picture}               }     % end one-hetero fivering macro
 \newcommand{\heticifive}[9]     {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The heticifive macro typesets a five-membered ring with     %
  % two hetero atoms separated by a carbon atom.                %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(342,0)          {\line(-5,-3) {140}}         % bond 2,1
    \put(342,0)          {\line(0,1)   {160}}         % bond 2,3
    \put(0,200)          {\line(1,0)   {300}}         % bond 4,3
    \put(0,200)          {\line(0,-1)  {200}}         % bond 4,5
    \put(0,0)            {\line(5,-3)  {140}}         % bond 5,1
    \ifx#1Q
     \else\put(171,-137) {\line(0,-1)  {83}}          % subst. on
          \put(135,-283) {#1}                     \fi %  het-1
    \ifx#2Q
     \else\ifx#2O\put(349,11)   {\line(5,-3) {128}}   % outside
                 \put(335,-11)  {\line(5,-3) {128}}   %  double O
                 \put(475,-120) {O}                   %  on C-2
          \else\put(342,0)      {\line(5,-3) {128}}   % single sub.
               \put(475,-100)   {#2}              \fi %  on C-2
    \fi
    \ifx#3Q
     \else\put(370,217)  {\line(5,3)    {100}}        % subst. on
          \put(475,250)  {#3}                     \fi %  on het-3
    \ifx#4Q
     \else\ifx#4O\put(-7,189)   {\line(-5,3) {128}}   % outside
                 \put(7,211)    {\line(-5,3) {128}}   %  double O
                 \put(-200,250) {O}                   %  on C-4
           \else\put(0,200)     {\line(-5,3) {128}}   % single sub.
                \put(-430,234)  {\makebox(300,87)[r]{#4}} \fi
    \fi                                               % on C-4
    \ifx#5Q
     \else\put(0,0)      {\line(-5,-3)  {128}}        % 1. single
          \put(-430,-116){\makebox(300,87)[r]{#5}}\fi %  subst. 
                                                      %  on C-5
    \ifx#6D\put(316,26)  {\line(0,1)    {130}}    \fi % double 2,3
    \ifx#7Q
     \else\ifx#7D\put(26,174)   {\line(0,-1) {148}}   % double 4,5
          \else\put(0,0)        {\line(-5,3) {128}}   % 2. subst.
               \put(-430,34)    {\makebox(300,87)[r]{#7}}  \fi
    \fi                                               %  on C-5
    \put(135,-130)              {#8}                  % het.atom 1
    \put(310,170)               {#9}                  % het.atom 3
   \end{picture}                }    % end heticifive macro
 \newcommand{\pyrazole}[8]      {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets the pyrazole ring with optional        %
  % substituents and double bonds inside and outside the       %
  % ring.                                                      %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(200,-84)        {\line(5,3)    {110}}        % bond 1,2
    \put(342,200)        {\line(0,-1)   {140}}        % bond 3,2
    \put(342,200)        {\line(-1,0)   {342}}        % bond 3,4
    \put(0,200)          {\line(0,-1)   {200}}        % bond 4,5
    \put(0,0)            {\line(5,-3)   {140}}        % bond 5,1
    \put(135,-130)       {N}                          % ring N-1
    \put(310,-30)        {N}                          % ring N-2 
    \ifx#1Q
     \else\put(171,-137) {\line(0,-1)   {83}}         % subst. on
          \put(150,-283) {#1}                     \fi %  on N-1
    \ifx#2Q
     \else\put(370,-17)  {\line(5,-3)   {100}}        % subst. on
          \put(475,-100) {#2}                     \fi %  N-2
    \ifx#3Q
     \else\ifx#3O\put(335,211)  {\line(5,3)  {128}}   % outside
                 \put(349,189)  {\line(5,3)  {128}}   %  double O
                 \put(475,250)  {O}                   %  on C-3
          \else\put(342,200)    {\line(5,3)  {128}}   % single sub.
               \put(475,250)    {#3}              \fi %  on C-3
    \fi
    \ifx#4Q
     \else\put(0,200)    {\line(-5,3)   {128}}        % single sub.
          \put(-430,234) {\makebox(300,87)[r]{#4}}\fi %  on C-4
    \ifx#5Q
     \else\ifx#5O\put(-7,11)    {\line(-5,-3){128}}   % outside
                 \put(7,-11)    {\line(-5,-3){128}}   %  double O
                 \put(-200,-130){O}                   %  on C-5
          \else\put(0,0)        {\line(-5,-3){128}}   % single sub.
               \put(-430,-116)  {\makebox(300,87)[r]{#5}}  \fi
    \fi                                               % on C-5
    \ifx#6D\put(316,174) {\line(0,-1)   {114}}    \fi % double 3,2
    \ifx#7D\put(316,174) {\line(-1,0)   {290}}    \fi % double 3,4
    \ifx#8D\put(26,174)  {\line(0,-1)   {148}}    \fi % double 4,5
  \end{picture}          }         % end pyrazole macro
 \newcommand{\hetisix}[9]       {              
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The hetisix macro typesets a six-membered ring with        %
  % one hetero atom.                                           %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
    \begin{picture}(\pw,\pht)(-\xi,-\yi)
      \put(342,0)     {\line(-5,-3)  {140}}    % bond 2 to 1
      \put(0,0)       {\line(5,-3)   {140}}    % bond 6 to 1
      \put(342,0)     {\line(0,1)    {200}}    % bond 2 to 3
      \put(342,200)   {\line(-5,3)   {171}}    % bond 3 to 4
      \put(171,303)   {\line(-5,-3)  {171}}    % bond 4 to 5
      \put(0,200)     {\line(0,-1)   {200}}    % bond 5 to 6
      \ifx#7D                                   
        \put(316,26)  {\line(0,1)    {148}}    % double 2 to 3    
        \else\ifx#7Q
             \else\put(349,11)  {\line(5,-3){128}} % outside
                  \put(335,-11) {\line(5,-3){128}} %  double sub.
                  \put(475,-120){#7}         \fi   %  on C-2
      \fi
      \ifx#8D
        \put(36,191)  {\line(5,3)    {126}} \fi  % double 5 to 4
      \ifx#1D
        \put(36,9)     {\line(5,-3)  {110}}      % double 6 to 1
        \else\ifx#1Q
             \else\put(171,-220) {\line(0,1) {83}}
                  \put(150,-283) {#1}       \fi  % subst. on het.
      \fi
      \put(135,-130)  {#9}                       % the het.atom
      \ifx#2Q                                    
        \else\put(342,0)    {\line(5,-3)  {128}} % subst. on 2
             \put(475,-100)   {#2}
      \fi      
      \ifx#3Q
        \else\put(342,200)  {\line(5,3)   {128}} % subst. on 3
             \put(475,250)  {#3}
      \fi
      \ifx#4Q
        \else\put(171,303)  {\line(0,1)   {100}} % subst. on 4
             \put(150,410)  {#4}
      \fi
      \ifx#5Q
        \else\put(0,200)    {\line(-5,3)  {128}} % subst. on 5
             \put(-430,234) {\makebox(300,87)[r]{#5}}
      \fi
      \ifx#6Q
        \else\put(0,0)      {\line(-5,-3) {128}} % subst. on 6
             \put(-430,-116){\makebox(300,87)[r]{#6}}
      \fi                             % end sixring macro with
    \end{picture}     }               %  one hetero atom
  \newcommand{\pyrimidine}[9]        {          
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % This macro typesets the pyrimidine ring with optional      %
   % substituents and double bonds inside and outside the       %
   % ring.                                                      %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
       \put(342,0)     {\line(-5,-3)  {140}}   % from 2 to 1
       \put(0,0)       {\line(5,-3)   {140}}   % from 6 to 1
       \put(342,0)     {\line(0,1)    {160}}   % from 2 to 3
       \put(171,303)   {\line(5,-3)   {140}}   % from 4 to 3
       \put(171,303)   {\line(-5,-3)  {171}}   % from 4 to 5
       \put(0,200)     {\line(0,-1)   {200}}   % from 5 to 6
       \put(135,-130)  {N}
       \put(310,170)   {N}
       \ifx#1Q
        \else\put(171,-137)  {\line(0,-1)  {83}} % sub. on N-1
             \put(150,-283)  {#1}               \fi
       \ifx#2Q
        \else\ifx#2O\put(349,11)  {\line(5,-3) {128}}  % outside
                    \put(335,-11) {\line(5,-3) {128}}  %  double O
                    \put(475,-120){O}                  %  on C-2
             \else\put(342,0)     {\line(5,-3) {128}}  % single
                  \put(475,-100)  {#2}           \fi   %  subst.
       \fi
       \ifx#3Q
        \else\put(370,217)   {\line(5,3)   {100}}      % subst.
             \put(475,250)   {#3}                \fi   %  on N-3
       \ifx#4Q
        \else\ifx#4O\put(158,303) {\line(0,1)  {100}}  % outside    
                    \put(184,303) {\line(0,1)  {100}}  %  double O
                    \put(130,410) {O}                  %  on C-4
             \else\put(171,303)   {\line(0,1)  {100}}  % single 
                  \put(150,410)    {#4}           \fi  %  subst.
       \fi                                             %  on C-4
       \ifx#5Q
        \else\put(0,200)     {\line(-5,3)   {128}}     % 1. subst.
             \put(-430,234)  {\makebox(300,87)[r]{#5}} \fi 
                                                       %  on C-5
       \ifx#6Q
        \else\ifx#6O\put(-7,11)   {\line(-5,-3){128}}  % outside
                    \put(7,-11)   {\line(-5,-3){128}}  %  double O
                    \put(-210,-130){O}                 %  on C-6
             \else\put(0,0)       {\line(-5,-3){128}}  % single s.
                  \put(-430,-116) {\makebox(300,87)[r]{#6}} \fi 
       \fi                                             %  on C-6
       \ifx#7D\put(306,9)    {\line(-5,-3)  {120}} \fi % 2,1 doub.
       \ifx#8D\put(180,267)  {\line(5,-3)   {120}}     % 4,3 doub.
        \else\ifx#8Q
             \else\put(0,200){\line(-5,-3)  {128}}     % 2. subst.
                  \put(-430,84) {\makebox(300,87)[r]{#8}}   \fi 
       \fi                                             %  on C-5
       \ifx#9D\put(26,174)   {\line(0,-1)   {148}} \fi % 5,6 doub.
   \end{picture}  }                     % end pyrimidine macro
 \newcommand{\pyranose}[9]   {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets monosaccharides with a pyran ring      %
  % system.                                                    %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(588,0)         {\line(-1,-1) {159}}          % 1,2 bond
    \put(429,-159)      {\line(-1,0)  {270}}          % 2,3 bond
    \put(159,-159)      {\line(-1,1)  {159}}          % 3,4 bond
    \put(0,0)           {\line(1,1)   {159}}          % 4,5 bond
    \put(159,159)       {\line(1,0)   {225}}          % C-5 to O
    \put(394,130)       {\small O}                    % ring O
    \put(460,130)       {\line(1,-1)  {128}}          % O to C-1
    \ifx#1Q
     \else\put(588,0)   {\line(1,1)   {100}}          % beta sub.
          \put(700,75)  {#1}                     \fi  %  on C-1
    \ifx#2Q
     \else\put(588,0)   {\line(1,-1)  {100}}          % alpha sub.
          \put(700,-120){#2}                     \fi  %  on C-1
    \ifx#3Q
     \else\put(429,-159){\line(0,1)   {85}}           % up subst.
          \put(225,-75) {\makebox(250,87)[r]{#3}} \fi %  on C-2
    \ifx#4Q
     \else\put(429,-159){\line(0,-1)  {85}}           % down sub. 
          \put(400,-315){#4}                      \fi %  on C-2
    \ifx#5Q
     \else\put(159,-159){\line(0,1)   {85}}           % up subst. 
          \put(130,-73) {#5}                     \fi  %  on C-3
    \ifx#6Q
     \else\put(159,-159){\line(0,-1)  {85}}           % down sub.
          \put(130,-315){#6}                     \fi  %  on C-3              
    \ifx#7Q
     \else\put(0,0)     {\line(0,1)   {85}}           % up subst. 
          \put(-270,84) {\makebox(300,87)[r]{#7}} \fi %  on C-4
    \ifx#8Q
     \else\put(0,0)     {\line(0,-1)  {85}}           % down sub.
          \put(-270,-160){\makebox(300,87)[r]{#8}}\fi %  on C-4
    \put(159,159)       {\line(0,1)   {85}}           % C-6
    \put(130,250)       {\small ${\rm CH_{2}}$}       % sub. on
    \put(-370,245)      {\makebox(500,87)[r]{#9}}     %  C-6
  \end{picture}         }                 % end pyranose macro
 \newcommand{\furanose}[8]   {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets monosaccharides with a furan ring      %
  % system.                                                    %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)
    \put(448,0)              {\line(-1,-2) {89}}      % bond 1,2
    \put(359,-179)           {\line(-1,0)  {270}}     % bond 2,3
    \put(89,-179)            {\line(-1,2)  {89}}      % bond 3,4
    \put(0,0)                {\line(5,3)   {188}}     % C-4 to O
    \put(192,110)            {\small O}               % ring O
    \put(260,113)            {\line(5,-3)  {188}}     % O to C-1
    \ifx#1Q
     \else\ifx#1N\put(448,0) {\line(0,1)   {380}}     % long bond 
                                                      %  for nucl.
          \else\put(448,0)   {\line(5,3)   {105}}     % beta sub.
               \put(558,50)  {#1}                 \fi %  on C-1
    \fi
    \ifx#2Q
     \else\put(448,0)        {\line(5,-3)  {105}}     % alpha sub.
          \put(558,-90)      {#2}                \fi  %   on C-1
    \ifx#3Q
     \else\put(359,-179)     {\line(0,1)   {85}}      % up subst.
          \put(155,-95)      {\makebox(250,87)[r]{#3}}\fi %on C-2
    \ifx#4Q
     \else\put(359,-179)     {\line(0,-1)  {85}}      % down sub.
          \put(330,-335)     {#4}                \fi  %  on C-2
    \ifx#5Q
     \else\put(89,-179)      {\line(0,1)   {85}}      % up sub.
          \put(60,-93)       {#5}                \fi  %  on C-3
    \ifx#6Q
     \else\put(89,-179)      {\line(0,-1)  {85}}      % down sub.
          \put(60,-335)      {#6}                \fi  %   on C-3
    \ifx#7Q
     \else\put(0,0)          {\line(0,-1)  {85}}      % down sub.
          \put(-270,-160)    {\makebox(300,87)[r]{#7}}\fi %on C-4
    \put(0,0)                {\line(0,1)   {85}}      % C-5
    \put(-30,90)             {\small ${\rm CH_{2}}$}
    \put(-530,80)            {\makebox(500,87)[r]{#8}}
  \end{picture}        }          % end furanose macro
 \newcommand{\purine}[9]           {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets the purine ring system with optional   %
  % double bonds and substituents.                             %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
    \begin{picture}(\pw,\pht)(-\xi,-\yi)
      \put(0,0)      {\line(0,1)   {160}}          % bond 2 to 1
      \put(0,0)      {\line(5,-3)  {140}}          % from 2 to 3
      \put(342,0)    {\line(-5,-3) {140}}          % from 4 to 3
      \put(342,0)    {\line(0,1)   {200}}          % from 4 to 5
      \put(316,174)  {\line(0,-1)  {148}}          % double 5 to 4
      \put(342,200)  {\line(-5,3)  {171}}          % from 5 to 6
      \put(171,303)  {\line(-5,-3) {140}}          % from 6 to 1
      \put(342,200)  {\line(1,0)   {300}}          % from 5 to 7
      \put(684,0)    {\line(0,1)   {160}}          % from 8 to 7
      \put(684,0)    {\line(-5,-3) {140}}          % from 8 to 9
      \put(342,0)    {\line(5,-3)  {140}}          % from 4 to 9
      \put(-32,170)  {\small N}                    % N at 1
      \put(135,-130) {\small N}                    % N at 3
      \put(652,170)  {\small N}                    % N at 7
      \put(477,-130) {\small N}                    % N at 9 
      \ifx#1Q
        \else\put(-128,277) {\line(5,-3) {100}}    % subst. on 1
             \put(-430,234) {\makebox(300,87)[r]{#1}}
      \fi
      \ifx#2D\put(36,9)     {\line(5,-3) {100}}    % double 2 to 3
        \else\put(-7,11)    {\line(-5,-3) {128}}
             \put(7,-11)    {\line(-5,-3) {128}}
             \put(-430,-116){\makebox(300,87)[r]{#2}}
      \fi                                          %outside double
                                                   %  bond on 2
      \ifx#3Q                                      % subst. on 3
        \else\put(171,-130) {\line(0,-1) {73}}
             \put(135,-283) {#3}
      \fi
      \ifx#4D\put(162,267)  {\line(-5,-3){110}} \fi % d. bond 6,1
      \ifx#5Q
        \else\multiput(158,303)(26,0){2} {\line(0,1) {100}}
             \put(135,410)  {#5}                % outside d.-bond
      \fi                                       % and subst. on 6
      \ifx#6Q                                   % single-bonded
        \else\put(171,303)  {\line(0,1)  {100}} % subst. on 6
             \put(150,410)  {#6}
      \fi
      \ifx#7Q                                   % subst. on 7
        \else\put(812,277)  {\line(-5,-3){100}}  
             \put(817,250)  {#7}
      \fi
      \ifx#8D\put(658,26)   {\line(0,1)  {125}} % d.-bond 8 to 7
        \else\put(691,11)   {\line(5,-3) {128}}
             \put(677,-11)  {\line(5,-3) {128}}
             \put(817,-110) {#8}                % outside d.-bond
      \fi                                       % and subst. on 8
      \ifx#9Q                                   % subst. on 9
        \else\put(513,-130) {\line(0,-1) {73}}
             \put(492,-283) {#9}
      \fi
      \end{picture}      }            % end purine macro

                   

        
  


 \newcommand{\fuseiv}[9]      {          
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a four-carbon fragment designed to     %
  % be connected to another ring at two places. As the         %
  % result, a sixring is fused linearly to another ring        %
  % system.                                                    %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)  
    \put(0,200)     {\line(5,3)  {171}}                % NE bond
    \put(171,303)   {\line(5,-3) {171}}                % SE bond
    \put(342,200)   {\line(0,-1) {200}}                % S  bond
    \put(342,0)     {\line(-5,-3){171}}                % SW bond
    \put(171,-103)  {\line(-5,3) {171}}                % NW bond
    \ifx#1Q
     \else\put(171,303)   {\line(0,1)   {100}}         % subst.
          \put(150,410)   {#1}                     \fi %  on top
    \ifx#2Q
     \else\put(342,200)   {\line(5,3)   {128}}         % subst. 
          \put(475,250)   {#2}                     \fi %  top rt.  
    \ifx#3Q
     \else\put(342,0)     {\line(5,-3)  {128}}         % subst.  
          \put(475,-100)  {#3}                     \fi %  low rt.
    \ifx#4Q
     \else\put(171,-103)  {\line(0,-1)  {100}}         % bottom
          \put(150,-283)  {#4}                     \fi %  subst.
    \ifx#5D \put(36,191)  {\line(5,3)   {126}}     \fi % NE double
    \ifx#6D \put(180,267) {\line(5,-3)  {126}}         % SE double
     \else\ifx#6Q
           \else\put(342,200)  {\line(5,-3)  {128}}    % 2. subst.
                \put(475,100)  {#6}                \fi %  top rt.
    \fi
    \ifx#7D \put(316,174) {\line(0,-1)  {148}}     \fi % S  double
    \ifx#8D \put(306,9)   {\line(-5,-3) {126}}         % SW double
     \else\ifx#8Q
           \else\put(342,0)    {\line(5,3)   {128}}    % 2. subst.
                \put(475,50)   {#8}                \fi % lower rt.
    \fi
    \ifx#9D \put(162,-67) {\line(-5,3)       {126}}\fi % NW double
  \end{picture}        }               % end fuseiv macro
 \newcommand{\fuseup}[9]   {          
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a four-carbon fragment designed to     %
  % connect to another ring at two places. As the result,      %
  % a sixring is fused angularly to the original ring.         %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi)  
    \put(-171,303)        {\line(0,1)   {200}}         % N  bond
    \put(-171,503)        {\line(5,3)   {171}}         % NE bond
    \put(0,606)           {\line(5,-3)  {171}}         % SE bond
    \put(171,503)         {\line(0,-1)  {200}}         % S  bond
    \put(171,303)         {\line(-5,-3) {171}}         % SW bond
    \ifx#1Q
     \else\put(-171,503)  {\line(-5,3)  {128}}      % upper left
          \put(-600,537)  {\makebox(300,87)[r]{#1}}\fi %  subst.
    \ifx#2Q
     \else\put(0,606)     {\line(0,1)   {100}}         % top sub.
          \put(-19,713)   {#2}                     \fi 
    \ifx#3Q
     \else\put(171,503)   {\line(5,3)   {128}}         % top rt.
          \put(304,553)   {#3}                     \fi %  subst.
    \ifx#4Q
     \else\put(171,303)   {\line(5,-3)  {128}}         % lower rt.
          \put(304,203)   {#4}                     \fi %  subst.
    \ifx#5D\put(-145,329) {\line(0,1)   {148}}     \fi % N double
    \ifx#6D\put(-135,494) {\line(5,3)   {126}}     \fi % NE double
    \ifx#7D\put(9,570)    {\line(5,-3)  {126}}     \fi % SE double
    \ifx#8D\put(145,477)  {\line(0,-1)  {148}}     \fi % S  double
    \ifx#9D\put(135,312)  {\line(-5,-3) {126}}     \fi % SW double
  \end{picture}      }                  % end fuseup macro
 \newcommand{\fuseiii}[6]    {          
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a three-carbon fragment designed to    %
  % be connected to another ring at two places. As the         %
  % result, a fivering is fused linearly to the original       %
  % ring system.                                               %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
   \begin{picture}(\pw,\pht)(-\xi,-\yi) 
    \put(0,200)     {\line(1,0)   {342}}               % E  bond
    \put(342,200)   {\line(0,-1)  {200}}               % S  bond
    \put(342,0)     {\line(-5,-3) {171}}               % SW bond
    \put(171,-103)  {\line(-5,3)  {171}}               % NW bond
    \ifx#1Q
     \else\put(342,200)   {\line(5,3)   {128}}         % upper rt.
          \put(475,250)   {#1}                     \fi %  subst.
    \ifx#2Q
     \else\put(342,0)     {\line(5,-3)  {128}}         % lower rt.
          \put(475,-100)  {#2}                     \fi %  subst.
    \ifx#3Q
     \else\put(171,-103)  {\line(0,-1)  {100}}         % bottom
          \put(150,-283)  {#3}                     \fi %  subst.
    \ifx#4Q
     \else\put(342,200)   {\line(5,-3)  {128}}         % 2. upper
          \put(475,100)   {#4}                     \fi %  rt. sub.
    \ifx#5Q
     \else\put(342,0)     {\line(5,3)   {128}}         % 2. lower
          \put(475,50)    {#5}                     \fi %  rt. sub.
    \ifx#6D \put(316,174) {\line(0,-1)  {148}}     \fi % S double
  \end{picture}      }                  % end fuseiii macro
 \newcommand{\cto}[3]   {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets an arrow for a chemical equation and   %
  % puts text above and below it.                              %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
  %
   \len=50   \multiply \len by #3                % calc. arrow
   \advance  \len by 120                         % length
     \begin{picture}(\pw,\pht)(-\xi,-\yi)
      \put(60,50)     {\vector(1,0)   {\len}}    % draw arrow
      \put(90,70)     {\makebox(\len,70)[l]
                      {\scriptsize ${\rm #1}$}}  % text on top
      \put(90,-40)    {\makebox(\len,70)[l]
                      {\scriptsize ${\rm #2}$}}  % text below
    \end{picture}     }      
 \newcommand{\sbond}[1]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a horizontal single bond of user-      %
  % specified length.                                          %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  \xbox=#1  \advance \xbox by 2
  \hspace{1.5pt} \parbox{\xbox pt} {\rule{#1 pt}{0.4pt} }  
  \xbox=50     }  % end sbond macro
 \newcommand{\dbond}[2]    {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a horizontal double bond of user-     %
  % specified length.                                         %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  \xbox=#1  \advance \xbox by 2
  \hspace{1.5pt}\parbox{\xbox pt} 
                       {\rule{#1 pt}{0.4pt}\vspace{-#2 pt}\\
                        \rule{#1 pt}{0.4pt}  }
  \xbox=50     }  % end dbond macro
 \newcommand{\tbond}[2]   {
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % This macro typesets a horizontal triple bond of user-     %
  % specified length.                                         %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  \xbox=#1   \advance  \xbox by 2
  \hspace{1.5pt} \parbox{\xbox pt} 
                        {\rule{#1 pt}{0.4pt}\vspace{-#2 pt}\\
                         \rule{#1 pt}{0.4pt}\vspace{-#2 pt}\\
                         \rule{#1 pt}{0.4pt}   }
  \xbox=50     }   % end tbond macro
SHAR_EOF
#	End of shell archive
exit 0

