% \iffalse meta-comment
%% File: hetarom.dtx
%
%  Copyright 1993,1996,1998,2000,2002,2004,2006,2010,2013 by Shinsaku Fujita
%
%  This file is part of XyMTeX system.
%  -------------------------------------
%
% This file is a successor to:
%
% hetarom.sty
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \typeout{XyMTeX for Drawing Chemical Structural Formulas. Version 1.00}
% \typeout{       -- Released December 1, 1993 by Shinsaku Fujita}
% Copyright (C) 1993 by Shinsaku Fujita, all rights reserved.
%
% This file is a part of the macro package ``XyMTeX'' which has been 
% designed for typesetting chemical structural formulas.
%
% This file is to be contained in the ``xymtex'' directory which is 
% an input directory for TeX. It is a LaTeX optional style file and 
% should be used only within LaTeX, because several macros of the file 
% are based on LaTeX commands. 
%
% For the review of XyMTeX, see
%  (1)  Shinsaku Fujita, ``Typesetting structural formulas with the text
%    formatter TeX/LaTeX'', Computers and Chemistry, in press.    
% The following book deals with an application of TeX/LaTeX to 
% preparation of manuscripts of chemical fields:
%  (2)  Shinsaku Fujita, ``LaTeX for Chemists and Biochemists'' 
%    Tokyo Kagaku Dozin, Tokyo (1993) [in Japanese].  
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'. 
% The Current Maintainer of this work is Shinsaku Fujita.
%
% This work consists of the files hetarom.dtx and hetarom.ins
% and the derived file hetarom.sty.
%
% Please report any bugs, comments, suggestions, etc. to:
%   Shinsaku Fujita, 
%   Shonan Institute of Chemoinformatics and Mathematical Chemistry
%   Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun, Kanagawa 250-0019 Japan
%  (old address)
%   Ashigara Research Laboratories, Fuji Photo Film Co., Ltd., 
%   Minami-Ashigara, Kanagawa-ken, 250-01, Japan.
%  (old address)
%   Department of Chemistry and Materials Technology, 
%   Kyoto Institute of Technology, \\
%   Matsugasaki, Sakyoku, Kyoto, 606 Japan
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{December 01, 1993}
% \def\versi@nno{ver1.00}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{August 16, 1996}
% \def\versi@nno{ver1.01}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{October 31, 1998}
% \def\versi@nno{ver1.02}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{December 25, 1998}
% \def\versi@nno{ver2.00}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{November 11, 2000}
% \def\versi@nno{ver2.00a}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{June 20, 2001}
% \def\versi@nno{ver2.01}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{April 30, 2002}
% \def\versi@nno{ver3.00}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{May 30, 2002}
% \def\versi@nno{ver4.00}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{August 30, 2004}
% \def\versi@nno{ver4.01}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{December 20, 2004}
% \def\versi@nno{ver4.02}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{September 5, 2006}
% \def\versi@nno{ver4.03b}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{hetarom}
% \def\versi@ndate{October 01, 2010}
% \def\versi@nno{ver5.00}
% \def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \fi
%
% \CheckSum{9032}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
% \setcounter{StandardModuleDepth}{1}
%
% \StopEventually{}
% \MakeShortVerb{\|}
%
% \iffalse
% \changes{v1.01}{1996/06/27}{first edition for LaTeX2e}
% \changes{v1.02}{1998/10/31}{revised edition for LaTeX2e}
% \changes{v2.00}{1998/12/25}{enhanced edition for LaTeX2e}
% \changes{v2.00a}{1998/11/11}{bug fix}
% \changes{v2.01}{2001/06/20}{Size reduction and Clip infomation}
% \changes{v2.01}{2001/06/21}{The command \cs{dotorline} is added.}
% \changes{v3.00}{2002/04/30}{sfpicture environment etc.}
% \changes{v4.00}{2002/05/30}{PostScript output and ShiftPicEnv}
% \changes{v4.01}{2004/08/30}{Minor additions}
% \changes{v4.02}{2004/12/20}{Exception to wedged bonds}
% \changes{v4.02a}{2004/12/27}{Bug fix: \cs{ggg} to \cs{gggA}}
% \changes{v4.03b}{2006/9/5}{Bug fix: \cs{decahetero} and \cs{nonahetero}}
% \changes{v5.00}{2010/10/01}{for bond coloring and the LaTeX Project Public License}
% \changes{v5.01}{2013/03/19}{Three and four-membered specfic commands are added}
% \fi
%
% \iffalse
%<*driver>
\NeedsTeXFormat{pLaTeX2e}
% \fi
\ProvidesFile{hetarom.dtx}[2013/03/19 v5.01 XyMTeX{} package file]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{hetarom.dtx}
%
% %%XyMTeX Logo: Definition 2%%%
\def\UPSILON{\char'7}
\def\XyM{X\kern-.30em\smash{%
\raise.50ex\hbox{\UPSILON}}\kern-.30em{M}}
\def\XyMTeX{\XyM\kern-.1em\TeX}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Heterocycles of vertical type by {\sffamily hetarom.sty} 
(\fileversion) of \XyMTeX{}}
\author{Shinsaku Fujita \\ 
Shonan Institute of Chemoinformatics and Mathematical Chemistry, \\
Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun, Kanagawa 250-0019 Japan
% % (old address)
% %Department of Chemistry and Materials Technology, \\
% %Kyoto Institute of Technology, \\
% %Matsugasaki, Sakyoku, Kyoto, 606-8585 Japan
% %% (old address)
% %% Ashigara Research Laboratories, 
% %% Fuji Photo Film Co., Ltd., \\ 
% %% Minami-Ashigara, Kanagawa, 250-01 Japan
}
\date{\filedate}
%
\begin{document}
   \maketitle
   \DocInput{hetarom.dtx}
\end{document}
%</driver>
% \fi
%
% \section{Introduction}\label{hetarom:intro}
%
% \subsection{Options for {\sffamily docstrip}}
%
% \DeleteShortVerb{\|}
% \begin{center}
% \begin{tabular}{|l|l|}
% \hline
% \emph{option} & \emph{function}\\ \hline
% hetarom & hetarom.sty \\
% driver & driver for this dtx file \\
% \hline
% \end{tabular}
% \end{center}
% \MakeShortVerb{\|}
%
% \subsection{Version Information}
%
%    \begin{macrocode}
%<*hetarom>
\typeout{XyMTeX for Drawing Chemical Structural Formulas. Version 5.01}
\typeout{       -- Released March 19, 2013 by Shinsaku Fujita}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\j@urnalname{hetarom}
\def\versi@ndate{March 19, 2013}
\def\versi@nno{ver5.01}
\def\copyrighth@lder{SF} % Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\typeout{XyMTeX Macro File `\j@urnalname' (\versi@nno) <\versi@ndate>%
\space[\copyrighth@lder]}
%    \end{macrocode}
%
% \section{List of commands for hetarom.sty}
%
% \begin{verbatim}
% *********************************
% * hetarom.sty: list of commands *
% *********************************
%
% <Various flags (switches)>
%
%     \if@gclip \@gclipfalse \@gcliptrue
%     \if@hclip \@hclipfalse \@hcliptrue
%     \if@iclip \@iclipfalse \@icliptrue
%     \if@jclip \@jclipfalse \@jcliptrue
%     \iniflag
%     \iniatom
%     \aaa
%     \bbb
%     \ccc
%     \ddd
%     \eee
%     \fff
%     \gggA
%     \hhh
%     \iii
%     \jjj
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Six-Membered Heterocycles>
%    Setting inner double bonds
%
%     \bonda
%     \bondb
%     \bondc
%     \bondd
%     \bonde
%     \bondf
%     \bondhoriz
%     \bondhorizi
%
%    Setting skeletal bonds
%
%     \skbonda
%     \skbondf
%     \skbondc
%     \skbondd
%     \skbondb
%     \skbonde
%     \skbondhoriz
%     \skbondhorizi
%
%    Setting dotted skeletal bonds
%
%     \dotskbonda
%     \dotskbondf
%     \dotskbondc
%     \dotskbondd
%     \dotskbondb
%     \dotskbonde
%     \dotskbondhoriz
%     \dotskbondhorizi
%
%    Basic Macros
%
%     \sixheterov               \@sixheterov
%     \sixheterovi              \@sixheterovi
%
%    Application Macros
%
%     \pyridinev                \@pyridinev
%     \pyridinevi               \@pyridinevi
%     \pyrazinev                \@pyrazinev
%     \pyrimidinev              \@pyrimidinev
%     \pyrimidinevi             \@pyrimidinevi
%     \pyridazinev              \@pyridazinev
%     \pyridazinevi             \@pyridazinevi
%     \triazinev                \@triazinev
%     \triazinevi               \@triazinevi
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Five-Membered Heterocycles>
%    Basic Macros
%
%     \fiveheterov              \@fiveheterov
%     \fiveheterovi             \@fiveheterovi
%
%    Application Macros
%
%     \pyrrolev                 \@pyrrolev
%     \pyrazolev                \@pyrazolev
%     \imidazolev               \@imidazolev
%     \isoxazolev               \@isoxazolev
%     \oxazolev                 \@oxazolev
%
%     \furanv                   \@furanv
%     \thiophenev               \@thiophenev
%
%     \pyrrolevi                \@pyrrolevi
%     \pyrazolevi               \@pyrazolevi
%     \imidazolevi              \@imidazolevi
%     \isoxazolevi              \@isoxazolevi
%     \oxazolevi                \@oxazolevi
%
%     \furanvi                   \@furanvi
%     \thiophenevi               \@thiophenevi
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Six-Six-Fused Heterocycles>
%    Basic Macros
%
%     \decaheterov              \@decaheterov
%     \decaheterovi             \@decaheterovi
%     \decaheterovb             \@decaheterovb
%     \decaheterovt             \@decaheterovt
%
%   Adjustment Macros (for structures as substituents)
%   \changes{v1.02}{1998/10/16}{Newly added command}
%
%     \clipdetection
%     \ylhetposition
%     \ylhetpositionb
%     \ylhetpositiont
%
%    Application Macros
%
%     \quinolinev               \@quinolinev
%     \quinolinevi              \@quinolinevi
%     \quinolinevb              \@quinolinevb
%     \quinolinevt              \@quinolinevt
%
%     \isoquinolinev            \@isoquinolinev
%     \isoquinolinevi           \@isoquinolinevi
%     \isoquinolinevb           \@isoquinolinevb
%     \isoquinolinevt           \@isoquinolinevt
%
%     \quinoxalinev             \@quinoxalinev
%     \quinoxalinevi            \@quinoxalinevi
%     \quinoxalinevb            \@quinoxalinevb
%     \quinoxalinevt            \@quinoxalinevt
%
%     \quinazolinev             \@quinazolinev
%     \quinazolinevi            \@quinazolinevi
%     \quinazolinevb            \@quinazolinevb
%     \quinazolinevt            \@quinazolinevt
%
%     \cinnolinev               \@cinnolinev
%     \cinnolinevi              \@cinnolinevi
%     \cinnolinevb              \@cinnolinevb
%     \cinnolinevt              \@cinnolinevt
%
%     \pteridinev               \@pteridinev
%     \pteridinevi              \@pteridinevi
%     \pteridinevb              \@pteridinevb
%     \pteridinevt              \@pteridinevt
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Six-Five-Fused Heterocycles>
%    Basic Macros
%
%     \nonaheterov              \@nonaheterov
%     \nonaheterovi             \@nonaheterovi
%
%    Application Macros
%
%     \purinev                  \@purinev
%     \purinevi                 \@purinevi
%     \indolev                  \@indolev
%     \indolevi                 \@indolevi
%     \indolizinev              \@indolizinev
%     \indolizinevi             \@indolizinevi
%     \isoindolev               \@isoindolev
%     \isoindolevi              \@isoindolevi
%     \benzofuranev             \@benzofuranev
%     \benzofuranevi            \@benzofuranevi
%     \isobenzofuranev          \@isobenzofuranev
%     \isobenzofuranevi         \@isobenzofuranevi
%     \benzoxazolev             \@benzoxazolev
%     \benzoxazolevi            \@benzoxazolevi
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Four-Membered Heterocycles>
%    Setting bonds
%     \bondshoriz               \bondshorizi
%     \skbondshoriz             \skbondshorizi
%
%    Basic Macros
%
%     \fourhetero               \@fourhetero
%
%    Application Macros
%
%    \oxetane
%    \azetidine
%
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Four-Membered Heterocycles>
%    Setting inner double bonds
%
%     \bondtria                 \bondtrib
%     \skbondtria               \skbondtrib
%     \Bondtria                 \Bondtrib
%     \skBondtria               \skBondtrib
%
%    Basic Macros
%
%     (\fourhetero)              (\@fourhetero)
%     \set@fusionadd@fourv       \set@fusion@fourv
%
%  <Three-Membered Heterocycles>
%
%     \threehetero              \@threehetero
%     \threeheteroi             \@threeheteroi
%
%     \threeheterov              \@threeheterov
%     \threeheterovi             \@threeheterovi
%
%     \set@fusionadd@threev        \set@fusion@threev
%     \set@fusionadd@threevi        \set@fusion@threevi
%
%    Application Macros
%
%    \oxiranev    \oxiranevi
%    \aziridinev  \aziridinevi
%    \thiiranev   \thiiranevi
%
% \end{verbatim}
%
% \begin{verbatim}
%
%  <Building Units>
%
%     \sixunitv                 \@sixunitv
%     \fiveunitv                \@fiveunitv
%     \fiveunitvi               \@fiveunitvi
% \end{verbatim}
%
% \section{Input of basic macros}
%
% To assure the compatibility to \LaTeX{}2.09 (the native mode), 
% the commands added by \LaTeXe{} have not been used in the resulting sty 
% files ({\sf hetarom.sty} for the present case).  Hence, the combination 
% of |\input| and |\@ifundefined| is used to crossload sty 
% files ({\sf chemstr.sty} for the present case) in place of the 
% |\RequirePackage| command of \LaTeXe{}. 
%
%    \begin{macrocode}
% *************************
% * input of basic macros *
% *************************
\@ifundefined{setsixringv}{\input chemstr.sty\relax}{}%
\unitlength=0.1pt%
%    \end{macrocode}
%
% The following switches and macros have been moved to {\sf chemstr.sty}; 
% hence, they are commented out. 
%    \begin{macrocode}
% % ****************************
% % * various flags (switches) *
% % ****************************
% \newif\if@gclip \@gclipfalse%
% \newif\if@hclip \@hclipfalse%
% \newif\if@iclip \@iclipfalse%
% \newif\if@jclip \@jclipfalse%
% \def\iniflag{%
% \@aclipfalse \@bclipfalse\@cclipfalse\@clipfalse\@eclipfalse%
% \@fclipfalse\@gclipfalse\@hclipfalse\@iclipfalse\@jclipfalse%
% \@clipfusefalse}%
% \def\iniatom{%
% \def\aaa{}\def\bbb{}\def\ccc{}\def\ddd{}\def\eee{}\def\fff{}%
% \def\gggA{}\def\hhh{}\def\iii{}\def\jjj{}%
% \def\@aaa{}\def\@bbb{}\def\@ccc{}\def\@ddd{}\def\@eee{}\def\@fff{}%
% }%
% \def\resetbdsw{\gdef\@aaa{a}\gdef\@bbb{b}\gdef\@ccc{c}%
% \gdef\@ddd{d}\gdef\@eee{e}\gdef\@fff{f}}%
%    \end{macrocode}
%
% \section{Initialization}
%
%    \begin{macrocode}
\iniatom%
%    \end{macrocode}
%
% \section{Macros for setting bonds}
% \subsection{Inner double bonds}
% 
% The macros |\sixhetero| and |\fivehetero| use internal macros for setting 
% inner double bonds in accordance with the presence or the absence of 
% hetero atoms.  During the processes of such setting,  
% the inner macros |\bonda| to |\bondf| are used to set a bond 
% on each edge of a six- or five-membered ring; and 
% the inner macros |\bondz| to |\bondzi| draw horizontal bonds 
% of a five-membered ring. 
% 
% Note that 
% comments (conerning locant numbers) on the end of each row have 
% lost the exact meaning, 
% since such a command moiety is used in many macros after copying. 
%
% \begin{verbatim}
% ******************************
% * setting inner double bonds *
% ******************************
% The following numbering is adopted in these macros. 
%                   aaa
%                    1
%                  f * a
%           fff 6  *   *  2 bbb
%             e   |     |   b
%                 |     |
%           eee 5  *   *  3 ccc
%                 d  *  c
%                    4 <===== the original point
%                   ddd
% \end{verbatim}
%
% \begin{macro}{\bonda}
% The macro |\bonda| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\aaa| and |\bbb|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% bond between 1 and 2
\def\bonda{%
  \ifx\aaa\empty%
   \ifx\bbb\empty%
    \Put@Line(6,364)(5,-3){126}%         %double bond 1-2
   \else%
    \Put@Line(6,364)(5,-3){100}%         %double bond 1-2
   \fi%
  \else%
   \ifx\bbb\empty%
    \Put@Line(35,340)(5,-3){100}%        %double bond 1-2
   \else%
    \Put@Line(35,352)(5,-3){100}%        %double bond 1-2
   \fi%                                    % line <1OO not available
  \fi%
 }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondb}
% The macro |\bondb| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\bbb| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% bond between 3 and 2
 \def\bondb{%
  \ifx\bbb\empty%
   \ifx\ccc\empty%
    \Put@Line(138,129)(0,1){148}%        %double bond 3-2
   \else%
    \Put@Line(138,143)(0,1){134}%        %double bond 3-2
   \fi%
  \else%
   \ifx\ccc\empty%
    \Put@Line(138,129)(0,1){134}%        %double bond 3-2
   \else%
    \Put@Line(138,143)(0,1){110}%        %double bond 3-2
   \fi%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondc}
% The macro |\bondc| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\ddd| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% bond between 4 and 3
 \def\bondc{%
  \ifx\ddd\empty%
   \ifx\ccc\empty%
    \Put@Line(6,42)(5,3){126}%           %double bond 4-3
   \else% 
    \Put@Line(6,42)(5,3){100}%           %double bond 4-3
   \fi%
  \else%
   \ifx\ccc\empty%
    \Put@Line(35,66)(5,3){100}%          %double bond 4-3
   \else% 
    \Put@Line(35,60)(5,3){100}%          %double bond 4-3
   \fi%                                    % line <1OO not available
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondd}
% The macro |\bondd| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\ddd| and |\eee|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% bond between 4 and 5
 \def\bondd{%
  \ifx\ddd\empty%
   \ifx\eee\empty%
    \Put@Line(-6,42)(-5,3){126}%         %double bond 4-5
   \else% 
    \Put@Line(-6,42)(-5,3){100}%         %double bond 4-5
   \fi%
  \else%
   \ifx\eee\empty%
    \Put@Line(-35,66)(-5,3){100}%        %double bond 4-5
   \else% 
    \Put@Line(-35,60)(-5,3){100}%        %double bond 4-5
   \fi%                                    % line <1OO not available
  \fi%
 }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bonde}
% The macro |\bonde| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\fff| and |\eee|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% bond between 5 and 6
\def\bonde{%
  \ifx\fff\empty%
   \ifx\eee\empty%
    \Put@Line(-138,129)(0,1){148}%       %double bond 5-6
   \else%
    \Put@Line(-138,143)(0,1){134}%       %double bond 5-6
   \fi%
  \else%
   \ifx\eee\empty%
    \Put@Line(-138,129)(0,1){134}%       %double bond 5-6
   \else%
    \Put@Line(-138,143)(0,1){110}%       %double bond 5-6
   \fi%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondf}
% The macro |\bondf| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\aaa| and |\fff|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% bond between 1 and 6
\def\bondf{%
  \ifx\aaa\empty%
   \ifx\fff\empty%
    \Put@Line(-6,364)(-5,-3){126}%        %double bond 1-6
   \else%
    \Put@Line(-6,364)(-5,-3){100}%        %double bond 1-6
   \fi%
  \else%
   \ifx\fff\empty%
    \Put@Line(-35,340)(-5,-3){100}%       %double bond 1-6
%    \Put@Line(-6,364)(-5,-3){126}%       %double bond 1-6 bug fix 2010/10/01
   \else%
    \Put@Line(-35,352)(-5,-3){100}%       %double bond 1-6
   \fi%                                     % line <1OO not available
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondz}
% The macro |\bondz| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\fff| and |\bbb|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% horizontal inner bond for five-membered rings
\def\bondhoriz{%
  \ifx\fff\empty%
    \ifx\bbb\empty%
     \Put@Line(-138,270)(1,0){277}%      %double bond 4-3
    \else%
     \Put@Line(-138,270)(1,0){258}%      %double bond 4-3
    \fi%
  \else%
    \ifx\bbb\empty%
     \Put@Line(-120,270)(1,0){258}%      %double bond 4-3
    \else%
     \Put@Line(-120,270)(1,0){239}%      %double bond 4-3
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondzi}
% The macro |\bondzi| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\eee| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
% horizontal inner bond for five-membered rings (inverse type) 
\def\bondhorizi{%
  \ifx\eee\empty%
    \ifx\ccc\empty%
     \Put@Line(-138,136)(1,0){277}%      %double bond 4-3
    \else%
     \Put@Line(-138,136)(1,0){258}%      %double bond 4-3
    \fi%
  \else%
    \ifx\ccc\empty%
     \Put@Line(-120,136)(1,0){258}%      %double bond 4-3
    \else%
     \Put@Line(-120,136)(1,0){239}%      %double bond 4-3
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \subsection{Skeletal bonds}
% 
% The macros |\sixhetero| and |\fivehetero| use inner macros for setting 
% skeletal bonds in accordance with the presence or the absence of 
% hetero atoms.  During the processes of such setting,  
% the inner macros |\skbonda| to |\skbondf| are used to set a bond 
% on each edge of a six- or five-membered ring; and 
% the inner macros |\skbondz| to |\skbondzi| draw horizontal bonds 
% of a five-membered ring. 
%
% \begin{verbatim}
% **************************
% * setting skeletal bonds *
% **************************
% The following numbering is adopted in this macro. 
%                   aaa
%                    1
%                  f * a
%           fff 6  *   *  2 bbb
%             e   |     |   b
%                 |     |
%           eee 5  *   *  3 ccc
%                 d  *  c
%                    4 <===== the original point
%                   ddd
% 
% \end{verbatim}
%
% \begin{macro}{\skbonda}
% The macro |\skbonda| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\aaa| and |\bbb|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 1 and 2
\def\skbonda{%
  \ifx\aaa\empty%
    \ifx\bbb\empty%
     \Put@Line(0,406)(5,-3){171}%        %bond 1-2
    \else%
     \Put@Line(0,406)(5,-3){136}%        %bond 1-2
    \fi%
   \else%
    \ifx\bbb\empty%
     \Put@Line(35,385)(5,-3){136}%       %bond 1-2
    \else%
     \Put@Line(35,385)(5,-3){100}%       %bond 1-2
    \fi%
   \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondf}
% The macro |\skbonda| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\aaa| and |\fff|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 1 and 6
\def\skbondf{%
  \ifx\aaa\empty%
    \ifx\fff\empty%
     \Put@Line(0,406)(-5,-3){171}%       %bond 1-6
    \else%
     \Put@Line(0,406)(-5,-3){136}%       %bond 1-6
    \fi%
   \else%
    \ifx\fff\empty%
     \Put@Line(-35,385)(-5,-3){136}%     %bond 1-6
    \else%
     \Put@Line(-35,385)(-5,-3){100}%     %bond 1-6
    \fi%
   \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondc}
% The macro |\skbondc| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\ccc| and |\ddd|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 4 and 3
\def\skbondc{%
  \ifx\ddd\empty%
    \ifx\ccc\empty%
     \Put@Line(0,0)(5,3){171}%           %bond 4-3
    \else%
     \Put@Line(0,0)(5,3){136}%           %bond 4-3
    \fi%
  \else%
    \ifx\ccc\empty%
     \Put@Line(35,21)(5,3){138}%         %bond 4-3
    \else%
     \Put@Line(35,21)(5,3){100}%         %bond 4-3
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondd}
% The macro |\skbondd| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\ddd| and |\eee|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 4 and 5
\def\skbondd{%
  \ifx\ddd\empty%
    \ifx\eee\empty%
     \Put@Line(0,0)(-5,3){171}%          %bond 4-5
    \else%
     \Put@Line(0,0)(-5,3){136}%          %bond 4-5
    \fi%
  \else%
    \ifx\eee\empty%
     \Put@Line(-35,21)(-5,3){138}%       %bond 4-5
    \else%
     \Put@Line(-35,21)(-5,3){100}%        %bond 4-5
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondb}
% The macro |\skbondb| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\bbb| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 3 and 2
\def\skbondb{%
  \ifx\bbb\empty%%
    \ifx\ccc\empty%%
     \Put@Line(171,103)(0,1){200}%       %bond 3-2
    \else%
     \Put@Line(171,143)(0,1){160}%       %bond 3-2
    \fi%
  \else%
    \ifx\ccc\empty%%
     \Put@Line(171,103)(0,1){150}%       %bond 3-2
    \else%
     \Put@Line(171,143)(0,1){110}%       %bond 3-2
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbonde}
% The macro |\skbonde| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\eee| and |\fff|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 5 and 6
\def\skbonde{%
  \ifx\eee\empty%
    \ifx\fff\empty%
     \Put@Line(-171,103)(0,1){200}%       %bond 5-6
    \else%
     \Put@Line(-171,103)(0,1){150}%       %bond 5-6
    \fi%
  \else%
    \ifx\fff\empty%
     \Put@Line(-171,143)(0,1){160}%       %bond 5-6
    \else%
     \Put@Line(-171,143)(0,1){110}%       %bond 5-6
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondhoriz}
% The macro |\skbondhoriz| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\fff| and |\bbb|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%horizontal bond for five-membered rings
\def\skbondhoriz{%
  \ifx\fff\empty%
    \ifx\bbb\empty%
     \Put@Line(-171,303)(1,0){342}%      %bond 4-3
    \else%
     \Put@Line(-171,303)(1,0){300}%      %bond 4-3
    \fi%
  \else%
    \ifx\bbb\empty%
     \Put@Line(171,303)(-1,0){300}%      %bond 4-3
    \else%
     \Put@Line(-129,303)(1,0){258}%      %bond 4-3
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondhorizi}
% The macro |\skbondhorizi| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\eee| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%horizontal bond for five-membered rings (inverse type)
\def\skbondhorizi{%
  \ifx\eee\empty%
    \ifx\ccc\empty%
     \Put@Line(-171,103)(1,0){342}%      %bond 4-3
    \else%
     \Put@Line(-171,103)(1,0){300}%      %bond 4-3
    \fi%
  \else%
    \ifx\ccc\empty%
     \Put@Line(171,103)(-1,0){300}%      %bond 4-3
    \else%
     \Put@Line(-129,103)(1,0){258}%      %bond 4-3
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\set@outskel@sixv}
% The macro |\set@outskel@sixv| is to typeset a series of 
% outer-skeleton bonds to six rings. It is 
% used in |\sixheterov| and |\sixheterovi|. 
%
%    \begin{macrocode}
\def\set@outskel@sixv{%
 \skbonda% bond between 1 and 2
 \skbondf% bond between 1 and 6
 \skbondc% bond between 4 and 3
 \skbondd% bond between 4 and 5
 \skbondb% bond between 3 and 2
 \skbonde% bond between 5 and 6
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Dotted Skeletal Bonds}
% 
% The macros |\sixfusev| etc. use inner macros for setting 
% skeletal bonds in accordance with the presence or the absence of 
% hetero atoms.  During the processes of such setting,  
% the inner macros |\dotskbonda| to |\dotskbondf| are used 
% to set a dotted bond on each edge of a six- or five-membered ring.  
%
% \begin{macro}{\dotskbonda}
% The macro |\dotskbonda| is the dotted couterpart of |\skbonda|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\aaa| and |\bbb|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 1 and 2
\def\dotskbonda{%
  \ifx\aaa\empty%
    \ifx\bbb\empty%
       \dotorline(0,406)(5,-3){171}/(0,406)(171,303)%
    \else%
       \dotorline(0,406)(5,-3){136}/(0,406)(136,324)%
    \fi%
   \else%
    \ifx\bbb\empty%
       \dotorline(35,385)(5,-3){136}/(35,386)(171,303)%
    \else%
       \dotorline(35,385)(5,-3){100}/(35,386)(136,324)%
    \fi%
   \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondb}
% The macro |\dotskbondb| is the dotted couterpart of |\skbondb|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\bbb| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 3 and 2
\def\dotskbondb{%
  \ifx\bbb\empty%%
    \ifx\ccc\empty%%
       \dotorline(171,103)(0,1){200}/(171,103)(171,303)%
    \else%
       \dotorline(171,143)(0,1){160}/(171,143)(171,303)%
    \fi%
  \else%
    \ifx\ccc\empty%%
       \dotorline(171,103)(0,1){150}/(171,103)(171,253)%
    \else%
       \dotorline(171,143)(0,1){110}/(171,143)(171,253)%
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondc}
% The macro |\dotskbondc| is the dotted couterpart of |\skbondc|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\ccc| and |\ddd|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 4 and 3
\def\dotskbondc{%
  \ifx\ddd\empty%
    \ifx\ccc\empty%%
       \dotorline(0,0)(5,3){171}/(0,0)(171,103)%
    \else%
       \dotorline(0,0)(5,3){136}/(0,0)(136,81)%
    \fi%
  \else%
    \ifx\ccc\empty%
       \dotorline(35,21)(5,3){138}/(35,21)(171,103)%
    \else%
       \dotorline(35,21)(5,3){100}/(35,21)(136,81)%
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondd}
% The macro |\dotskbondd| is the dotted couterpart of |\skbondd|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\ddd| and |\eee|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 4 and 5
\def\dotskbondd{%
  \ifx\ddd\empty%
    \ifx\eee\empty%
       \dotorline(0,0)(-5,3){171}/(0,0)(-171,103)%
    \else%
       \dotorline(0,0)(-5,3){136}/(0,0)(-136,81)%
    \fi%
  \else%
    \ifx\eee\empty%
       \dotorline(-35,21)(-5,3){138}/(-35,21)(-171,103)%
    \else%
       \dotorline(-35,21)(-5,3){100}/(-35,21)(-136,81)%
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbonde}
% The macro |\dotskbonde| is the dotted couterpart of |\skbonde|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\eee| and |\fff|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 5 and 6
\def\dotskbonde{%
  \ifx\eee\empty%
    \ifx\fff\empty%
       \dotorline(-171,103)(0,1){200}/(-171,103)(-171,303)%
    \else%
       \dotorline(-171,103)(0,1){150}/(-171,103)(-171,253)%
    \fi%
  \else%
    \ifx\fff\empty%
       \dotorline(-171,143)(0,1){160}/(-171,143)(-171,303)%
    \else%
       \dotorline(-171,143)(0,1){110}/(-171,143)(-171,253)%
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondf}
% The macro |\dotskbondf| is the dotted couterpart of |\skbondf|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\aaa| and |\fff|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%bond between 1 and 6
\def\dotskbondf{%
  \ifx\aaa\empty%
    \ifx\fff\empty%
       \dotorline(0,406)(-5,-3){171}/(0,406)(-171,303)%
    \else%
       \dotorline(0,406)(-5,-3){136}/(0,406)(-136,325)%
    \fi%
   \else%
    \ifx\fff\empty%
       \dotorline(-35,385)(-5,-3){136}/(-35,385)(-171,303)%
    \else%
       \dotorline(-35,385)(-5,-3){100}/(-35,385)(-136,325)%
    \fi%
   \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondhoriz}
% The macro |\dotskbondhoriz| is the dotted couterpart of |\skbondhoriz|, 
% which refers to the control sequences representing 
% atoms on both of the terminal vertices (|\fff| and |\bbb|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%horizontal bond for five-membered rings
\def\dotskbondhoriz{%
  \ifx\fff\empty%
    \ifx\bbb\empty%
       \dotorline(-171,303)(1,0){342}/(-171,303)(171,303)%
    \else%
       \dotorline(-171,303)(1,0){300}/(-171,303)(129,303)%
    \fi%
  \else%
    \ifx\bbb\empty%
       \dotorline(171,303)(-1,0){300}/(171,303)(-129,303)%
    \else%
       \dotorline(-129,303)(1,0){258}/(-129,303)(129,303)%
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondhorizi}
% The macro |\dotskbondhorizi| refers to the control sequences representing 
% atoms on both of the terminal vertices (|\eee| and |\ccc|) and 
% examine whether these are empty or not.  Thereby, 
% it decides the vertices to be truncated. 
%
%    \begin{macrocode}
%horizontal bond for five-membered rings (inverse type)
\def\dotskbondhorizi{%
  \ifx\eee\empty%
    \ifx\ccc\empty%
       \dotorline(-171,103)(1,0){342}/(-171,103)(171,103)%
    \else%
       \dotorline(-171,103)(1,0){300}/(-171,103)(129,103)%
    \fi%
  \else%
    \ifx\ccc\empty%
       \dotorline(171,103)(-1,0){300}/(171,103)(-129,103)%
    \else%
       \dotorline(-129,103)(1,0){258}/(-129,103)(129,103)%
    \fi%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@skel@bond| is used in such commands as |\sixheterov| 
% and |\sixfusev| for setting skeletal bonds (outer bonds), 
% when |\@aaa| etc. (produced by |\csname|...|\endcsname|) are equal 
% to `a' etc. (given as \#2).  Thinline, thickline and dotted-line 
% skeletal bonds are available. 
%
% \begin{macro}{\if@skbondlist}
%    \begin{macrocode}
\newif\if@skbondlist
\@skbondlistfalse
%    \end{macrocode}
% \end{macro}% from fusering.sty to hetarom.sty
%
% \changes{v4.02}{2004/12/20}{The positions of \cs{@skbondlisttrue} are changed.}
% \changes{v5.00}{2010/10/01}{For bond coloring}
%
% \begin{macro}{\set@skel@bond}
%    \begin{macrocode}
\def\set@skel@bond#1#2#3{%
 \expandafter\if\csname @#2#2#2\endcsname #2\relax%OK
                               % \if\@aaa #2\relax%OK
  \def\skbondreplace{#3}%
  \@skbondlistfalse
  \@tfor\member:=#1\do{%
   \expandafter\twoCH@@R\member//%
    \if\@@tmpa #2\relax%
      \if\@@tmpb A\relax%
        \@skbondlisttrue
        \expandafter\csname dotskbond#3\endcsname% \dotskbonda etc.
%        \@skbondlisttrue
      \else\if\@@tmpb B\relax%
        \@skbondlisttrue
        {\thicklines
        \expandafter\csname skbond#3\endcsname% \skbonda etc.
        }%
%        \@skbondlisttrue
      \else%%%added for color 2010/10/01
        \@skbondlisttrue%
        \put(0,0){\@@tmpb}%
      \fi\fi
     \fi%
    }%
   \if@skbondlist\else
     {\thinlines
        \expandafter\csname skbond#3\endcsname% \skbonda etc.
     }%
   \fi%
  \else
    \expandafter\ifx\csname @#2#2#2\endcsname \empty\relax%
                                %    \ifx\@aaa\empty\relax
    \@tfor\member:=#1\do{%
     \expandafter\twoCH@@R\member//%
      \if\@@tmpa #2\relax%
       \XyMTeXWarning{Unavailable bond `#2' in SKBONDLIST}\fi
    }%
  \fi\fi
}% end of \set@skel@bond
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@skel@longbond| is used in |\fivefusev| etc. 
% for setting skeletal bonds (outer bonds), when |\@aaa| etc. 
% (produced by |\csname|...|\endcsname|) are equal to `a' 
% etc. (given as \#2).  Thinline, thickline and dotted-line 
% skeletal bonds are available. 
%
% hetarom.dtx
% \changes{v4.02}{2004/12/20}{The positions of \cs{@skbondlisttrue} are changed.}
% \changes{v5.00}{2010/10/01}{For bond coloring}
%
% \begin{macro}{\set@skel@longbond}
%    \begin{macrocode}
\newif\iflongskbond \longskbondfalse
\def\set@skel@longbond#1#2#3{%
 \expandafter\if\csname @#2#2#2\endcsname #2\relax%OK
                               % \if\@aaa #2\relax%OK
  \def\skbondreplace{#3}%
  \longskbondtrue%
  \@skbondlistfalse
  \@tfor\member:=#1\do{%
   \expandafter\twoCH@@R\member//%
    \if\@@tmpa #2\relax%
      \if\@@tmpb A\relax%
        \@skbondlisttrue
        \expandafter\csname dot#3\endcsname% \dotskbonda etc.
%        \@skbondlisttrue
      \else\if\@@tmpb B\relax%
        \@skbondlisttrue
        {\thicklines
        \expandafter\csname #3\endcsname% \skbonda etc.
        }%
%        \@skbondlisttrue
      \else%%%added for color 2010/10/01
        \@skbondlisttrue%
        \put(0,0){\@@tmpb}%
      \fi\fi
     \fi%
    }%
   \if@skbondlist\else
     {\thinlines
        \expandafter\csname #3\endcsname% \skbonda etc.
     }%
   \fi%
  \else
    \expandafter\ifx\csname @#2#2#2\endcsname \empty\relax%
                                %    \ifx\@aaa\empty\relax
    \@tfor\member:=#1\do{%
     \expandafter\twoCH@@R\member//%
      \if\@@tmpa #2\relax%
       \XyMTeXWarning{Unavailable bond `#2' in SKBONDLIST}\fi
    }%
  \fi\fi
  \longskbondfalse
}% end of \set@skel@longbond
%    \end{macrocode}
% \end{macro}
%
% The macro |\@bond@@omit| is used in |\sixheterov| etc. 
% for detecting omitted bonds, where |\@aaa| etc. are empty if 
% they are omitted. 
%
% \begin{macro}{\@bond@@omit}
%    \begin{macrocode}
\def\@bond@@omit#1{%
\@tfor\memBer:=#1\do{%
\if\memBer a\relax\gdef\@aaa{}\fi%
\if\memBer A\relax\gdef\@aaa{}\fi%
\if\memBer b\relax\gdef\@bbb{}\fi%
\if\memBer B\relax\gdef\@bbb{}\fi%
\if\memBer c\relax\gdef\@ccc{}\fi%
\if\memBer C\relax\gdef\@ccc{}\fi%
\if\memBer d\relax\gdef\@ddd{}\fi%
\if\memBer D\relax\gdef\@ddd{}\fi%
\if\memBer e\relax\gdef\@eee{}\fi%
\if\memBer E\relax\gdef\@eee{}\fi%
\if\memBer f\relax\gdef\@fff{}\fi%
\if\memBer F\relax\gdef\@fff{}\fi%
\if\memBer g\relax\gdef\@ggg{}\fi%
\if\memBer G\relax\gdef\@ggg{}\fi%
\if\memBer h\relax\gdef\@hhh{}\fi%
\if\memBer H\relax\gdef\@hhh{}\fi%
\if\memBer i\relax\gdef\@iii{}\fi%
\if\memBer I\relax\gdef\@iii{}\fi%
\if\memBer j\relax\gdef\@jjj{}\fi%
\if\memBer J\relax\gdef\@jjj{}\fi%
\if\memBer k\relax\gdef\@kkk{}\fi%
\if\memBer K\relax\gdef\@kkk{}\fi%
}}%
%    \end{macrocode}
% \end{macro}
%
% \section{Six-membered heterocyles}
% \subsection{Vertical type}
%
% The standard skeleton of a six-membered heterocycle is selected 
% to have the following locant numbers. 
%
% \begin{verbatim}
% *************************
% * sixhetero derivatives *
% *  (vertical type)      *
% *************************
% The following numbering is adopted in this macro. 
%
%          1
%          * 
%     6  *   *  2
%       |     |
%       |     |
%     5  *   *  3
%          *
%          4 <===== the original point
% \end{verbatim}
%
% The macro |\sixheterov| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \sixheterov(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `f' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to f, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' represents an aromatic circle. The option 
% `$n+$' ($n=1$ to $6$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST = 
%
%           none or r  :  sixhetero (right-handed)
%           l          :  sixhetero (left-handed)
%           []         :  fully saturated form
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,6-double bond
%           f          :  6,1-double bond
%           A          :  aromatic circle 
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 6)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%
%     ATOMLIST: list of heteroatoms (max 6 atoms)
%
%       for n = 1 to 6
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position, 
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
% \begin{verbatim}
%
%     SUBSLIST: list of substituents
%
%       for n = 1 to 6 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a, b, c, d, e, or f)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \sixheterov{1==N}{1==Cl;2==F}
%        \sixheterov[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \sixheterov[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\sixheterov| uses a picture environment and 
% consists of the following unit processes: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by |\setsixringv|. 
% \end{enumerate}
%
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/11/15}{Adding \cs{test@vertix@sixv}}
%
% \begin{macro}{\sixheterov}
% \begin{macro}{\@six@heterov}
% \begin{macro}{\@six@@heterov}
% \begin{macro}{\@sixheterov}
%    \begin{macrocode}
\def\sixheterov{\@ifnextchar({\@six@heterov(@}{\@six@heterov(@)}}
\def\@six@heterov(#1){\@ifnextchar[{\@six@@heterov(#1)[@}%
{\@six@@heterov(#1)[@]}}
\def\@six@@heterov(#1)[#2]#3#4{\@ifnextchar[%
{\@sixheterov(#1)[#2]{#3}{#4}[@}%
{\@sixheterov(#1)[#2]{#3}{#4}[@]}}
\def\@sixheterov(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
% \changes{v3.01}{2002/4/30}{Replaced by \cs{ShiftPicEnv}}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniatom\iniflag%initialize
\test@vertix@sixv{#3}{a}{b}{c}{d}{e}{f}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{0}{0}{7}{0}%
\begin{ShiftPicEnv}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,880)(-\shiftii,-\shifti){sixheterov}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{%
\resetbdsw%
\@bond@@omit{#5}%
\set@skel@bond{#1}{a}{a}% bond between 1 and 2 \@aaa -> \skbonda etc
\set@skel@bond{#1}{b}{b}% bond between 2 and 3 \@bbb -> \skbondb etc
\set@skel@bond{#1}{c}{c}% bond between 3 and 4 \@ccc -> \skbondc etc
\set@skel@bond{#1}{d}{d}% bond between 4 and 5 \@ddd -> \skbondd etc
\set@skel@bond{#1}{e}{e}% bond between 5 and 6 \@eee -> \skbonde etc
\set@skel@bond{#1}{f}{f}% bond between 6 and 1 \@fff -> \skbondf etc
}%
%%%%%\set@outskel@sixv % replaced by above 1998/12/30
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax \bondd \bondf \bondb%
\else\if\member l\relax \bonda \bondc \bonde%
\else\if\member a\relax \bonda%
\else\if\member b\relax \bondb%
\else\if\member c\relax \bondc%
\else\if\member d\relax \bondd%
\else\if\member e\relax \bonde%
\else\if\member f\relax \bondf%
\else\if\member A%left aromatic circle 
  \Put@oCircle(0,203){240}%               %circle
% %%%%%%%%%%%%%%%%%%%%%%%%%
% % inner bond attachment %
% %%%%%%%%%%%%%%%%%%%%%%%%%
\else \expandafter\twoCH@@R\member//%
    \set@fusionadd@sixv%
\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms %
% %%%%%%%%%%%%%%%%%%%%%%%%
\set@hetatom@sixv{#3}{0}{0}{7}{0}%    %atom 1--6%
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\setsixringv{#4}{0}{0}{7}{0}%    %subst 1--6
\end{ShiftPicEnv}\iniatom\iniflag}% %end of \sixheterov macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Inverse vertical type}
%
% The standard skeleton of a six-membered heterocycle of inverse type 
% is selected to have the following locant numbers. 
%
% \begin{verbatim}
% **********************************
% * sixhetero derivatives          *
% *  (vertical type, inverse type) *
% **********************************
% The following numbering is adopted in this macro. 
%
%          4
%          * 
%     5  *   *  3
%       |     |
%       |     |
%     6  *   *  2
%          *
%          1 <===== the original point
% \end{verbatim}
%
% The macro |\sixheterovi| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \sixheterovi(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `f' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to f, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' represents an aromatic circle. The option 
% `$n+$' ($n=1$ to $6$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%
%     BONDLIST = 
%
%           none or r  :  sixhetero (right-handed)
%           l          :  sixhetero (left-handed)
%           []         :  fully saturated form
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,6-double bond
%           f          :  6,1-double bond
%           A          :  aromatic circle 
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 6)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%
%     ATOMLIST: list of heteroatoms (max 6 atoms)
%
%       for n = 1 to 6
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position, 
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
% \begin{verbatim}
%
%     SUBSLIST: list of substituents
%
%       for n = 1 to 6 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a, b, c, d, e, or f)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \sixheterovi{1==N}{1==Cl;2==F}
%        \sixheterovi[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \sixheterovi[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
%
% \end{verbatim}
%
% The definition of |\sixheterovi| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by |\setsixringv|. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
%
% \begin{macro}{\sixheterovi}
% \begin{macro}{\@six@heterovi}
% \begin{macro}{\@six@@heterovi}
% \begin{macro}{\@sixheterovi}
%    \begin{macrocode}
\def\sixheterovi{\@ifnextchar({\@six@heterovi(@}{\@six@heterovi(@)}}
\def\@six@heterovi(#1){\@ifnextchar[{\@six@@heterovi(#1)[@}%
{\@six@@heterovi(#1)[@]}}
\def\@six@@heterovi(#1)[#2]#3#4{\@ifnextchar[%
{\@sixheterovi(#1)[#2]{#3}{#4}[@}%
{\@sixheterovi(#1)[#2]{#3}{#4}[@]}}
\def\@sixheterovi(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
% \changes{v3.01}{2002/4/30}{Replaced by \cs{ShiftPicEnv}}
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniatom\iniflag%initialize
\test@vertix@sixv{#3}{d}{c}{b}{a}{f}{e}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adjustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{5}{0}{5}{-1}%    %subst 1--4
\ylposition{#4}{11}{4}{7}{-1}%   %subst 5 and 6
\begin{ShiftPicEnv}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,880)(-\shiftii,-\shifti){sixheterovi}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{\resetbdsw%
\@bond@@omit{#5}%
\set@skel@bond{#1}{a}{c}% bond between 1 and 2 \@aaa -> \skbondc etc
\set@skel@bond{#1}{b}{b}% bond between 2 and 3 \@bbb -> \skbondb etc
\set@skel@bond{#1}{c}{a}% bond between 3 and 4 \@ccc -> \skbonda etc
\set@skel@bond{#1}{d}{f}% bond between 4 and 5 \@ddd -> \skbondf etc
\set@skel@bond{#1}{e}{e}% bond between 5 and 6 \@eee -> \skbonde etc
\set@skel@bond{#1}{f}{d}% bond between 6 and 1 \@fff -> \skbondd etc
}%
%%%\set@outskel@sixv% replaced by the above 1998/12/30
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax \bondd \bondf \bondb%
\else\if\member l\relax \bonda \bondc \bonde%
\else\if\member a\relax \bondc%
\else\if\member b\relax \bondb%
\else\if\member c\relax \bonda%
\else\if\member d\relax \bondf%
\else\if\member e\relax \bonde%
\else\if\member f\relax \bondd%
\else\if\member A%left aromatic circle 
  \Put@oCircle(0,203){240}%               %circle
% %%%%%%%%%%%%%%%%%%%%%%%%%
% % inner bond attachment %
% %%%%%%%%%%%%%%%%%%%%%%%%%
\else \expandafter\twoCH@@R\member//%
   \set@fusionadd@sixvi%
\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}%
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms %
% %%%%%%%%%%%%%%%%%%%%%%%%
\set@hetatom@sixv{#3}{5}{0}{5}{-1}%    %atom 1--4%
\set@hetatom@sixv{#3}{11}{4}{7}{-1}%   %atom 5 and 6%
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\setsixringv{#4}{5}{0}{5}{-1}%    %subst 1--4
\setsixringv{#4}{11}{4}{7}{-1}%   %subst 5 and 6
\end{ShiftPicEnv}\iniatom\iniflag}% %end of \sixheterovi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Pyridine derivatives of vertical type}
%
% The macros |\sixheterov| and |\sixheterovi| can be used in the 
% form of a fixed |ATOMLIST|.  Hence, the resulting commands for 
% drawing a six-membered heterocyle with one or more nitrogen atoms 
% have an argument |SUBSLIST| as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
% ************************
% * pyridine derivatives *
% *  (vertical type)     *
% ************************
%
%   \pyridinev[BONDLIST]{SUBSLIST}
%   \pyridinevi[BONDLIST]{SUBSLIST}
%   \pyrazinev[BONDLIST]{SUBSLIST}
%   \pyrimidinev[BONDLIST]{SUBSLIST}
%   \pyrimidinevi[BONDLIST]{SUBSLIST}
%   \triazinev[BONDLIST]{SUBSLIST}
%   \triazinevi[BONDLIST]{SUBSLIST}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to f, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' represents an aromatic circle. The option 
% `$n+$' ($n=1$ to $6$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST = 
%
%           none or r  :  pyridine (right-handed)
%           l          :  pyridine (left-handed)
%           []         :  fully saturated ring
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,6-double bond
%           f          :  6,1-double bond
%           A          :  aromatic circle 
%           {n+}       :  plus at the n-nitrogen atom
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
% \begin{verbatim}
%
%     SUBSLIST: list of substituents
%
%       for n = 1 to 6 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \pyridinev{1==Cl;2==F}
%        \pyridinev[c]{1==Cl;4==F;2==CH$_{3}$}
%        \pyridinev[eb]{1D==O;4SA==MeO;4SB==OMe;5W==Cl;6==Cl}
% \end{verbatim}
%
% \begin{macro}{\pridinev}
% \begin{macro}{\pridinevi}
%    \begin{macrocode}
\def\pyridinev{\@ifnextchar[{\@pyridinev[@}{\@pyridinev[r]}}
\def\@pyridinev[#1]#2{%
\iforigpt \typeout{command `pyridinev' %
   is based on `sixheterov'.}\fi%
\sixheterov[#1]{1==N}{#2}}%end of \pyridinev macro
\def\pyridinevi{\@ifnextchar[{\@pyridinevi[@}{\@pyridinevi[r]}}
\def\@pyridinevi[#1]#2{%
\iforigpt \typeout{command `pyridinevi' %
   is based on `sixheterovi'.}\fi%
\sixheterovi[#1]{1==N}{#2}}%end of \pyridinevi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\pyrazinev}
% \begin{macro}{\pyrazinevi}
%    \begin{macrocode}
\def\pyrazinev{\@ifnextchar[{\@pyrazinev[@}{\@pyrazinev[r]}}
\def\@pyrazinev[#1]#2{%
\iforigpt \typeout{command `pyrazinev' %
   is based on `sixheterov'.}\fi%
\sixheterov[#1]{1==N;4==N}{#2}}%end of \pyrazinev macro
%the same formula with an alternative locant numbering
\def\pyrazinevi{\@ifnextchar[{\@pyrazinevi[@}{\@pyrazinevi[r]}}
\def\@pyrazinevi[#1]#2{%
\iforigpt \typeout{command `pyrazinevi' %
   is based on `sixheterovi'.}\fi%
\sixheterovi[#1]{1==N;4==N}{#2}}%end of \pyrazinevi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\pyrimidinev}
% \begin{macro}{\pyrimidinevi}
%    \begin{macrocode}
\def\pyrimidinev{\@ifnextchar[{\@pyrimidinev[@}{\@pyrimidinev[r]}}
\def\@pyrimidinev[#1]#2{%
\iforigpt \typeout{command `pyrimidinev' %
   is based on `sixheterov'.}\fi%
\sixheterov[#1]{1==N;3==N}{#2}}%end of \pyrimidinev macro
\def\pyrimidinevi{\@ifnextchar[{\@pyrimidinevi[@}{\@pyrimidinevi[r]}}
\def\@pyrimidinevi[#1]#2{%
\iforigpt \typeout{command `pyrimidinevi' %
   is based on `sixheterovi'.}\fi%
\sixheterovi[#1]{1==N;3==N}{#2}}%end of \pyrimidinevi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\pyridazinev}
% \begin{macro}{\pyridazinevi}
%    \begin{macrocode}
\def\pyridazinev{\@ifnextchar[{\@pyridazinev[@}{\@pyridazinev[r]}}
\def\@pyridazinev[#1]#2{%
\iforigpt \typeout{command `pyridazinev' %
   is based on `sixheterov'.}\fi%
\sixheterov[#1]{1==N;2==N}{#2}}%end of \pyridazinev macro
\def\pyridazinevi{\@ifnextchar[{\@pyridazinevi[@}{\@pyridazinevi[r]}}
\def\@pyridazinevi[#1]#2{%
\iforigpt \typeout{command `pyridazinev' %
   is based on `sixheterovi'.}\fi%
\sixheterovi[#1]{1==N;2==N}{#2}}%end of \pyridazinevi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\triazinev}
% \begin{macro}{\triazinevi}
%    \begin{macrocode}
\def\triazinev{\@ifnextchar[{\@triazinev[@}{\@triazinev[r]}}
\def\@triazinev[#1]#2{%
\iforigpt \typeout{command `triazinev' %
   is based on `sixheterov'.}\fi%
\sixheterov[#1]{1==N;3==N;5==N}{#2}}%end of \triazinev macro
\def\triazinevi{\@ifnextchar[{\@triazinevi[@}{\@triazinevi[r]}}
\def\@triazinevi[#1]#2{%
\iforigpt \typeout{command `triazinevi' %
   is based on `sixheterovi'.}\fi%
\sixheterovi[#1]{1==N;3==N;5==N}{#2}}%end of \triazinevi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \section{Five-membered heterocycles}
% \subsection{Vertical type}
%
% The standard skeleton of a five-membered heterocycle 
% is selected to have the following locant numbers. 
%
% \begin{verbatim}
% **************************
% * fivehetero derivatives *
% *  (vertical type)       *
% **************************
% The following numbering is adopted in this macro. 
%
%     4  _____  3
%       |     |
%       |     |
%     5  *   *  2
%          *
%          1 <===== the original point
% \end{verbatim}
%
% The macro |\fiveheterov| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \fiveheterov(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `e' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' represents an aromatic circle. The option 
% `$n+$' ($n=1$ to $5$) represents a plus charge on a hetero atom 
% at the $n$-position. 
% The option `$0+$' typesets a plus charge at the center of the ring. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,1-double bond
%           A          :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 5)
%           {0+}       :  plus (or minus) at the center
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%
%     ATOMLIST: list of heteroatoms (max 5 atoms)
%
%       for n = 1 to 5
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 5 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a, b, c, d, or e)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \fiveheterov{1==N}{1==H;2==F}
%        \fiveheterov[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \fiveheterov[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5W==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\fiveheterov| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/10/31}{Add: fused and spiro rings}
%
% \begin{macro}{\fiveheterov}
% \begin{macro}{\@five@heterov}
% \begin{macro}{\@five@@heterov}
% \begin{macro}{\@fiveheterov}
%    \begin{macrocode}
\def\fiveheterov{\@ifnextchar({\@five@heterov(@}{\@five@heterov(@)}}
\def\@five@heterov(#1){\@ifnextchar[{\@five@@heterov(#1)[@}%
{\@five@@heterov(#1)[@]}}
\def\@five@@heterov(#1)[#2]#3#4{\@ifnextchar[%
{\@fiveheterov(#1)[#2]{#3}{#4}[@}%
{\@fiveheterov(#1)[#2]{#3}{#4}[@]}}
\def\@fiveheterov(#1)[#2]#3#4[#5]{%
\iniatom\iniflag%initialize
% %%%%%%%%%%%%%
% % atom list %
% %%%%%%%%%%%%%
\test@vertix@sixv{#3}{d}{c}{b}{f}{e}{a}%
%    \end{macrocode}
%
% \changes{v3.01}{2002/4/30}{Replaced by \cs{ShiftPicEnv}}
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{5}{1}{5}{-1}%   % for 1 to 3
\ylposition{#4}{10}{4}{7}{-1}%  % for 4 to 5
\begin{ShiftPicEnv}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,880)(-\shiftii,-\shifti){fiveheterov}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{\resetbdsw%
\@bond@@omit{#5}%
\set@skel@bond{#1}{a}{c}% bond between 1 and 2 \@aaa -> \skbondc etc
\set@skel@bond{#1}{b}{b}% bond between 2 and 3 \@bbb -> \skbondb etc
\set@skel@longbond{#1}{c}{skbondhoriz}%
      % bond between 3 and 4 \@ccc -> \skbondhoriz etc
\set@skel@bond{#1}{d}{e}% bond between 4 and 5 \@ddd -> \skbonde etc
\set@skel@bond{#1}{e}{d}% bond between 5 and 1 \@eee -> \skbondd etc
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r%
\else\if\member a\relax \bondc%
\else\if\member b\relax \bondb%
\else\if\member c\relax \bondhoriz%
\else\if\member d\relax \bonde%
\else\if\member e\relax \bondd%
\else\if\member A\relax%
 \Put@oCircle(0,173){180}%aromatic circle
% %%%%%%%%%%%%%%%%%%%%%%%%%
% % inner bond attachment %
% %%%%%%%%%%%%%%%%%%%%%%%%%
\else
    \expandafter\twoCH@@R\member//%
    \set@fusionadd@fivev
\fi\fi\fi\fi\fi\fi\fi}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%
% % setting heteroatoms %
% %%%%%%%%%%%%%%%%%%%%%%%
\set@hetatom@sixv{#3}{5}{1}{5}{-1}%   % for 1 to 3
\set@hetatom@sixv{#3}{10}{4}{7}{-1}%  % for 4 to 5
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\setsixringv{#4}{5}{1}{5}{-1}%   % for 1 to 3
\setsixringv{#4}{10}{4}{7}{-1}%  % for 4 to 5
\end{ShiftPicEnv}\iniatom\iniflag}% %end of \fiveheterov macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Inverse vertical type}
%
% The standard skeleton of a five-membered heterocycle of inverse type 
% is selected to have the following locant numbers. 
%
% \begin{verbatim}
% *****************************
% * fivehetero derivatives    *
% *  (vertical type, inverse) *
% *****************************
% The following numbering is adopted in this macro. 
%
%          1
%          * 
%     6  *   *  2
%       |     |
%       |_____|
%     4         3
%          *
%        (0,0) <===== the original point
% \end{verbatim}
%
% The macro |\fiveheterovi| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \fiveheterovi(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `f' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' represents an aromatic circle. The option 
% `$n+$' ($n=1$ to $5$) represents a plus charge on a hetero atom 
% at the $n$-position. 
% The option `$0+$' typesets a plus charge at the center of the ring. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,1-double bond
%           A          :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 5)
%           {0+}       :  plus (or minus) at the center
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 5 atoms)
%
%       for n = 1 to 5
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 5 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a, b, c, d, or e)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \fiveheterovi{1==N}{1==H;2==F}
%        \fiveheterovi[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \fiveheterovi[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\fiveheterovi| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
%
% \begin{macro}{\fiveheterovi}
% \begin{macro}{\@five@heterovi}
% \begin{macro}{\@five@@heterovi}
% \begin{macro}{\@fiveheterovi}
%    \begin{macrocode}
\def\fiveheterovi{\@ifnextchar({\@five@heterovi(@}{\@five@heterovi(@)}}
\def\@five@heterovi(#1){\@ifnextchar[{\@five@@heterovi(#1)[@}%
{\@five@@heterovi(#1)[@]}}
\def\@five@@heterovi(#1)[#2]#3#4{\@ifnextchar[%
{\@fiveheterovi(#1)[#2]{#3}{#4}[@}%
{\@fiveheterovi(#1)[#2]{#3}{#4}[@]}}
\def\@fiveheterovi(#1)[#2]#3#4[#5]{%
\iniatom\iniflag%initialize
%    \end{macrocode}
%
% \changes{v3.01}{2002/4/30}{Replaced by \cs{ShiftPicEnv}}
%    \begin{macrocode}
% %%%%%%%%%%%%%
% % atom list %
% %%%%%%%%%%%%%
\test@vertix@sixv{#3}{a}{b}{c}{e}{f}{d}% d -- dummy
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{0}{0}{4}{0}%  % for 1 to 3
\ylposition{#4}{1}{4}{7}{0}%  % for 4 to 5
\begin{ShiftPicEnv}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,880)(-\shiftii,-\shifti){fiveheterov}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{\resetbdsw%
\@bond@@omit{#5}%
\set@skel@bond{#1}{a}{a}% bond between 1 and 2 \@aaa -> \skbonda etc
\set@skel@bond{#1}{b}{b}% bond between 2 and 3 \@bbb -> \skbondb etc
\set@skel@longbond{#1}{c}{skbondhorizi}%
      % bond between 3 and 4 \@ccc -> \skbondhorizi etc
\set@skel@bond{#1}{d}{e}% bond between 4 and 5 \@ddd -> \skbonde etc
\set@skel@bond{#1}{e}{f}% bond between 5 and 6 \@eee -> \skbondf etc
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r%
\else\if\member a\relax \bonda%
\else\if\member b\relax \bondb%
\else\if\member c\relax \bondhorizi%
\else\if\member d\relax \bonde%
\else\if\member e\relax \bondf%
\else\if\member A\relax%
 \Put@oCircle(0,233){180}%aromatic circle
\else
    \expandafter\twoCH@@R\member//%
    \set@fusionadd@fivevi
\fi\fi\fi\fi\fi\fi\fi}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%
% % setting heteroatoms %
% %%%%%%%%%%%%%%%%%%%%%%%
\set@hetatom@sixv{#3}{0}{0}{4}{0}%  % for 1 to 3
\set@hetatom@sixv{#3}{1}{4}{7}{0}%  % for 4 to 5
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\setsixringv{#4}{0}{0}{4}{0}%  % for 1 to 3
\setsixringv{#4}{1}{4}{7}{0}%  % for 4 to 5
\end{ShiftPicEnv}\iniatom\iniflag}% %end of \fiveheterovi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Pyrrole derivatives of vertical type}
%
% The macro |\fiveheterov| can be used in the 
% form of a fixed |ATOMLIST|.  Hence, the resulting commands for 
% drawing a five-membered heterocyle with one or more nitrogen atoms 
% have an argument |SUBSLIST| as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
% ***********************************
% * pyrrole derivatives  and others *
% *  (vertical type)                *
% ***********************************
%
%   \pyrrolev[BONDLIST]{SUBSLIST}
%   \pyrazolev[BONDLIST]{SUBSLIST}
%   \imidazolev[BONDLIST]{SUBSLIST}
%   \isoxazolev[BONDLIST]{SUBSLIST}
%   \oxazolev[BONDLIST]{SUBSLIST}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option 
% `$n+$' ($n=1$ to $5$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           none       :  mother nucleus
%           []         :  fully saturated form
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,1-double bond
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 5)
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 5 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \pyrrolev{1==H;2==F}
%        \pyrrolev[]{1==H;2==F}
%        \imidazolev[c]{1==Cl;4==F;2==CH$_{3}$}
%        \isoxazolev[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5W==Cl;6==Cl}
% \end{verbatim}
%
% \begin{macro}{\pyrrolev}
% \begin{macro}{\pyrazolev}
% \begin{macro}{\imidazolev}
% \begin{macro}{\isoxazolev}
% \begin{macro}{\oxazolev}
%    \begin{macrocode}
\def\pyrrolev{\@ifnextchar[{\@pyrrolev[@}{\@pyrrolev[bd]}}
\def\@pyrrolev[#1]#2{%
\iforigpt \typeout{command `pyrrolev' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==N}{#2}}
\def\pyrazolev{\@ifnextchar[{\@pyrazolev[@}{\@pyrazolev[bd]}}
\def\@pyrazolev[#1]#2{%
\iforigpt \typeout{command `pyrazolev' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==N;2==N}{#2}}
\def\imidazolev{\@ifnextchar[{\@imidazolev[@}{\@imidazolev[bd]}}
\def\@imidazolev[#1]#2{%
\iforigpt \typeout{command `imidazolev' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==N;3==N}{#2}}
\def\isoxazolev{\@ifnextchar[{\@isoxazolev[@}{\@isoxazolev[bd]}}
\def\@isoxazolev[#1]#2{%
\iforigpt \typeout{command `isoxazolev' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==O;2==N}{#2}}
\def\oxazolev{\@ifnextchar[{\@oxazolev[@}{\@oxazolev[bd]}}
\def\@oxazolev[#1]#2{%
\iforigpt \typeout{command `oxazolev' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==O;3==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\furanv}
% \begin{macro}{\thiophenev}
%    \begin{macrocode}
\def\furanv{\@ifnextchar[{\@furanv[@}{\@furanv[bd]}}
\def\@furanv[#1]#2{%
\iforigpt \typeout{command `furanv' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==O}{#2}}
\def\thiophenev{\@ifnextchar[{\@thiophenev[@}{\@thiophenev[bd]}}
\def\@thiophenev[#1]#2{%
\iforigpt \typeout{command `thiophenev' %
  is based on `fiveheterov'.}\fi%
\fiveheterov[#1]{1==S}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Pyrrole derivatives of inverse vertical type}
%
% The macro |\fiveheterovi| can be used in the 
% form of a fixed |ATOMLIST|.  Hence, the resulting commands for 
% drawing a five-membered heterocyle with one or more nitrogen atoms 
% have an argument |SUBSLIST| as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
% ***********************************
% * pyrrole derivatives  and others *
% *  (vertical type, inverse)       *
% ***********************************
%
%   \pyrrolevi[BONDLIST]{SUBSLIST}
%   \pyrazolevi[BONDLIST]{SUBSLIST}
%   \imidazolevi[BONDLIST]{SUBSLIST}
%   \isoxazolevi[BONDLIST]{SUBSLIST}
%   \oxazolevi[BONDLIST]{SUBSLIST}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option 
% `$n+$' ($n=1$ to $5$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           none       :  mother nucleus
%           []         :  fully saturated form
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,1-double bond
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 5)
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents (max 6 substitution positions)
%
%       for n = 1 to 5 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \pyrrolevi{1==H;2==F}
%        \pyrrolevi[]{1==H;2==F}
%        \imidazolevi[c]{1==Cl;4==F;2==CH$_{3}$}
%        \isoxazolevi[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5W==Cl;6==Cl}
% \end{verbatim}
%
% \begin{macro}{\pyrrolevi}
% \begin{macro}{\pyrazolevi}
% \begin{macro}{\imidazolevi}
% \begin{macro}{\isoxazolevi}
% \begin{macro}{\oxazolevi}
%    \begin{macrocode}
\def\pyrrolevi{\@ifnextchar[{\@pyrrolevi[@}{\@pyrrolevi[bd]}}
\def\@pyrrolevi[#1]#2{%
\iforigpt \typeout{command `pyrrolevi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==N}{#2}}
\def\pyrazolevi{\@ifnextchar[{\@pyrazolevi[@}{\@pyrazolevi[bd]}}
\def\@pyrazolevi[#1]#2{%
\iforigpt \typeout{command `pyrazolevi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==N;2==N}{#2}}
\def\imidazolevi{\@ifnextchar[{\@imidazolevi[@}{\@imidazolevi[bd]}}
\def\@imidazolevi[#1]#2{%
\iforigpt \typeout{command `imidazolevi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==N;3==N}{#2}}
\def\isoxazolevi{\@ifnextchar[{\@isoxazolevi[@}{\@isoxazolevi[bd]}}
\def\@isoxazolevi[#1]#2{%
\iforigpt \typeout{command `isoxazolevi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==O;2==N}{#2}}
\def\oxazolevi{\@ifnextchar[{\@oxazolevi[@}{\@oxazolevi[bd]}}
\def\@oxazolevi[#1]#2{%
\iforigpt \typeout{command `oxazolevi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==O;3==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\furanvi}
% \begin{macro}{\thiophenevi}
%    \begin{macrocode}
\def\furanvi{\@ifnextchar[{\@furanvi[@}{\@furanvi[bd]}}
\def\@furanvi[#1]#2{%
\iforigpt \typeout{command `furanvi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==O}{#2}}
\def\thiophenevi{\@ifnextchar[{\@thiophenevi[@}{\@thiophenevi[bd]}}
\def\@thiophenevi[#1]#2{%
\iforigpt \typeout{command `thiophenevi' %
  is based on `fiveheterovi'.}\fi%
\fiveheterovi[#1]{1==S}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \section{Six-to-six fused heterocyles}
% \subsection{Vertical type}
%
% The standard skeleton of a six-to-six fused heterocycle is selected 
% to have the following locant numbers. 
%
% \begin{verbatim}
% **************************
% * decahetero derivatives *
% *  (vertical type)       *
% **************************
% The following numbering is adopted in this macro. 
%
%          8 (10)1
%          *  8a *
%     7  *   * *   *  2
%       |     |     |
%       |     |     |
%     6  *   * *   *  3
%          *  4a *
%          5 (9) 4
%          ^
%          |
%          the original point
% \end{verbatim}
%
% The macro |\decaheterov| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \decaheterov(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `k' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to k, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' and `B' represent aromatic circles. The option 
% `$n+$' ($n=1$ to $10$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST:  list of bonds 
%
%           none or r  :  decahetero (right-handed)
%           l          :  decahetero (left-handed)
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  4,3-double bond      d    :  4,4a-double bond
%           e    :  4a,5-double bond     f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,8-double bond
%           i    :  8,8a-double bond     j    :  1,8a-double bond
%           k    :  4a,8a-double bond
%           A    :  aromatic circle      B    :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 10)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 10 atoms)
%
%       for n = 1 to 8
%
%            n         : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
%            na        : Hetero atom at 4a or 8b (n=4 or 8)
%                        e.g. 4a==N (or 9==N) for N at 4a-position
%                             8a==N (or {{10}}==N) for N at 8a-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 9 (4a position) and 10 (8a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to k: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \decaheterov{1==N}{1==Cl;2==F}
%        \decaheterov[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \decaheterov[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\decaheterov| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| several times. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/25}{Spiro rings and fused rings
% \cs{test@vertix@sixv}, \cs{test@vertix@decav}, etc.}
% \changes{v4.03b}{2006/9/5}{bug fix \cs{ggg} to \cs{gggA} etc. in \cs{test@vertix@sixv}}
%
% \begin{macro}{\decaheterov}
% \begin{macro}{\@deca@heterov}
% \begin{macro}{\@deca@@heterov}
% \begin{macro}{\@decaheterov}
%    \begin{macrocode}
\def\decaheterov{\@ifnextchar({\@deca@heterov(@}{\@deca@heterov(@)}}
\def\@deca@heterov(#1){\@ifnextchar[{\@deca@@heterov(#1)[@}%
{\@deca@@heterov(#1)[@]}}
\def\@deca@@heterov(#1)[#2]#3#4{\@ifnextchar[%
{\@decaheterov(#1)[#2]{#3}{#4}[@}%
{\@decaheterov(#1)[#2]{#3}{#4}[@]}}%
\def\@decaheterov(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
\test@vertix@sixv{#3}{a}{b}{c}{d}{e}{f}%
\test@vertix@decav{#3}{g}{h}{i}{j}{@}{@}%
% %%%%%%%%%%%%%%%%%%%%%%%
% % adjustment for (yl) %
% %%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylhetposition{#4}{0}{0}{5}{0}% %substituents on 1 to 4
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-342}\def\@@yli{0}\fi
\else
\ylhetposition{#4}{-1}{3}{7}{0}% %substituents on 5 to 7
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
\ylhetposition{#4}{-7}{0}{2}{0}% %substituent on 8
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@iclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-8}{7}%   %9 %for 4a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-103}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@jclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-9}{1}%  %10 for 8a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-303}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1200,880)(-\shiftii,-\shifti){decaheterov}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
\begingroup
\resetbdsw%
\@bond@@omit{#5}%
{\let\fff=\jjj \let\eee=\iii%
\Put@Direct(342,0){\set@skel@bond{#1}{a}{a}}%
  % bond between 1 and 2 \@aaa -> \skbonda etc
\Put@Direct(342,0){\set@skel@bond{#1}{b}{b}}%
  % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(342,0){\set@skel@bond{#1}{c}{c}}%
  % bond between 3 and 4 \@ccc -> \skbondc etc
\Put@Direct(342,0){\set@skel@bond{#1}{d}{d}}%
  % bond between 4 and 4a \@ddd -> \skbondd etc
\Put@Direct(342,0){\set@skel@bond{#1}{k}{e}}%
  % bond between 4a and 8a \@kkk -> \skbonde etc
\Put@Direct(342,0){\set@skel@bond{#1}{j}{f}}%
  % bond between 8a and 1 \@jjj -> \skbondf etc
}%
{\let\aaa=\hhh \let\ddd=\eee \let\eee=\fff \let\fff=\gggA%
 \let\ccc=\iii \let\bbb=\jjj%
\set@skel@bond{#1}{i}{a}% bond between 8 and 8a \@iii -> \skbonda etc
\set@skel@bond{#1}{e}{c}% bond between 5 and 4a \@eee -> \skbondc etc
\set@skel@bond{#1}{f}{d}% bond between 5 and 6 \@fff -> \skbondd etc
\set@skel@bond{#1}{g}{e}% bond between 6 and 7 \@ggg -> \skbonde etc
\set@skel@bond{#1}{h}{f}% bond between 7 and 8 \@hhh -> \skbondf etc
}%
\endgroup
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
{\let\fff=\jjj \let\eee=\iii%
 \Put@Direct(342,0){\bonda}% bond between 1 and 2
 \Put@Direct(342,0){\bondc}% bond between 3 and 4
}%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA%
 \let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 8a and 4a
 \Put@Direct(0,0){\bondf}% bond between 8 and 7
 \Put@Direct(0,0){\bondd}% bond between 5 and 6
}%
\else\if\member l\relax%
\else\if\member a\relax%
 \Put@Direct(342,0){\bonda}% bond between 1 and 2
\else\if\member b\relax
 \Put@Direct(342,0){\bondb}% bond between 2 and 3
\else\if\member c\relax
 \Put@Direct(342,0){\bondc}% bond between 3 and 4
\else\if\member d\relax%
{\let\eee=\iii%
 \Put@Direct(342,0){\bondd}% bond between 4 and 4a
}%
\else\if\member e\relax%
{\let\ccc=\iii \let\ddd=\eee%
 \Put@Direct(0,0){\bondc}% bond between 5 and 4a
}%
\else\if\member f\relax%
{\let\ddd=\eee \let\eee=\fff%
 \Put@Direct(0,0){\bondd}% bond between 5 and 6
}%
\else\if\member g\relax%
{\let\eee=\fff \let\fff=\gggA% 
 \Put@Direct(0,0){\bonde}% bond between 6 and 7
}%
\else\if\member h\relax%
{\let\aaa=\hhh \let\fff=\gggA%
 \Put@Direct(0,0){\bondf}% bond between 8 and 7
}%
\else\if\member i\relax%
{\let\aaa=\hhh \let\bbb=\jjj%
 \Put@Direct(0,0){\bonda}% bond between 8 and 8a
}%
\else\if\member j\relax%
{\let\fff=\jjj%
 \Put@Direct(342,0){\bondf}% bond between 1 and 8a
}%
\else\if\member k\relax%
{\let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 8a and 4a
}%
\else\if\member K\relax%
{\let\eee=\iii\let\fff=\jjj%
 \Put@Direct(342,0){\bonde}% bond between 8a and 4a in the other ring
}%
\else\if\member A%left aromatic circle 
  \Put@oCircle(0,203){240}%               %circle
\else\if\member B%left aromatic circle 
  \Put@oCircle(342,203){240}%             %circle
\else
  \expandafter\twoCH@@R\member//%
  \def\aax{8a}\def\aay{4a}\def\aaz{10}%
      \if\@@tmpa 1\relax%                  % plus charge etc.
        \putratom{304}{282}{\@@tmpb}%      % right type
      \else\if\@@tmpa 2\relax%
        \putratom{402}{253}{\@@tmpb}%      % right type
      \else\if\@@tmpa 3\relax%
        \putratom{402}{120}{\@@tmpb}%      % right type
      \else\if\@@tmpa 4\relax%
        \putratom{304}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 5\relax%
        \putratom{-38}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 6\relax%
        \putlatom{-60}{253}{\@@tmpb}%      % left type
      \else\if\@@tmpa 7\relax%
        \putlatom{-60}{120}{\@@tmpb}%      % left type
      \else\if\@@tmpa 8\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\if\@@tmpa 9\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
%      \else\if\@@tmpa 10\relax%
      \else\ifx\@@tmpa\aaz\relax%1998/10/17
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aax\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aay\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
% ***********************
% * setting fused rings *
% ***********************
   \expandafter\twoCH@R\member//%
   \set@fusion@decav
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
% \changes{v2.00a}{2000/11/11}{The 
% \cs{iniflag} command is added to 5- and 8-substitution.}
% \changes{v2.01}{2001/6/20}{The \cs{storeclipinfo} command is added.}
% \changes{v4.03b}{2006/9/5}{The \cs{storeclipinfo} command, bugfixed}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms and spiro rings %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag
\Put@Direct(342,0){\set@hetatom@sixv{#3}{0}{0}{5}{0}%
%   \if@aclip \global\@acliptrue\fi
%   \if@bclip \global\@bcliptrue\fi
%   \if@cclip \global\@ccliptrue\fi
%   \if@clip \global\@cliptrue\fi
\storeclipinfo%2001/06/20
}% %substituents on 1 to 4
{%
%\developclipinfo%2001/06/20 %2006/9/5deleted
\Put@Direct(0,0){\iniflag%2000/11/11 by S. Fujita
   \set@hetatom@sixv{#3}{-1}{3}{7}{0}%
%   \@gclipfalse \if@fclip \global\@gcliptrue \fi%
%   \@fclipfalse \if@eclip \global\@fcliptrue \fi%
%   \@eclipfalse \if@clip \global\@ecliptrue \fi
%
   \@gclipfalse \if@fclip \@gcliptrue \fi%
   \@fclipfalse \if@eclip \@fcliptrue \fi%
   \@eclipfalse \if@clip \@ecliptrue \fi
   \@clipfalse%2006/9/5added
%
\storeclipinfo%2001/06/20
}%substituents on 5 to 7
}{%
%\developclipinfo%2001/06/20 2006/9/5deleted
\Put@Direct(0,0){\iniflag%2000/11/11 by S. Fujita
  \set@hetatom@sixv{#3}{-7}{0}{2}{0}%
%%  \@hclipfalse \if@aclip \global\@hcliptrue \fi
  \@hclipfalse \if@aclip \@hcliptrue \fi
  \@aclipfalse%2006/9/5added
\storeclipinfo%%2001/06/20
%%====\clipinfo====%%%2006/9/5test
}%%substituent on 8
}{%
%\developclipinfo%%2001/06/20 2006/9/5deleted
\Put@Direct(0,0){\set@vrtx@fuse{#3}%
%  \if@iclip \global\@icliptrue \fi
%  \if@jclip \global\@jcliptrue \fi
\storeclipinfo%%2001/06/20
}% fused positions
}%
%====\clipinfo====%%2006/9/5test
\developclipinfo%%2001/06/20
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents and exocyclic bonds %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\global\drawsamesubsttrue%2002/05/30 warning on
{%2006/9/5bugfix
\Put@Direct(342,0){\setsixringv{#4}{0}{0}{5}{0}}% %substituents on 1 to 4
}%
\global\drawsamesubstfalse%2002/05/30 warning off
{%
 \@clipfalse \if@eclip \@cliptrue \fi%   %substituents on 5 to 7
 \@eclipfalse \if@fclip \@ecliptrue \fi%
 \@fclipfalse \if@gclip \@fcliptrue \fi%
\Put@Direct(0,0){\setsixringv{#4}{-1}{3}{7}{0}}%
}%
{\@aclipfalse \if@hclip \@acliptrue \fi%   %substituent on 8
\Put@Direct(0,0){\setsixringv{#4}{-7}{0}{2}{0}}%
}%
{\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \Put@Direct(171,103){\setatombond{#4}{-8}{7}}%   %9 %for 4a position
}%
{\@clipfusefalse \if@jclip \@clipfusetrue \fi%
  \Put@Direct(171,303){\setatombond{#4}{-9}{1}}%  %10 for 8a position
}%
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \decaheterov macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The |\clipdetection| command is used for the detection of 
% clippings for a six-six ring.  In particular, the clippings 
% at the fused positions are detected in the |\decaheterov| command, 
% where the data are applied to the command 
% |\ylatombondposition| (chemstr.dtx). 
% \changes{v1.02}{1998/10/16}{Newly added command}
% \changes{v2.01}{2001/6/20}{The
% \cs{storeclipinfo} command is added.}
%
% \begin{macro}{\clipdetection}
%    \begin{macrocode}
\def\clipdetection{%
% hetero atom on 1
\ifx\aaa\empty\else%
     \@acliptrue%
\fi%
% hetero atom on 2
\ifx\bbb\empty\else%
     \@bcliptrue%
\fi%
% hetero atom on 3
\ifx\ccc\empty\else%
     \@ccliptrue%
\fi%
% hetero atom on 4
\ifx\ddd\empty\else%
   \@cliptrue%
\fi%
% hetero atom on 4a
{\let\eee=\iii%
\ifx\eee\empty\else%
%     \global\@icliptrue%
    \@icliptrue%
    \storeclipinfo%2001/06/20
\fi%
}%
\developclipinfo%2001/06/20
% hetero atom on 8a
{\let\fff=\jjj%
\ifx\fff\empty\else%
%     \global\@jcliptrue%
    \@jcliptrue%
    \storeclipinfo%2001/06/20
\fi%
}%
\developclipinfo%2001/06/20
% hetero atom on 5
{\let\ddd=\eee%
\ifx\ddd\empty\else
%    \global\@ecliptrue%
    \@ecliptrue%
    \storeclipinfo%2001/06/20
\fi%
}%
\developclipinfo%2001/06/20
% hetero atom on 6
{\let\eee=\fff%
\ifx\eee\empty\else%
%     \global\@fcliptrue%
    \@fcliptrue%
    \storeclipinfo%2001/06/20
\fi%
}%
\developclipinfo%2001/06/20
% hetero atom on 7
{\let\fff=\gggA%
\ifx\fff\empty\else%
%     \global\@gcliptrue%
     \@gcliptrue%
     \storeclipinfo%2001/06/20
\fi%
}%
\developclipinfo%2001/06/20
% hetero atom on 8
{\let\aaa=\hhh%
\ifx\aaa\empty\else%
%     \global\@hcliptrue%
     \@hcliptrue%
     \storeclipinfo%2001/06/20
\fi%
}%
\developclipinfo%2001/06/20
}% end \clipdetection
%    \end{macrocode}
% \end{macro}
%
% The command |\ylhetposition| is used in the |\decaheterov| command, 
% giving the sift values for drawing a structure as a substituent. 
% \changes{v1.02}{1998/10/16}{Newly added command}
% \changes{v5.01}{2012/03/25}{Bug fixed}
%
% \begin{macro}{\ylhetposition}
%    \begin{macrocode}
\def\ylhetposition#1#2#3#4#5{%
\@@ylswfalse%%%\@reset@ylsw
\@forsemicol\member:=#1\do{%
\if@@ylsw\else%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}\relax%
\ifx\@memberb\@yl\relax\@@ylswtrue\else\@@ylswfalse\fi
\if@@ylsw
\ifnum#5<0\relax%
\@tmpaa=-\@tmpa\relax \advance\@tmpaa by#2\relax%
\else\@tmpaa=\@tmpa\relax \advance\@tmpaa by#2\relax\fi
\ifnum\@tmpaa>#3\relax%
\ifnum\@tmpaa<#4\relax%
\ifcase\@tmpaa%0 omit
%    \end{macrocode}
%
% The flags |\@lyatrue| etc are not used in a revised edition. 
%
%    \begin{macrocode}
 \or
    \ifx\aaa\empty
     \ifx\hhh\empty% aaa and hhh are absent
       \gdef\@ylii{0}\gdef\@yli{-406}\global\@ylswtrue%\@ylatrue% subst. on 1
     \else% hhh is present
       \def\@ylii{0}\def\@yli{-442}\@ylswtrue%\@ylatrue% subst. on 1
     \fi
    \else%aaa is present
      \def\@ylii{0}\def\@yli{-442}\@ylswtrue%\@ylatrue% subst. on 1
    \fi
 \or\ifx\bbb\empty
      \def\@ylii{-171}\def\@yli{-303}\@ylswtrue%\@ylbtrue% subst. on 2
%      \def\@ylii{-513}\def\@yli{-303}\@ylswtrue%\@ylbtrue% subst. on 2
    \else
      \def\@ylii{-213}\def\@yli{-327}\@ylswtrue%\@ylbtrue% subst. on 2
%      \def\@ylii{-555}\def\@yli{-327}\@ylswtrue%\@ylbtrue% subst. on 2
    \fi
 \or\ifx\ccc\empty
      \def\@ylii{-171}\def\@yli{-103}\@ylswtrue%\@ylctrue% subst. on 3
%      \def\@ylii{-513}\def\@yli{-103}\@ylswtrue%\@ylctrue% subst. on 3
    \else
      \def\@ylii{-213}\def\@yli{-79}\@ylswtrue%\@ylctrue% subst. on 3
%      \def\@ylii{-555}\def\@yli{-79}\@ylswtrue%\@ylctrue% subst. on 3
    \fi
 \or\ifx\ddd\empty
     \ifx\eee\empty% ddd and eee are absent
       \gdef\@ylii{0}\gdef\@yli{0}\global\@ylswtrue%\@yldtrue% subst. on 4
      \else% eee present
       \gdef\@ylii{0}\gdef\@yli{36}\global\@ylswtrue%\@yldtrue% subst. on 4
     \fi
    \else% ddd present
      \gdef\@ylii{0}\gdef\@yli{36}\global\@ylswtrue%\@yldtrue% subst. on 4
    \fi
 \or
    \ifx\eee\empty
     \ifx\iii\empty
      \ifx\fff\empty% eee, iii and fff are absent
%        \def\@ylii{173}\def\@yli{-103}\@ylswtrue%\@yletrue% subst. on 5
        \def\@ylii{171}\def\@yli{-103}\@ylswtrue%\@yletrue% subst. on 5 refined 2013/03/25
      \else% fff is present 
        \def\@ylii{213}\def\@yli{-79}\@ylswtrue%\@yletrue% subst. on 5
      \fi
%     \else% iii is present; fused position => no action here
%        \def\@ylii{0}\def\@yli{-36}\@ylswtrue%\@yletrue% subst. on 5
     \fi
    \else% eee is present
%      \def\@ylii{213}\def\@yli{-79}\@ylswtrue%\@yletrue% subst. on 5
       \def\@ylii{171}\def\@yli{-103}\@ylswtrue%\@yletrue% subst. on 5 bug fix 2013/03/25
   \fi
 \or
    \ifx\fff\empty
     \ifx\jjj\empty
      \ifx\gggA\empty% fff, jjj, and ggg are absent
%        \def\@ylii{173}\def\@yli{-303}\@ylswtrue%\@ylftrue% subst. on 6 
        \def\@ylii{171}\def\@yli{-303}\@ylswtrue%\@ylftrue% subst. on 6 refined 2013/03/25
      \else%ggg is present
        \def\@ylii{213}\def\@yli{-327}\@ylswtrue%\@ylftrue% subst. on 6
      \fi
%     \else%jjj is present; fused position => no action here
%       \def\@ylii{213}\def\@yli{-327}\@ylswtrue%\@ylftrue% subst. on 6
     \fi
    \else%fff is present
      \def\@ylii{213}\def\@yli{-327}\@ylswtrue%\@ylftrue% subst. on 6
    \fi%
\fi%end of ifcase
\fi\fi\fi\fi\fi}}%
%    \end{macrocode}
% \end{macro}
%
% \subsection{Inverse vertical type}
%
% The standard skeleton of a six-to-six fused heterocycle is selected 
% to have the following locant numbers. 
%
% \begin{verbatim}
% **********************************
% * decahetero derivatives         *
% *  (vertical type, inverse type) *
% **********************************
% The following numbering is adopted in this macro. 
%
%          5 (9) 4
%          *  4a *
%     6  *   * *   *  3
%       |     |     |
%       |     |     |
%     7  *   * *   *  2
%          *  8a *
%          8 (10)1
%          ^
%          |
%          the original point
% \end{verbatim}
%
% The macro |\decaheterovi| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \decaheterovi(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `k' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to k, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The options `A' and `B' represent aromatic circles in two rings. 
% The option `$n+$' ($n=1$ to $10$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}  
%     BONDLIST:  list of bonds 
%
%           none or r  :  decahetero (right-handed)
%           l          :  decahetero (left-handed)
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  4,3-double bond      d    :  4,4a-double bond
%           e    :  4a,5-double bond     f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,8-double bond
%           i    :  8,8a-double bond     j    :  1,8a-double bond
%           k    :  4a,8a-double bond
%           K    :  4a,8a-double bond in the other ring
%           A    :  aromatic circle      B    :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 10)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 10 atoms)
%
%       for n = 1 to 8
%
%            n         : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
%            na        : Hetero atom at 4a or 8b (n=4 or 8)
%                        e.g. 4a==N (or 9==N) for N at 4a-position
%                             8a==N (or {{10}}==N) for N at 8a-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 9 (4a position) and 10 (8a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to k: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \decaheterovi{1==N}{1==Cl;2==F}
%        \decaheterovi[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \decaheterovi[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5W==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\decaheterovi| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterovi|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| several times. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/25}{Spiro rings and fused rings: 
% \cs{test@vertix@decavi}, etc.}
% \changes{v2.01}{2001/06/20}{The \cs{storeclipinfo} command, etc.}
%
% \begin{macro}{\decaheterovi}
% \begin{macro}{\@deca@heterovi}
% \begin{macro}{\@deca@@heterovi}
% \begin{macro}{\@decaheterovi}
%    \begin{macrocode}
\def\decaheterovi{\@ifnextchar({\@deca@heterovi(@}{\@deca@heterovi(@)}}
\def\@deca@heterovi(#1){\@ifnextchar[{\@deca@@heterovi(#1)[@}%
{\@deca@@heterovi(#1)[@]}}
\def\@deca@@heterovi(#1)[#2]#3#4{\@ifnextchar[%
{\@decaheterovi(#1)[#2]{#3}{#4}[@}%
{\@decaheterovi(#1)[#2]{#3}{#4}[@]}}
\def\@decaheterovi(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
%%\test@vertix@sixv{#3}{d}{c}{b}{a}{h}{g}%
%%\test@vertix@decav{#3}{f}{e}{i}{j}{@}{@}%{i}{j} fixed
\test@vertix@decavi{#3}%
%
% %%%%%%%%%%%%%%%%%%%%%%%
% % adjustment for (yl) %
% %%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylhetposition{#4}{5}{0}{5}{-1}% %substituents on 1 to 4
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-342}\def\@@yli{0}\fi
\else
\ylhetposition{#4}{12}{3}{7}{-1}% %substituents on 6 to 8
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
\ylhetposition{#4}{-4}{0}{2}{0}% %substituent on 5
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \ylatombondposition{#4}{-9}{7}%  %10 for 8a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-103}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@jclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-8}{1}%   %9 for 4a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-303}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1200,880)(-\shiftii,-\shifti){decaheterovi}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
\begingroup
\resetbdsw%
\@bond@@omit{#5}%
{\let\fff=\jjj \let\eee=\iii%
\Put@Direct(342,0){\set@skel@bond{#1}{c}{a}}%
  % bond between 1 and 2 \@aaa -> \skbonda etc
\Put@Direct(342,0){\set@skel@bond{#1}{b}{b}}%
  % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(342,0){\set@skel@bond{#1}{a}{c}}%
  % bond between 3 and 4 \@ccc -> \skbondc etc
\Put@Direct(342,0){\set@skel@bond{#1}{j}{d}}%
  % bond between 4 and 4a \@ddd -> \skbondd etc
\Put@Direct(342,0){\set@skel@bond{#1}{k}{e}}%
  % bond between 4a and 8a \@kkk -> \skbonde etc
\Put@Direct(342,0){\set@skel@bond{#1}{d}{f}}%
  % bond between 8a and 1 \@jjj -> \skbondf etc
}%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA%
 \let\ccc=\iii\let\bbb=\jjj%
\set@skel@bond{#1}{e}{a}% bond between 8 and 8a \@eee -> \skbonda etc
\set@skel@bond{#1}{i}{c}% bond between 5 and 4a \@iii -> \skbondc etc
\set@skel@bond{#1}{h}{d}% bond between 5 and 6 \@hhh -> \skbondd etc
\set@skel@bond{#1}{g}{e}% bond between 6 and 7 \@ggg -> \skbonde etc
\set@skel@bond{#1}{f}{f}% bond between 7 and 8 \@fff -> \skbondf etc
}%
\endgroup
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
{\let\fff=\jjj \let\eee=\iii%
 \Put@Direct(342,0){\bonda}% bond between 1 and 2
 \Put@Direct(342,0){\bondc}% bond between 3 and 4
}%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA%
 \let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 8a and 4a
 \Put@Direct(0,0){\bondf}% bond between 8 and 7
 \Put@Direct(0,0){\bondd}% bond between 5 and 6
}%
\else\if\member l\relax%
\else\if\member a\relax%
 \Put@Direct(342,0){\bondc}% bond between 3 and 4
\else\if\member b\relax%
 \Put@Direct(342,0){\bondb}% bond between 2 and 3
\else\if\member c\relax%
 \Put@Direct(342,0){\bonda}% bond between 1 and 2
\else\if\member d\relax%
{\let\fff=\jjj%
 \Put@Direct(342,0){\bondf}% bond between 1 and 8a
}%
\else\if\member e\relax%
{\let\aaa=\hhh \let\bbb=\jjj%
 \Put@Direct(0,0){\bonda}% bond between 8 and 8a
}%
\else\if\member f\relax%
{\let\aaa=\hhh \let\fff=\gggA%
 \Put@Direct(0,0){\bondf}% bond between 8 and 7
}%
\else\if\member g\relax%
{\let\eee=\fff \let\fff=\gggA% 
 \Put@Direct(0,0){\bonde}% bond between 6 and 7
}%
\else\if\member h\relax%
{\let\ddd=\eee \let\eee=\fff%
 \Put@Direct(0,0){\bondd}% bond between 5 and 6
}%
\else\if\member i\relax%
{\let\ccc=\iii \let\ddd=\eee%
 \Put@Direct(0,0){\bondc}% bond between 5 and 4a
}%
\else\if\member j\relax%
{\let\eee=\iii%
 \Put@Direct(342,0){\bondd}% bond between 4 and 4a
}%
\else\if\member k\relax%
{\let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 8a and 4a
}%
\else\if\member K\relax%
{\let\eee=\iii\let\fff=\jjj%
 \Put@Direct(342,0){\bonde}% bond between 8a and 4a in the other ring
}%
\else\if\member A%left aromatic circle 
  \Put@oCircle(0,203){240}%               %circle
\else\if\member B%left aromatic circle 
  \Put@oCircle(342,203){240}%             %circle
\else
  \expandafter\twoCH@@R\member//%
  \def\aax{4a}\def\aay{8a}\def\aaz{10}%
      \if\@@tmpa 4\relax%                  % plus charge etc.
        \putratom{304}{282}{\@@tmpb}%      % right type
      \else\if\@@tmpa 3\relax%
        \putratom{402}{253}{\@@tmpb}%      % right type
      \else\if\@@tmpa 2\relax%
        \putratom{402}{120}{\@@tmpb}%      % right type
      \else\if\@@tmpa 1\relax%
        \putratom{304}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 7\relax%
        \putlatom{-60}{253}{\@@tmpb}%      % left type
      \else\if\@@tmpa 6\relax%
        \putlatom{-60}{120}{\@@tmpb}%      % left type
      \else\if\@@tmpa 5\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\if\@@tmpa 9\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aax\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aay\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aaz\relax% 1998/10/17 by S. Fujita
%      \else\if\@@tmpa 10\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \else\if\@@tmpa 8\relax%
        \putratom{-38}{68}{\@@tmpb}%       % right type
      \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
% ***********************
% * setting fused rings *
% ***********************
   \expandafter\twoCH@R\member//%
   \set@fusion@decavi
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms and spiro rings %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
\@tmpclipfalse
\Put@Direct(0,0){\set@hetatom@sixv{#3}{12}{3}{7}{-1}%
% \@gclipfalse \if@fclip \global\@gcliptrue \fi%
% \@fclipfalse \if@eclip \global\@fcliptrue \fi%      
% \@eclipfalse \if@clip \global\@ecliptrue \fi%
 \@gclipfalse \if@fclip \@gcliptrue \fi%%bug fix 2013/03/25
 \@fclipfalse \if@eclip \@fcliptrue \fi%%bug fix 2013/03/25      
 \@eclipfalse \if@clip \@ecliptrue \@clipfalse \fi%%bug fix 2013/03/25
\storeclipinfo
}%substituents on 6 to 8
\developclipinfo
\Put@Direct(0,0){\set@hetatom@sixv{#3}{-4}{0}{2}{0}%
% \@aclipfalse \if@aclip \global\@hcliptrue \fi%
% \@aclipfalse \if@aclip \@hcliptrue \fi%
 \@hclipfalse \if@aclip \@hcliptrue \@aclipfalse\fi%bug fix 2013/03/25
 \storeclipinfo
}%%substituent on 5
\developclipinfo
\Put@Direct(0,0){\set@vrtx@decafusevi{#3}%
  \@tmpclipfalse
%  \if@iclip \global\@tmpcliptrue \fi
%  \if@jclip \global\@icliptrue \fi
%  \if@tmpclip \global\@jcliptrue \fi
  \if@iclip \@tmpcliptrue \fi
  \if@jclip \@icliptrue \fi
  \if@tmpclip \@jcliptrue \fi
  \storeclipinfo
}% fused positions
\developclipinfo
%to be done after all
\Put@Direct(342,0){\set@hetatom@sixv{#3}{5}{0}{5}{-1}%
%   \if@aclip \global\@acliptrue\fi
%   \if@bclip \global\@bcliptrue\fi
%   \if@cclip \global\@ccliptrue\fi
%   \if@clip \global\@cliptrue\fi
\storeclipinfo
}% %substituents on 1 to 4
\developclipinfo
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents and exocyclic bonds %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\global\drawsamesubsttrue%2002/05/30 warning on
\Put@Direct(342,0){\setsixringv{#4}{5}{0}{5}{-1}}% %substituents on 1 to 4
\global\drawsamesubstfalse%2002/05/30 warning off
{\@clipfalse \if@eclip \@cliptrue \fi%      %substituents on 6 to 8
 \@eclipfalse \if@fclip \@ecliptrue \fi%
 \@fclipfalse \if@gclip \@fcliptrue \fi%
\Put@Direct(0,0){\setsixringv{#4}{12}{3}{7}{-1}}%
}%
{\@aclipfalse \if@hclip \@acliptrue \fi%    %substituent on 5
\Put@Direct(0,0){\setsixringv{#4}{-4}{0}{2}{0}}%
}%
{\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \Put@Direct(171,103){\setatombond{#4}{-9}{7}}%    %10 for 8a position
}%
{\@clipfusefalse \if@jclip \@clipfusetrue \fi%
  \Put@Direct(171,303){\setatombond{#4}{-8}{1}}%   %9 for 4a position
}%
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \decaheterovi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The macro |\test@vertix@decavi| is used to test the presence of 
% a hetero atom or a spiro substituent on a vertex of the 
% decaheterovi nucleus. 
%
% \begin{macro}{\if@tmpclip}
% \begin{macro}{\test@vertix@decavi}
%    \begin{macrocode}
\newif\if@tmpclip \@tmpclipfalse
\def\test@vertix@decavi#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa%
 \or%
   \if\@tmpb s\relax\def\ddd{}\else\def\ddd{@}\fi
 \or%2
   \if\@tmpb s\relax\def\ccc{}\else\def\ccc{@}\fi
 \or%3
   \if\@tmpb s\relax\def\bbb{}\else\def\bbb{@}\fi
 \or%
   \if\@tmpb a%
     \def\jjj{@}%4a
   \else\if\@tmpb s%
     \def\aaa{}%4
   \else\if\@tmpb h%
     \def\aaa{@}%4
   \else\ifx\@tmpb\empty%
     \def\aaa{@}%4
   \fi\fi\fi\fi%
 \or%5
   \if\@tmpb s\relax\def\hhh{}\else\def\hhh{@}\fi
 \or%6
   \if\@tmpb s\relax\def\gggA{}\else\def\gggA{@}\fi
 \or%7
   \if\@tmpb s\relax\def\fff{}\else\def\fff{@}\fi
 \or%
   \if\@tmpb a%
     \xdef\iii{@}%8a
   \else\if\@tmpb s%
     \xdef\eee{}%8s
   \else\if\@tmpb h%
     \xdef\eee{@}%8h
   \else\ifx\@tmpb\empty%
     \xdef\eee{@}%8
   \fi\fi\fi\fi%
\or%9 (= 4a)
   \if\@tmpb s\relax\def\jjj{}\else\def\jjj{@}\fi
\or%10 (= 8a)
   \if\@tmpb s\relax\def\iii{}\else\def\iii{@}\fi
\fi\fi}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% The macro |\set@vrtx@decafusevi| is used to set 
% a hetero atom or on a vertex of a bridgehead location.  
%
% \begin{macro}{\set@vrtx@decafusevi}
%    \begin{macrocode}
\def\set@vrtx@decafusevi#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa\or\or\or
 \or%%%%4
   \if\@tmpb a\relax%
%     \global\@icliptrue%
     \@icliptrue%2001/06/20 by S. Fujita
     \putlatom{207}{280}{\@memberb}% % left type
   \else\relax
   \fi
 \or\or\or
 \or%8
   \if\@tmpb a\relax%
%     \global\@jcliptrue%
     \@jcliptrue%%2001/06/20 by S. Fujita
     \putlatom{207}{65}{\@memberb}%  % left type
   \else\relax
   \fi
\or%9 (= 4a)
%     \global\@icliptrue%
     \@icliptrue%%2001/06/20 by S. Fujita
     \putlatom{207}{280}{\@memberb}% % left type
\or%10 (= 8a)
%     \global\@jcliptrue%
     \@jcliptrue%%2001/06/20 by S. Fujita
     \putlatom{207}{65}{\@memberb}%  % left type
\fi\fi}%
}% end of the macro \set@vrtx@decafusevi
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@fusion@decavi| is used to set 
% a fused ring or on an edge of the decaheterovi nucleus. 
%
% \begin{macro}{\set@fusion@decavi}
%    \begin{macrocode}
\def\set@fusion@decavi{%
  \let\@@tmpa=\@tmpa
  \let\@@tmpb=\@tmpb
  \if\@tmpa a%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa A%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa b%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa B%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa c%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa C%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa d%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `d'}%
      \fi
  \else\if\@tmpa D%
      \let\@@tmpa=\@tmpa
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `D'}%
      \fi
  \else\if\@tmpa e%
      \edef\@@tmpa{c}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `e'}%
      \fi
  \else\if\@tmpa E%
      \edef\@@tmpa{C}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `E'}%
      \fi
  \else\if\@tmpa f%
      \edef\@@tmpa{d}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa F%
      \edef\@@tmpa{D}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa g%
      \edef\@@tmpa{e}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa G%
      \edef\@@tmpa{E}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa h%
      \edef\@@tmpa{f}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa H%
      \edef\@@tmpa{F}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
  \else\if\@tmpa i%
      \edef\@@tmpa{a}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `i'}%
      \fi
  \else\if\@tmpa I%
      \edef\@@tmpa{A}%
      \Put@Direct(0,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `I'}%
      \fi
  \else\if\@tmpa j%
      \edef\@@tmpa{f}%
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `j'}%
      \fi
  \else\if\@tmpa J%
      \edef\@@tmpa{F}%
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Unfavorable Fusion for bond `J'}%
      \fi
  \else\if\@tmpa k%
      \edef\@@tmpa{e}%
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Forbidden Fusion for bond `k'}%
      \fi
  \else\if\@tmpa K%
      \edef\@@tmpa{E}%
      \Put@Direct(342,0){\set@fusionadd@sixvi}%
      \if@smallringsw\else
       \XyMTeXWarning{Forbidden Fusion for bond `K'}%
      \fi
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}% end of the macro \set@fusion@decavi
%    \end{macrocode}
% \end{macro}
%
% \subsection{Vertical-bottom type}
% The macro |\decaheterovb| is used for drawing six-six heterocyclic 
% derivatives of vertical-bottom type (numbering from the bottom 
% to the left-upper part). 
% The word ``vertical'' means that each benzene ring is a vertical type.  
% The word ``bottom'' means that the benzene ring with young locant numbers 
% is located at the bottom. 
% The skeleton and endocyclic double bonds are drawn directly, 
% while substituents and exocyclic bonds are placed by useing 
% the inner macro |\setsixringv|. 
%
% The standard skeleton of a six-to-six fused heterocycle is selected 
% to have the following locant numbers. 
%
% \changes{v1.02}{1998/10/16}{Newly added command}
% \changes{v2.01}{2001/06/20}{The \cs{storeclipinfo} command, etc.}
% 
% \begin{verbatim}
% ***************************
% * decahetro derivatives   *
% *  (vertical bottom type) *
% ***************************
% The following numbering is adopted in this macro. 
%
%          7 
%          *  
%     6  *   * 8
%       |     |
%       |     | 0G (4a)
%     5  *   * *
%  0F(4a)  *     * 1
%          |     |
%          |     |
%        4  *   *  2
%             *
%             3
%             ^
%             |
%            the original point
% \end{verbatim}
%
% The macro |\decaheterovb| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \decaheterovb(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `k' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to k, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' and `B' represent aromatic circles. The option 
% `$n+$' ($n=1$ to $10$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST:  list of bonds 
%
%           none or r  :  decahetero (right-handed)
%           l          :  decahetero (left-handed)
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  4,3-double bond      d    :  4,4a-double bond
%           e    :  4a,5-double bond     f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,8-double bond
%           i    :  8,8a-double bond     j    :  1,8a-double bond
%           k    :  4a,8a-double bond
%           K    :  4a,8a-double bond in the other ring
%           A    :  aromatic circle      B    :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 10)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 10 atoms)
%
%       for n = 1 to 8
%
%            n         : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
%            na        : Hetero atom at 4a or 8b (n=4 or 8)
%                        e.g. 4a==N (or 9==N) for N at 4a-position
%                             8a==N (or {{10}}==N) for N at 8a-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 9 (4a position) and 10 (8a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to k: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \decaheterovb{1==N}{1==Cl;2==F}
%        \decaheterovb[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \decaheterovb[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\decaheterovb| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| several times. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/25}{Spiro rings and fused rings}
%
% \begin{macro}{\decaheterovb}
% \begin{macro}{\@deca@heterovb}
% \begin{macro}{\@deca@@heterovb}
% \begin{macro}{\@decaheterovb}
%    \begin{macrocode}
\def\decaheterovb{\@ifnextchar({\@deca@heterovb(@}{\@deca@heterovb(@)}}
\def\@deca@heterovb(#1){\@ifnextchar[{\@deca@@heterovb(#1)[@}%
{\@deca@@heterovb(#1)[@]}}
\def\@deca@@heterovb(#1)[#2]#3#4{\@ifnextchar[%
{\@decaheterovb(#1)[#2]{#3}{#4}[@}%
{\@decaheterovb(#1)[#2]{#3}{#4}[@]}}
\def\@decaheterovb(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
\test@vertix@decavb{#3}%
% %%%%%%%%%%%%%%%%%%%%%%%
% % adjustment for (yl) %
% %%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
{\let\eee=\ddd\let\ddd=\ccc
\let\ccc=\bbb\let\bbb=\aaa
\ylhetpositionb{#4}{1}{1}{6}{0}% %substituents on 1 to 4
}%
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
\ylhetpositionb{#4}{0}{4}{7}{0}% %substituents on 5 to 6
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{171}\def\@@yli{-303}\fi
\else
{\let\aaa=\gggA \let\bbb=\hhh
\ylhetpositionb{#4}{-6}{0}{3}{0}% %substituents on 7 to 8
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{171}\def\@@yli{-303}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@iclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-8}{9}%   %9 %for 4a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{171}\def\@@yli{-303}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@jclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-9}{3}%  %10 for 8a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{-406}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1000,1200)(-550,-240){decaheterob}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
\begingroup
\resetbdsw%
\@bond@@omit{#5}%
{\let\eee=\ddd\let\ddd=\ccc
 \let\ccc=\bbb\let\bbb=\aaa
 \let\aaa=\jjj \let\fff=\iii
\set@skel@bond{#1}{j}{a}% bond between 8a and 1 \@jjj -> \skbonda etc
\set@skel@bond{#1}{a}{b}% bond between 1 and 2 \@aaa -> \skbondb etc
\set@skel@bond{#1}{b}{c}% bond between 2 and 3 \@bbb -> \skbondc etc
\set@skel@bond{#1}{c}{d}% bond between 3 and 4 \@ccc -> \skbondd etc
\set@skel@bond{#1}{d}{e}% bond between 4 and 4a \@ddd -> \skbonde etc
\set@skel@bond{#1}{k}{f}% bond between 4a and 8a \@kkk -> \skbondf etc
}%
{\let\aaa=\gggA\let\bbb=\hhh\let\ccc=\jjj\let\ddd=\iii
\Put@Direct(-171,303){\set@skel@bond{#1}{h}{a}}%
  % bond between 7 and 8 \@hhh -> \skbonda etc
\Put@Direct(-171,303){\set@skel@bond{#1}{i}{b}}%
  % bond between 8 and 8a \@iii -> \skbondb etc
\Put@Direct(-171,303){\set@skel@bond{#1}{e}{d}}%
  % bond between 4a and 5 \@eee -> \skbondd etc
\Put@Direct(-171,303){\set@skel@bond{#1}{f}{e}}%
  % bond between 5 and 6 \@fff -> \skbonde etc
\Put@Direct(-171,303){\set@skel@bond{#1}{g}{f}}%
  % bond between 6 and 7 \@ggg -> \skbondf etc
}%
\endgroup
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
{\let\aaa=\gggA\let\bbb=\hhh\let\ccc=\jjj\let\ddd=\iii
 \Put@Direct(-171,303){\bonda}% bond between 7 and 8
 \Put@Direct(-171,303){\bonde}% bond between 5 and 6
}%
{\let\eee=\ddd\let\ddd=\ccc
 \let\ccc=\bbb\let\bbb=\aaa
 \let\aaa=\jjj \let\fff=\iii
 \Put@Direct(0,0){\bondb}% bond between 1 and 2
 \Put@Direct(0,0){\bondd}% bond between 3 and 4
 \Put@Direct(0,0){\bondf}% bond between 4a and 4b
}%
\else\if\member l\relax%
\else\if\member a\relax%
{\let\ccc=\bbb\let\bbb=\aaa
 \Put@Direct(0,0){\bondb}% bond between 1 and 2
}%
\else\if\member b\relax
{\let\ddd=\ccc\let\ccc=\bbb
 \Put@Direct(0,0){\bondc}% bond between 2 and 3
}%
\else\if\member c\relax
{\let\eee=\ddd\let\ddd=\ccc
 \Put@Direct(0,0){\bondd}% bond between 3 and 4
}%
\else\if\member d\relax%
{\let\fff=\eee\let\eee=\ddd
 \Put@Direct(0,0){\bonde}% bond between 4 and 4a
}%
\else\if\member e\relax%
{\let\ddd=\iii%
 \Put@Direct(-171,303){\bondd}% bond between 5 and 4a
}%
\else\if\member f\relax%
 \Put@Direct(-171,303){\bonde}% bond between 5 and 6
\else\if\member g\relax%
{\let\aaa=\gggA
 \Put@Direct(-171,303){\bondf}% bond between 6 and 7
}%
\else\if\member h\relax%
{\let\aaa=\gggA \let\bbb=\hhh%
 \Put@Direct(-171,303){\bonda}% bond between 8 and 7
}%
\else\if\member i\relax%
{\let\bbb=\hhh \let\ccc=\jjj%
 \Put@Direct(-171,303){\bondb}% bond between 8 and 8a
}%
\else\if\member j\relax%
{\let\bbb=\aaa\let\aaa=\jjj%
 \Put@Direct(0,0){\bonda}% bond between 1 and 8a
}%
\else\if\member k\relax%
{\let\aaa=\jjj\let\fff=\iii%
 \Put@Direct(0,0){\bondf}% bond between 8a and 4a
}%
\else\if\member K\relax%
{\let\ccc=\jjj\let\ddd=\iii%
 \Put@Direct(-171,303){\bondc}% bond between 8a and 4a in the other ring
}%
\else\if\member A%left aromatic circle 
  \Put@oCircle(-171,506){240}%               %circle
\else\if\member B%left aromatic circle 
  \Put@oCircle(0,203){240}%             %circle
\else \expandafter\twoCH@@R\member//%
  \def\aax{8a}\def\aay{4a}\def\aaz{10}%
      \if\@@tmpa 1\relax%                  % plus charge etc.
        \putratom{60}{253}{\@@tmpb}%      % right type
      \else\if\@@tmpa 2\relax%
        \putratom{60}{120}{\@@tmpb}%      % right type
      \else\if\@@tmpa 3\relax%
        \putratom{-38}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 4\relax%
        \putratom{-120}{120}{\@@tmpb}%       % right type
      \else\if\@@tmpa 5\relax%
        \putlatom{-209}{431}{\@@tmpb}%      % left type
      \else\if\@@tmpa 6\relax%
        \putlatom{-209}{546}{\@@tmpb}%      % left type
      \else\if\@@tmpa 7\relax%
        \putratom{-209}{585}{\@@tmpb}%      % right type
      \else\if\@@tmpa 8\relax%
        \putratom{-111}{546}{\@@tmpb}%      % right type
      \else\if\@@tmpa 9\relax%
        \putlatom{-60}{253}{\@@tmpb}%      % left type
      \else\ifx\@@tmpa\aaz\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\ifx\@@tmpa\aax\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\ifx\@@tmpa\aay\relax%
        \putratom{-209}{371}{\@@tmpb}%       % right type
      \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
% ***********************
% * setting fused rings *
% ***********************
   \expandafter\twoCH@R\member//%
   \set@fusion@decavb
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
% \changes{v2.00a}{2000/11/11}{The 
% \cs{iniflag} command is added to 5- and 8-substitution.}
% \changes{v5.01}{2013/03/23}{bug fix subs 7 to 8.}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms %
% %%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom
\Put@Direct(-171,303){\set@hetatom@sixv{#3}{0}{4}{7}{0}%
%\if@eclip \global\@ecliptrue\fi%
%\if@fclip \global\@fcliptrue\fi%
\storeclipinfo
}% %substituents on 5 to 6
\developclipinfo
\Put@Direct(-171,303){\set@hetatom@sixv{#3}{-6}{0}{3}{0}%
% \@gclipfalse \if@aclip \global\@gcliptrue \fi%
% \@hclipfalse \if@bclip \global\@hcliptrue \fi%
 \@gclipfalse \if@aclip \@gcliptrue \fi%
% \@hclipfalse \if@bclip \@hcliptrue \fi%
 \@hclipfalse \if@bclip \@hcliptrue \@bclipfalse \fi%bugfix 2013/03/23
\storeclipinfo
}% %substituents on 7 to 8
\developclipinfo
\Put@Direct(0,0){\set@vrtx@decafusevb{#3}%
%  \if@iclip \global\@icliptrue \fi
%  \if@jclip \global\@jcliptrue \fi
\storeclipinfo
}%9 %for 4a position, %10 for 8a position
\developclipinfo
%to be done after all
\Put@Direct(0,0){\iniflag%2000/11/11 by S. Fujita
\set@hetatom@sixv{#3}{1}{1}{6}{0}%
%\@aclipfalse \if@bclip \global\@acliptrue \fi%
%\@bclipfalse \if@cclip \global\@bcliptrue \fi%
%\@cclipfalse \if@clip \global\@ccliptrue \fi%
%\@clipfalse \if@eclip \global\@cliptrue \fi%
\@aclipfalse \if@bclip \@acliptrue \fi%
\@bclipfalse \if@cclip \@bcliptrue \fi%
\@cclipfalse \if@clip \@ccliptrue \fi%
\@clipfalse \if@eclip \@cliptrue \fi%
\storeclipinfo
}% %substituents on 1 to 4
\developclipinfo
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents and exocyclic bonds %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\global\drawsamesubsttrue%2002/05/30 warning on
{%
\@eclipfalse \if@clip \@ecliptrue \fi%
\@clipfalse \if@cclip \@cliptrue \fi%
\@cclipfalse \if@bclip \@ccliptrue \fi%
\@bclipfalse \if@aclip \@bcliptrue \fi%
\Put@Direct(0,0){\setsixringv{#4}{1}{1}{6}{0}}% %substituents on 1 to 4
}%
\global\drawsamesubstfalse%2002/05/30 warning off
{%
\Put@Direct(-171,303){\setsixringv{#4}{0}{4}{7}{0}}% %substituents on 5 to 6
}%
{%
 \@aclipfalse \if@gclip \@acliptrue \fi%
 \@bclipfalse \if@hclip \@bcliptrue \fi%
\Put@Direct(-171,303){\setsixringv{#4}{-6}{0}{3}{0}}% %substituents on 7 to 8
}%
{\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \Put@Direct(-171,303){\setatombond{#4}{-8}{9}}%   %9 %for 4a position
}%
{\@clipfusefalse \if@jclip \@clipfusetrue \fi%
  \Put@Direct(0,406){\setatombond{#4}{-9}{3}}%  %10 for 8a position
}%
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \decaheterovb macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The command |\ylhetpositionb| is used in the |\decaheterovb| command, 
% giving the sift values for drawing a structure as a substituent. 
% \changes{v1.02}{1998/10/16}{Newly added command}
%
% \begin{macro}{\ylhetpositionb}
%    \begin{macrocode}
\def\ylhetpositionb#1#2#3#4#5{%
\@@ylswfalse%%%\@reset@ylsw
\@forsemicol\member:=#1\do{%
\if@@ylsw\else%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}\relax%
\ifx\@memberb\@yl\relax\@@ylswtrue\else\@@ylswfalse\fi
\if@@ylsw
\ifnum#5<0\relax%
\@tmpaa=-\@tmpa\relax \advance\@tmpaa by#2\relax%
\else\@tmpaa=\@tmpa\relax \advance\@tmpaa by#2\relax\fi
\ifnum\@tmpaa>#3\relax%
\ifnum\@tmpaa<#4\relax%
\ifcase\@tmpaa%0 omit
 \or
    \ifx\aaa\empty%
     \ifx\gggA\empty% aaa and ggg are absent
       \gdef\@ylii{0}\gdef\@yli{-406}\global\@ylswtrue%\@ylatrue% subst. on 1
     \else% ggg is present
       \gdef\@ylii{0}\gdef\@yli{-442}\global\@ylswtrue%\@ylatrue% subst. on 1
     \fi
    \else%aaa is present
      \gdef\@ylii{0}\gdef\@yli{-442}\global\@ylswtrue%\@ylatrue% subst. on 1
    \fi
 \or
    \ifx\bbb\empty
     \ifx\hhh\empty% aaa and hhh are absent
      \gdef\@ylii{-171}\gdef\@yli{-303}\global\@ylswtrue%\@ylbtrue% subst. on 2
     \else%hhh is present
      \gdef\@ylii{-213}\gdef\@yli{-327}\global\@ylswtrue%\@ylbtrue% subst. on 2
     \fi
    \else
      \gdef\@ylii{-213}\gdef\@yli{-327}\global\@ylswtrue%\@ylbtrue% subst. on 2
    \fi
 \or\ifx\ccc\empty
      \gdef\@ylii{-171}\gdef\@yli{-103}\global\@ylswtrue%\@ylctrue% subst. on 3
    \else
      \gdef\@ylii{-213}\gdef\@yli{-79}\global\@ylswtrue%\@ylctrue% subst. on 3
    \fi
 \or
   \ifx\ddd\empty
       \gdef\@ylii{0}\gdef\@yli{0}\global\@ylswtrue%\@yldtrue% subst. on 4
    \else% ddd present
      \gdef\@ylii{0}\gdef\@yli{36}\global\@ylswtrue%\@yldtrue% subst. on 4
    \fi
 \or
    \ifx\eee\empty
       \gdef\@ylii{173}\gdef\@yli{-103}\global\@ylswtrue%\@yletrue% subst. on 5
    \else% eee is present
       \gdef\@ylii{223}\gdef\@yli{-79}\global\@ylswtrue%\@yletrue% subst. on 5
   \fi
 \or
    \ifx\fff\empty
       \gdef\@ylii{173}\gdef\@yli{-303}\global\@ylswtrue%\@ylftrue% subst. on 6
    \else%fff is present
      \gdef\@ylii{213}\gdef\@yli{-327}\global\@ylswtrue%\@ylftrue% subst. on 6
    \fi
\fi%end of ifcase
\fi\fi\fi\fi\fi}}%
%    \end{macrocode}
% \end{macro}
%
% The macro |\test@vertix@decavb| determines the presence of 
% a hetro atom or a spriro ring at each of the vertices. 
% \changes{v2.00}{1998/12/25}{Added: spiro rings}
%
% \begin{macro}{\test@vertix@decavb}
%    \begin{macrocode}
\def\test@vertix@decavb#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa%
 \or% \xdef\aaa{\@memberb}%1
   \if\@tmpb s\relax\def\aaa{}\else\def\aaa{@}\fi
 \or% \xdef\bbb{\@memberb}%2
   \if\@tmpb s\relax\def\bbb{}\else\def\bbb{@}\fi
 \or% \xdef\ccc{\@memberb}%3
   \if\@tmpb s\relax\def\ccc{}\else\def\ccc{@}\fi
 \or%
   \if\@tmpb a%
     \def\iii{@}%4a
   \else\if\@tmpb s%
     \def\ddd{}%4
   \else\if\@tmpb h%
     \def\ddd{@}%4
   \else\ifx\@tmpb\empty%
     \def\ddd{@}%4
   \fi\fi\fi\fi%
 \or% \xdef\eee{\@memberb}%5
   \if\@tmpb s\relax\def\eee{}\else\def\eee{@}\fi
 \or% \xdef\fff{\@memberb}%6
   \if\@tmpb s\relax\def\fff{}\else\def\fff{@}\fi
 \or% \xdef\gggA{\@memberb}%7
   \if\@tmpb s\relax\def\gggA{}\else\def\gggA{@}\fi
 \or%
   \if\@tmpb a%
     \def\jjj{@}%8a
   \else\if\@tmpb s%
     \def\hhh{}%8
   \else\if\@tmpb h%
     \def\hhh{@}%4
   \else\ifx\@tmpb\empty%
     \def\hhh{@}%4
   \fi\fi\fi\fi%
\or% \xdef\iii{\@memberb}%9 (= 4a)
   \if\@tmpb s\relax\def\iii{}\else\def\iii{@}\fi
\or% \xdef\jjj{\@memberb}%10 (= 8a)
   \if\@tmpb s\relax\def\jjj{}\else\def\jjj{@}\fi
\fi\fi}%
}% end of the macro \test@vertix@decavb
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@vrtx@decafusevb| typesets a hetero atom 
% at each fused position. 
% \changes{v2.00}{1998/12/25}{Added: spiro rings}
% \changes{v2.01}{2001/06/20}{\cs{global} omitted}
%
% \begin{macro}{\set@vrtx@decafusevb}
%    \begin{macrocode}
\def\set@vrtx@decafusevb#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa\or\or\or
 \or%%%%4
   \if\@tmpb a\relax%
%     \global\@icliptrue%
     \@icliptrue%%2001/06/20 by S. Fujita
     \putlatom{-135}{280}{\@memberb}% % left type
   \else\relax
   \fi
 \or\or\or
 \or%8
   \if\@tmpb a\relax%
%     \global\@jcliptrue%
     \@jcliptrue%%2001/06/20 by S. Fujita
     \putratom{-31}{356}{\@memberb}%  % right type
   \else\relax
   \fi
\or%9 (= 4a)
%     \global\@icliptrue%
     \@icliptrue%%2001/06/20 by S. Fujita
     \putlatom{-135}{280}{\@memberb}% % left type
\or%10 (= 8a)
%     \global\@jcliptrue%
     \@jcliptrue%%2001/06/20 by S. Fujita
     \putratom{-31}{356}{\@memberb}%  % right type
\fi\fi}%
}% end of the macro \set@vrtx@decafusevb
%    \end{macrocode}
% \end{macro}
%
% \subsection{Vertical-top type}
%
% The macro |\decaheterovt| is used for drawing six-to-six fused derivatives 
% of vertical-bottom type (numbering from the top to the left-down part). 
% The word ``vertical'' means that each benzene ring is a vertical type.  
% The word ``top'' means that the benzene ring with young locant numbers 
% is located at the top. 
% The skeleton and endocyclic double bonds are drawn directly, 
% while substituents and exocyclic bonds are placed by useing 
% the inner macro |\setsixringv|. 
% \changes{v1.02}{1998/10/18}{Newly added command}
% \changes{v2.01}{2001/06/20}{The \cs{storeclipinfo} command, etc.}
% 
% \begin{verbatim}
% ****************************
% * decaheterovt derivatives *
% *  (vertical-top type)     *
% ****************************
% The following numbering is adopted in this macro. 
%
%                     2
%                     *  
%                1  *   * 3
%                  |     |
%                  |     | 
%         0G (8a)   *   * 4
%             8   *   * 0F(4a)
%                |     | 
%                |     |
%              7  *   *  5
%                   *
%                   6
%                   ^
%                   |
%                   the original point
% \end{verbatim}
%
% The macro |\decaheterovt| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \decaheterovt(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `k' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to k, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `A' and `B' represent aromatic circles. The option 
% `$n+$' ($n=1$ to $10$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST:  list of bonds 
%
%           none or r  :  decahetero (right-handed)
%           l          :  decahetero (left-handed)
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  4,3-double bond      d    :  4,4a-double bond
%           e    :  4a,5-double bond     f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,8-double bond
%           i    :  8,8a-double bond     j    :  1,8a-double bond
%           k    :  4a,8a-double bond
%           K    :  4a,8a-double bond in the other ring
%           A    :  aromatic circle      B    :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 10)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 10 atoms)
%
%       for n = 1 to 8
%
%            n         : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
%            na        : Hetero atom at 4a or 8b (n=4 or 8)
%                        e.g. 4a==N (or 9==N) for N at 4a-position
%                             8a==N (or {{10}}==N) for N at 8a-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 9 (4a position) and 10 (8a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to k: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \decaheterovt{1==N}{1==Cl;2==F}
%        \decaheterovt[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \decaheterovt[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\decaheterovt| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| several times. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/10/31}{Add: Spiro and fused rings}
% \changes{v5.01}{2013/03/23}{Bug fix: omit vacant at 1 position}
%
% \begin{macro}{\decaheterovt}
% \begin{macro}{\@deca@heterovt}
% \begin{macro}{\@deca@@heterovt}
% \begin{macro}{\@decaheterovt}
%    \begin{macrocode}
\def\decaheterovt{\@ifnextchar({\@deca@heterovt(@}{\@deca@heterovt(@)}}
\def\@deca@heterovt(#1){\@ifnextchar[{\@deca@@heterovt(#1)[@}%
{\@deca@@heterovt(#1)[@]}}
\def\@deca@@heterovt(#1)[#2]#3#4{\@ifnextchar[%
{\@decaheterovt(#1)[#2]{#3}{#4}[@}%
{\@decaheterovt(#1)[#2]{#3}{#4}[@]}}
\def\@decaheterovt(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
\test@vertix@decavb{#3}%
% %%%%%%%%%%%%%%%%%%%%%%%
% % adjustment for (yl) %
% %%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
{\let\fff=\aaa
\ylhetpositiont{#4}{5}{5}{7}{0}% %substituent on 1
}%
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-303}\fi
\else
{\let\aaa=\bbb\let\bbb=\ccc\let\ccc=\ddd
\ylhetpositiont{#4}{-1}{0}{4}{0}% %substituents on 2 to 4
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-303}\fi
\else
{\let\ccc=\eee\let\ddd=\fff
\let\eee=\gggA\let\fff=\hhh
\ylhetpositiont{#4}{-2}{2}{7}{0}% %substituents on 5 to 8
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@iclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-8}{5}%   %9 %for 4a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-303}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@jclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-9}{11}%  %10 for 8a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{-406}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1200,880)(-\shiftii,-\shifti){decaheterovt}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
\begingroup
\resetbdsw%
\@bond@@omit{#5}%
{%
 \let\fff=\aaa \let\aaa=\bbb \let\bbb=\ccc
 \let\ccc=\ddd \let\ddd=\iii \let\eee=\jjj
\Put@Direct(171,303){\set@skel@bond{#1}{b}{a}}%
  % bond between 2 and 3 \@bbb -> \skbonda etc
\Put@Direct(171,303){\set@skel@bond{#1}{c}{b}}%
  % bond between 3 and 4 \@ccc -> \skbondb etc
\Put@Direct(171,303){\set@skel@bond{#1}{d}{c}}%
  % bond between 4 and 4a \@ddd -> \skbondc etc
\Put@Direct(171,303){\set@skel@bond{#1}{k}{d}}%
  % bond between 4a and 8a \@kkk -> \skbondd etc
\Put@Direct(171,303){\set@skel@bond{#1}{j}{e}}%
  % bond between 8a and 1 \@jjj -> \skbonde etc
\Put@Direct(171,303){\set@skel@bond{#1}{a}{f}}%
  % bond between 1 and 2 \@aaa -> \skbondf etc
}%
{%
 \let\aaa=\jjj\let\bbb=\iii
 \let\ccc=\eee\let\ddd=\fff
 \let\eee=\gggA\let\fff=\hhh
\set@skel@bond{#1}{e}{b}% bond between 4a and 5 \@eee -> \skbondb etc
\set@skel@bond{#1}{f}{c}% bond between 5 and 6 \@fff -> \skbondc etc
\set@skel@bond{#1}{g}{d}% bond between 6 and 7 \@ggg -> \skbondd etc
\set@skel@bond{#1}{h}{e}% bond between 7 and 8 \@hhh -> \skbonde etc
\set@skel@bond{#1}{i}{f}% bond between 8 and 8a \@iii -> \skbondf etc
}%
\endgroup
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
{%
 \let\ccc=\eee\let\ddd=\fff\let\eee=\gggA\let\fff=\gggA
 \Put@Direct(0,0){\bondc}% bond between 7 and 8
 \Put@Direct(0,0){\bonde}% bond between 5 and 6
}%
{%
 \let\fff=\aaa\let\aaa=\bbb
 \let\bbb=\ccc\let\ccc=\ddd
 \let\ddd=\iii\let\eee=\jjj
 \Put@Direct(171,303){\bondf}% bond between 1 and 2
 \Put@Direct(171,303){\bondb}% bond between 3 and 4
 \Put@Direct(171,303){\bondd}% bond between 4a and 8a
}%
\else\if\member l\relax%
\else\if\member a\relax%
{\let\fff=\aaa\let\aaa=\bbb
 \Put@Direct(171,303){\bondf}% bond between 1 and 2
}%
\else\if\member b\relax
{\let\aaa=\bbb\let\bbb=\ccc
 \Put@Direct(171,303){\bonda}% bond between 2 and 3
}%
\else\if\member c\relax
{\let\bbb=\ccc\let\ccc=\ddd
 \Put@Direct(171,303){\bondb}% bond between 3 and 4
}%
\else\if\member d\relax%
{\let\ccc=\ddd\let\ddd=\eee
 \Put@Direct(171,303){\bondc}% bond between 4 and 4a
}%
\else\if\member e\relax%
{\let\ccc=\eee\let\bbb=\iii%
 \Put@Direct(0,0){\bondb}% bond between 5 and 4a
}%
\else\if\member f\relax%
{\let\ccc=\eee\let\ddd=\fff
 \Put@Direct(0,0){\bondc}% bond between 5 and 6
}%
\else\if\member g\relax%
{\let\ddd=\fff\let\eee=\gggA
 \Put@Direct(0,0){\bondd}% bond between 6 and 7
}%
\else\if\member h\relax%
{\let\eee=\gggA \let\fff=\hhh%
 \Put@Direct(0,0){\bonde}% bond between 8 and 7
}%
\else\if\member i\relax%
{\let\aaa=\jjj \let\fff=\hhh%
 \Put@Direct(0,0){\bondf}% bond between 8 and 8a
}%
\else\if\member j\relax%
{\let\fff=\aaa\let\eee=\jjj%
 \Put@Direct(171,303){\bonde}% bond between 1 and 8a
}%
\else\if\member k\relax%
{\let\aaa=\jjj\let\bbb=\iii%
 \Put@Direct(0,0){\bonda}% bond between 8a and 4a
}%
\else\if\member K\relax%
{\let\eee=\jjj\let\ddd=\iii%
 \Put@Direct(171,303){\bondd}% bond between 8a and 4a in the other ring
}%
\else\if\member A%left aromatic circle 
  \Put@oCircle(171,506){240}%               %circle
\else\if\member B%left aromatic circle 
  \Put@oCircle(0,203){240}%             %circle
\else
  \expandafter\twoCH@@R\member//%
  \def\aax{8a}\def\aay{4a}\def\aaz{10}%
      \if\@@tmpa 1\relax%                  % plus charge etc.
        \putlatom{111}{546}{\@@tmpb}%      % left type
      \else\if\@@tmpa 2\relax%
        \putlatom{209}{585}{\@@tmpb}%      % left type
      \else\if\@@tmpa 3\relax%
        \putratom{209}{546}{\@@tmpb}%      % right type
      \else\if\@@tmpa 4\relax%
        \putratom{209}{431}{\@@tmpb}%      % right type
      \else\if\@@tmpa 5\relax%
        \putratom{60}{120}{\@@tmpb}%      % right type
      \else\if\@@tmpa 6\relax%
        \putratom{-38}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 7\relax%
        \putratom{-120}{120}{\@@tmpb}%       % right type
      \else\if\@@tmpa 8\relax%
        \putlatom{-60}{253}{\@@tmpb}%      % left type
      \else\if\@@tmpa 9\relax%
        \putratom{60}{253}{\@@tmpb}%      % right type
      \else\ifx\@@tmpa\aaz\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\ifx\@@tmpa\aax\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\ifx\@@tmpa\aay\relax%
        \putratom{60}{253}{\@@tmpb}%      % right type
      \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
% ***********************
% * setting fused rings *
% ***********************
  \expandafter\twoCH@R\member//%
   \set@fusion@decavt
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms %
% %%%%%%%%%%%%%%%%%%%%%%%%
\iniflag
\Put@Direct(0,0){\set@hetatom@sixv{#3}{-2}{2}{7}{0}%
% \@hclipfalse \if@fclip \global\@hcliptrue \fi%
% \@gclipfalse \if@eclip \global\@gcliptrue \fi%
% \@fclipfalse \if@clip \global\@fcliptrue \fi%
% \@eclipfalse \if@cclip \global\@ecliptrue \fi%
 \@hclipfalse \if@fclip \@hcliptrue \fi%
 \@gclipfalse \if@eclip \@gcliptrue \fi%
 \@fclipfalse \if@clip \@fcliptrue \fi%
 \@eclipfalse \if@cclip \@ecliptrue \fi%
\storeclipinfo
}% %substituents on 5 to 8
\developclipinfo
\Put@Direct(0,0){\set@vrtx@decafusevt{#3}%
%  \if@iclip \global\@icliptrue \fi
%  \if@jclip \global\@jcliptrue \fi
\storeclipinfo
}%9 %for 4a position, %10 for 8a position
\developclipinfo
%to be done after all (exept aclip)
\Put@Direct(171,303){\set@hetatom@sixv{#3}{-1}{0}{4}{0}%
%\@clipfalse \if@cclip \global\@cliptrue \fi%
%\@cclipfalse \if@bclip \global\@ccliptrue \fi%
%\@bclipfalse \if@aclip \global\@bcliptrue \fi%
\@clipfalse \if@cclip \@cliptrue \fi%
\@cclipfalse \if@bclip \@ccliptrue \fi%
%\@bclipfalse \if@aclip \@bcliptrue \fi%bug fix 2013/03/23
\@bclipfalse \if@aclip \@bcliptrue \@aclipfalse \fi%
\storeclipinfo
}% %substituents on 2 to 4
\developclipinfo
{%
\@fclipfalse%locally cancelled 1999/2/15 by Shinsaku Fujita
\Put@Direct(171,303){\set@hetatom@sixv{#3}{5}{5}{7}{0}%
%\@aclipfalse \if@fclip \global\@acliptrue \fi%
\@aclipfalse \if@fclip \@acliptrue \fi%
\storeclipinfo
}% %substituent on 1
\developclipinfo
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents and exocyclic bonds %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\global\drawsamesubsttrue%2002/05/30 warning on
{%
\@fclipfalse \if@aclip \@fcliptrue \fi%
\Put@Direct(171,303){\setsixringv{#4}{5}{5}{7}{0}}% %substituent on 1
}%
\global\drawsamesubstfalse%2002/05/30 warning off
{%
\@aclipfalse \if@bclip \@acliptrue \fi%
\@bclipfalse \if@cclip \@bcliptrue \fi%
\@cclipfalse \if@clip \@ccliptrue \fi%
\Put@Direct(171,303){\setsixringv{#4}{-1}{0}{4}{0}}% %substituents on 2 to 4
}%
{%
 \@cclipfalse \if@eclip \@ccliptrue \fi%
 \@clipfalse \if@fclip \@cliptrue \fi%
 \@eclipfalse \if@gclip \@ecliptrue \fi%
 \@fclipfalse \if@hclip \@fcliptrue \fi%
\Put@Direct(0,0){\setsixringv{#4}{-2}{2}{7}{0}}% %substituents on 5 to 8
}%
{\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \Put@Direct(171,303){\setatombond{#4}{-8}{5}}%   %9 %for 4a position
}%
{\@clipfusefalse \if@jclip \@clipfusetrue \fi%
  \Put@Direct(0,406){\setatombond{#4}{-9}{11}}%  %10 for 8a position
}%
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \decaheterovt macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The command |\ylhetpositiont| is used in the |\decaheterovt| command, 
% giving the sift values for drawing a structure as a substituent. 
% \changes{v1.02}{1998/10/18}{Newly added command}
%
% \begin{macro}{\ylhetpositiont}
%    \begin{macrocode}
\def\ylhetpositiont#1#2#3#4#5{%
\@@ylswfalse%%%\@reset@ylsw
\@forsemicol\member:=#1\do{%
\if@@ylsw\else%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}\relax%
\ifx\@memberb\@yl\relax\@@ylswtrue\else\@@ylswfalse\fi
\if@@ylsw
\ifnum#5<0\relax%
\@tmpaa=-\@tmpa\relax \advance\@tmpaa by#2\relax%
\else\@tmpaa=\@tmpa\relax \advance\@tmpaa by#2\relax\fi
\ifnum\@tmpaa>#3\relax%
\ifnum\@tmpaa<#4\relax%
\ifcase\@tmpaa%0 omit
 \or
    \ifx\aaa\empty%
     \ifx\bbb\empty% aaa and bbb are absent
       \gdef\@ylii{0}\gdef\@yli{-406}\global\@ylswtrue%\@ylatrue% subst. on 1
     \else% bbb is present
       \gdef\@ylii{0}\gdef\@yli{-442}\global\@ylswtrue%\@ylatrue% subst. on 1
     \fi
    \else%aaa is present
      \gdef\@ylii{0}\gdef\@yli{-442}\global\@ylswtrue%\@ylatrue% subst. on 1
    \fi
 \or
    \ifx\bbb\empty
     \ifx\ccc\empty% aaa and ccc are absent
      \gdef\@ylii{-171}\gdef\@yli{-303}\global\@ylswtrue%\@ylbtrue% subst. on 2
     \else%ccc is present
      \gdef\@ylii{-213}\gdef\@yli{-327}\global\@ylswtrue%\@ylbtrue% subst. on 2
     \fi
    \else
      \gdef\@ylii{-213}\gdef\@yli{-327}\global\@ylswtrue%\@ylbtrue% subst. on 2
    \fi
 \or
    \ifx\ccc\empty
     \ifx\ddd\empty
      \ifx\eee\empty% ccc, ddd, eee are absent
       \gdef\@ylii{-171}\gdef\@yli{-103}\global\@ylswtrue%\@ylctrue%subst. on 3
      \else%eee is present 
       \gdef\@ylii{-213}\gdef\@yli{-79}\global\@ylswtrue%\@ylctrue% subst. on 3
      \fi
     \else%ddd is present
      \gdef\@ylii{-213}\gdef\@yli{-79}\global\@ylswtrue%\@ylctrue% subst. on 3
     \fi
    \else%ccc is present
      \gdef\@ylii{-213}\gdef\@yli{-79}\global\@ylswtrue%\@ylctrue% subst. on 3
    \fi
 \or
   \ifx\ddd\empty
     \ifx\fff\empty%ddd and fff are absent
       \gdef\@ylii{0}\gdef\@yli{0}\global\@ylswtrue%\@yldtrue% subst. on 4
     \else%fff present
      \gdef\@ylii{0}\gdef\@yli{36}\global\@ylswtrue%\@yldtrue% subst. on 4
     \fi
    \else% ddd present
      \gdef\@ylii{0}\gdef\@yli{36}\global\@ylswtrue%\@yldtrue% subst. on 4
    \fi
 \or
    \ifx\eee\empty
     \ifx\gggA\empty%eee and ggg are absent
       \gdef\@ylii{173}\gdef\@yli{-103}\global\@ylswtrue%\@yletrue% subst. on 5
     \else% ggg is present
       \gdef\@ylii{223}\gdef\@yli{-79}\global\@ylswtrue%\@yletrue% subst. on 5
     \fi
    \else% eee is present
       \gdef\@ylii{223}\gdef\@yli{-79}\global\@ylswtrue%\@yletrue% subst. on 5
    \fi
 \or
    \ifx\fff\empty
     \ifx\hhh\empty%fff and hhh are absent
       \gdef\@ylii{173}\gdef\@yli{-303}\global\@ylswtrue%\@ylftrue% subst. on 6
     \else%hhh is present
      \gdef\@ylii{213}\gdef\@yli{-327}\global\@ylswtrue%\@ylftrue% subst. on 6
     \fi
    \else%fff is present
      \gdef\@ylii{213}\gdef\@yli{-327}\global\@ylswtrue%\@ylftrue% subst. on 6
    \fi
\fi%end of ifcase
\fi\fi\fi\fi\fi}}%
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@vrtx@decafusevt| is used to typeset a hetero 
% atom at each fused vertex (4a or 8a) of a decaheterovt ring. 
%
% \begin{macro}{\set@vrtx@decafusevt}
%    \begin{macrocode}
\def\set@vrtx@decafusevt#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa\or\or\or
 \or%%%%4
   \if\@tmpb a\relax%
%     \global\@icliptrue%
     \global\@icliptrue%%2001/06/20 by S. Fujita
     \putratom{135}{280}{\@memberb}% % right type
   \else\relax
   \fi
 \or\or\or
 \or%8
   \if\@tmpb a\relax%
%     \global\@jcliptrue%
     \@jcliptrue%%2001/06/20 by S. Fujita
     \putlatom{31}{356}{\@memberb}%  % left type
   \else\relax
   \fi
\or%9 (= 4a)
%     \global\@icliptrue%
     \@icliptrue%%2001/06/20 by S. Fujita
     \putratom{135}{280}{\@memberb}% % right type
\or%10 (= 8a)
%     \global\@jcliptrue%
     \@jcliptrue%%2001/06/20 by S. Fujita
     \putlatom{31}{356}{\@memberb}%  % left type
\fi\fi}%
}% end of the macro \set@vrtx@decafusevt
%    \end{macrocode}
% \end{macro}
%
% \subsection{Short-cut commands for fused heterocycles}
%
% The macros |\decaheterov|, |\decaheterovb|, and 
% |\decaheterovt| can be used in the form of a fixed |ATOMLIST|.  
% Hence, the resulting commands for drawing a fused heterocyle 
% with one or more nitrogen atoms have an argument |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
% ****************************************************
% * heterocycles having two fused six-membered rings *
% *  (vertical type)                                 *
% ****************************************************
%
%   \quinolinev[BONDLIST]{SUBSLIST}
%   \quinolinevi[BONDLIST]{SUBSLIST}
%   \quinolinevb[BONDLIST]{SUBSLIST}
%   \quinolinevt[BONDLIST]{SUBSLIST}
%
%   \isoquinolinev[BONDLIST]{SUBSLIST}
%   \isoquinolinevi[BONDLIST]{SUBSLIST}
%   \isoquinolinevb[BONDLIST]{SUBSLIST}
%   \isoquinolinevt[BONDLIST]{SUBSLIST}
%
%   \quinoxalinev[BONDLIST]{SUBSLIST}
%   \quinoxalinevi[BONDLIST]{SUBSLIST}
%   \quinoxalinevb[BONDLIST]{SUBSLIST}
%   \quinoxalinevt[BONDLIST]{SUBSLIST}
%
%   \quinazolinev[BONDLIST]{SUBSLIST}
%   \quinazolinevi[BONDLIST]{SUBSLIST}
%   \quinazolinevb[BONDLIST]{SUBSLIST}
%   \quinazolinevt[BONDLIST]{SUBSLIST}
%
%   \cinnolinev[BONDLIST]{SUBSLIST}
%   \cinnolinevi[BONDLIST]{SUBSLIST}
%   \cinnolinevb[BONDLIST]{SUBSLIST}
%   \cinnolinevt[BONDLIST]{SUBSLIST}
%
%   \pteridinev[BONDLIST]{SUBSLIST}
%   \pteridinevi[BONDLIST]{SUBSLIST}
%   \pteridinevb[BONDLIST]{SUBSLIST}
%   \pteridinevt[BONDLIST]{SUBSLIST}
% \end{verbatim}
%
% The |BONDLIST| argument contains one character selected 
% from a to k (K), each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The optiona `A' and `B' typeset aromatic circles. 
% The option 
% `$n+$' ($n=1$ to $10$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST:  list of bonds 
%
%           none or r  :  decahetero (right-handed)
%           l          :  decahetero (left-handed)
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  4,3-double bond      d    :  4,4a-double bond
%           e    :  4a,5-double bond     f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,8-double bond
%           i    :  8,8a-double bond     j    :  1,8a-double bond
%           k    :  4a,8a-double bond
%           K    :  4a,8a-double bond in the other ring
%           A    :  aromatic circle      B    :  aromatic circle
%           {n+}     :  plus at the n-nitrogen atom (n = 1 to 10)
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 9 (4a position) and 10 (8a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \quinolinev{3==Cl;2==F}
%        \quinolinev{3==Cl;4==F;2==CH$_{3}$}
% \end{verbatim}
%
% \begin{macro}{\quinolinev}
% \begin{macro}{\quinolinevi}
% \begin{macro}{\quinolinevb}
% \begin{macro}{\quinolinevt}
% \changes{v1.02}{1998/10/18}{Newly added commands: 
% \cs{quinolinevb} and \cs{quinolinevt}}
%    \begin{macrocode}
\def\quinolinev{%
 \@ifnextchar[{\@quinolinev[@}{\@quinolinev[acfhk]}}
\def\@quinolinev[#1]#2{%
\iforigpt \typeout{command `quinolinev' %
  is based on `decaheterov'.}\fi%
\decaheterov[#1]{1==N}{#2}}
\def\quinolinevi{%
 \@ifnextchar[{\@quinolinevi[@}{\@quinolinevi[acfhk]}}
\def\@quinolinevi[#1]#2{%
\iforigpt \typeout{command `quinolinevi' %
 is based on `decaheterovi'.}\fi%
\decaheterovi[#1]{1==N}{#2}}
\def\quinolinevb{%
 \@ifnextchar[{\@quinolinevb[@}{\@quinolinevb[acfhk]}}
\def\@quinolinevb[#1]#2{%
\iforigpt \typeout{command `quinolinevb' %
 is based on `decaheterovb'.}\fi%
\decaheterovb[#1]{1==N}{#2}}
\def\quinolinevt{%
 \@ifnextchar[{\@quinolinevt[@}{\@quinolinevt[acfhk]}}
\def\@quinolinevt[#1]#2{%
\iforigpt \typeout{command `quinolinevt' %
 is based on `decaheterovt'.}\fi%
\decaheterovt[#1]{1==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\isoquinolinev}
% \begin{macro}{\isoquinolinevi}
% \begin{macro}{\isoquinolinevb}
% \begin{macro}{\isoquinolinevt}
% \changes{v1.02}{1998/10/18}{Newly added commands: 
% \cs{isoquinolinevb} and \cs{isoquinolinevt}}
%    \begin{macrocode}
\def\isoquinolinev{%
 \@ifnextchar[{\@isoquinolinev[@}{\@isoquinolinev[acfhk]}}
\def\@isoquinolinev[#1]#2{%
\iforigpt \typeout{command `isoquinolinev' %
 is based on `decaheterov'.}\fi%
\decaheterov[#1]{2==N}{#2}}
\def\isoquinolinevi{%
 \@ifnextchar[{\@isoquinolinevi[@}{\@isoquinolinevi[acfhk]}}
\def\@isoquinolinevi[#1]#2{%
\iforigpt \typeout{command `isoquinolinevi' %
 is based on `decaheterovi'.}\fi%
\decaheterovi[#1]{2==N}{#2}}%
\def\isoquinolinevb{%
 \@ifnextchar[{\@isoquinolinevb[@}{\@isoquinolinevb[acfhk]}}
\def\@isoquinolinevb[#1]#2{%
\iforigpt \typeout{command `isoquinolinevb' %
 is based on `decaheterovi'.}\fi%
\decaheterovb[#1]{2==N}{#2}}%
\def\isoquinolinevt{%
 \@ifnextchar[{\@isoquinolinevt[@}{\@isoquinolinevt[acfhk]}}
\def\@isoquinolinevt[#1]#2{%
\iforigpt \typeout{command `isoquinolinevt' %
 is based on `decaheterovt'.}\fi%
\decaheterovt[#1]{2==N}{#2}}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\quinoxalinev}
% \begin{macro}{\quinoxalinevi}
% \begin{macro}{\quinoxalinevb}
% \begin{macro}{\quinoxalinevt}
% \changes{v1.02}{1998/10/18}{Newly added commands: 
% \cs{quinoxalinevb} and \cs{quinoxalinevt}}
%    \begin{macrocode}
\def\quinoxalinev{%
 \@ifnextchar[{\@quinoxalinev[@}{\@quinoxalinev[acfhk]}}
\def\@quinoxalinev[#1]#2{%
\iforigpt \typeout{command `quinoxalinev' %
 is based on `decaheterov'.}\fi%
\decaheterov[#1]{1==N;4==N}{#2}}
\def\quinoxalinevi{%
 \@ifnextchar[{\@quinoxalinevi[@}{\@quinoxalinevi[acfhk]}}
\def\@quinoxalinevi[#1]#2{%but v--->vi 2013/03/22
\iforigpt \typeout{command `quinoxalinevi' %
 is based on `decaheterovi'.}\fi%
\decaheterovi[#1]{1==N;4==N}{#2}}
\def\quinoxalinevb{%
 \@ifnextchar[{\@quinoxalinevb[@}{\@quinoxalinevb[acfhk]}}
\def\@quinoxalinevb[#1]#2{%
\iforigpt \typeout{command `quinoxalinevb' %
 is based on `decaheterovb'.}\fi%
\decaheterovb[#1]{1==N;4==N}{#2}}
\def\quinoxalinevt{%
 \@ifnextchar[{\@quinoxalinevt[@}{\@quinoxalinevt[acfhk]}}
\def\@quinoxalinevt[#1]#2{%
\iforigpt \typeout{command `quinoxalinevt' %
 is based on `decaheterovt'.}\fi%
\decaheterovt[#1]{1==N;4==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\quinazolinev}
% \begin{macro}{\quinazolinevi}
% \begin{macro}{\quinazolinevb}
% \begin{macro}{\quinazolinevt}
% \changes{v1.02}{1998/10/18}{Newly added commands: 
% \cs{quinazolinevb} and \cs{quinazolinevt}}
%    \begin{macrocode}
\def\quinazolinev{%
 \@ifnextchar[{\@quinazolinev[@}{\@quinazolinev[acfhk]}}
\def\@quinazolinev[#1]#2{%
\iforigpt \typeout{command `quinazolinev' %
 is based on `decaheterov'.}\fi%
\decaheterov[#1]{1==N;3==N}{#2}}
\def\quinazolinevi{%
 \@ifnextchar[{\@quinazolinevi[@}{\@quinazolinevi[acfhk]}}
\def\@quinazolinevi[#1]#2{%
\iforigpt \typeout{command `quinazolinevi' %
 is based on `decaheterovi'.}\fi%
\decaheterovi[#1]{1==N;3==N}{#2}}
\def\quinazolinevb{%
 \@ifnextchar[{\@quinazolinevb[@}{\@quinazolinevb[acfhk]}}
\def\@quinazolinevb[#1]#2{%
\iforigpt \typeout{command `quinazolinevb' %
 is based on `decaheterovb'.}\fi%
\decaheterovb[#1]{1==N;3==N}{#2}}
\def\quinazolinevt{%
 \@ifnextchar[{\@quinazolinevt[@}{\@quinazolinevt[acfhk]}}
\def\@quinazolinevt[#1]#2{%
\iforigpt \typeout{command `quinazolinevt' %
 is based on `decaheterovt'.}\fi%
\decaheterovt[#1]{1==N;3==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\cinnolinev}
% \begin{macro}{\cinnolinevi}
% \begin{macro}{\cinnolinevb}
% \begin{macro}{\cinnolinevt}
% \changes{v1.02}{1998/10/18}{Newly added commands: 
% \cs{cinnolinevb} and \cs{cinnolinevt}}
%    \begin{macrocode}
\def\cinnolinev{%
 \@ifnextchar[{\@cinnolinev[@}{\@cinnolinev[acfhk]}}
\def\@cinnolinev[#1]#2{%
\iforigpt \typeout{command `cinnolinev' %
 is based on `decaheterov'.}\fi%
\decaheterov[#1]{1==N;2==N}{#2}}
\def\cinnolinevi{%
 \@ifnextchar[{\@cinnolinevi[@}{\@cinnolinevi[acfhk]}}
\def\@cinnolinevi[#1]#2{%
\iforigpt \typeout{command `cinnolinevi' %
 is based on `decaheterovi'.}\fi%
\decaheterovi[#1]{1==N;2==N}{#2}}
\def\cinnolinevb{%
 \@ifnextchar[{\@cinnolinevb[@}{\@cinnolinevb[acfhk]}}
\def\@cinnolinevb[#1]#2{%
\iforigpt \typeout{command `cinnolinevb' %
 is based on `decaheterovb'.}\fi%
\decaheterovb[#1]{1==N;2==N}{#2}}
\def\cinnolinevt{%
 \@ifnextchar[{\@cinnolinevt[@}{\@cinnolinevt[acfhk]}}
\def\@cinnolinevt[#1]#2{%
\iforigpt \typeout{command `cinnolinevt' %
 is based on `decaheterovt'.}\fi%
\decaheterovt[#1]{1==N;2==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\pteridinev}
% \begin{macro}{\pteridinevi}
% \begin{macro}{\pteridinevb}
% \begin{macro}{\pteridinevt}
% \changes{v1.02}{1998/10/18}{Newly added commands: 
% \cs{pteridinevb} and \cs{pteridinevt}}
%    \begin{macrocode}
\def\pteridinev{\@ifnextchar[{\@pteridinev[@}{\@pteridinev[acfhk]}}
\def\@pteridinev[#1]#2{%
\iforigpt \typeout{command `pteridinev' %
 is based on `decaheterov'.}\fi%
\decaheterov[#1]{1==N;3==N;5==N;8==N}{#2}}
\def\pteridinevi{\@ifnextchar[{\@pteridinevi[@}{\@pteridinevi[acfhk]}}
\def\@pteridinevi[#1]#2{%
\iforigpt \typeout{command `pteridinevi' %
 is based on `decaheterovi'.}\fi%
\decaheterovi[#1]{1==N;3==N;5==N;8==N}{#2}}
\def\pteridinevb{\@ifnextchar[{\@pteridinevb[@}{\@pteridinevb[acfhk]}}
\def\@pteridinevb[#1]#2{%
\iforigpt \typeout{command `pteridinevb' %
 is based on `decaheterovb'.}\fi%
\decaheterovb[#1]{1==N;3==N;5==N;8==N}{#2}}
\def\pteridinevt{\@ifnextchar[{\@pteridinevt[@}{\@pteridinevt[acfhk]}}
\def\@pteridinevt[#1]#2{%
\iforigpt \typeout{command `pteridinevt' %
 is based on `decaheterovt'.}\fi%
\decaheterovt[#1]{1==N;3==N;5==N;8==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Six-to-five fused heterocycles}
% \subsection{Vertical type}
%
% The standard skeleton of a six-to-five fused heterocycle is selected 
% to have the following locant numbers. 
%
% \begin{verbatim}
% **************************
% * nonahetero derivatives *
% *  (vertical type)       *
% **************************
% The following numbering is adopted in this macro. 
%
%          4
%          *  3a(8) 
%     5  *   * _____  3
%       |     |     |
%       |     |     |
%     6  *   * *   *  2
%          *  7a *
%          7 (9) 1
%          ^
%          |
%          the original point
% \end{verbatim}
%
% The macro |\nonaheterov| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \nonaheterov(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `j' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to j, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The options `A' and `B' represent aromatic circles in two rings. 
% The option `$n+$' ($n=1$ to $9$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}  
%     BONDLIST:  list of bonds 
%
%           none or r  :  aromatic six-membered ring
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  3,3a-double bond     d    :  4,3a-double bond
%           e    :  4,5-double bond      f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,7a-double bond
%           i    :  1,7a-double bond     
%           j    :  3a,4a-double bond
%           J    :  3a,4a-double bond in the other ring
%           A    :  aromatic circle (six-membered ring)
%           B    :  aromatic circle (five-membered ring)
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 9)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 9 atoms)
%
%       for n = 1 to 7
%
%            n         : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
%            na        : Hetero atom at 3a or 7b (n=3 or 7)
%                        e.g. 3a==N (or 8==N) for N at 4a-position
%                             7a==N (or 9==N) for N at 8a-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 8 (3a position) and 9 (7a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to j: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \nonaheterov{1==N}{1==Cl;2==F}
%        \nonaheterov[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
% \end{verbatim}
%
% The definition of |\nonaheterov| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| several times in 
% a restricted fashion. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/5}{Add: fused and spiro rings}
% \changes{v2.01}{2001/6/20}{The
% \cs{storeclipinfo} command is added.}
%
% \begin{macro}{\nonaheterov}
% \begin{macro}{\@nona@heterov}
% \begin{macro}{\@nona@@heterov}
% \begin{macro}{\@nonaheterov}
%    \begin{macrocode}
\def\nonaheterov{\@ifnextchar({\@nona@heterov(@}{\@nona@heterov(@)}}
\def\@nona@heterov(#1){\@ifnextchar[{\@nona@@heterov(#1)[@}%
{\@nona@@heterov(#1)[@]}}
\def\@nona@@heterov(#1)[#2]#3#4{\@ifnextchar[%
{\@nonaheterov(#1)[#2]{#3}{#4}[@}%
{\@nonaheterov(#1)[#2]{#3}{#4}[@]}}
\def\@nonaheterov(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
\test@vertix@nonav{#3}%
% %%%%%%%%%%%%%%%%%%%%%%%
% % adjustment for (yl) %
% %%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{5}{1}{5}{-1}% %substituents on 1 to 3
\if@ylsw \ifx\@@ylii\empty\relax
\def\@@ylii{-342}\def\@@yli{0}\fi
\else
{\let\ddd=\eee\let\eee=\fff\let\fff=\gggA
\ylposition{#4}{11}{3}{7}{-1}% %substituents on 5 to 7
}%
\fi
\if@ylsw \ifx\@@ylii\empty\relax
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{\let\aaa=\hhh
\ylposition{#4}{-3}{0}{2}{0}%%substituent on 4
}%
\fi
\if@ylsw \ifx\@@ylii\empty\relax
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@iclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-8}{7}%   %9 %for 7a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty\relax
\def\@@ylii{-171}\def\@@yli{-103}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@jclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-7}{1}%   %8 for 3a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty\relax
\def\@@ylii{-171}\def\@@yli{-303}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1200,880)(-\shiftii,-\shifti){nonaheterov}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
\begingroup
\resetbdsw%
\@bond@@omit{#5}%
{\let\fff=\jjj \let\eee=\iii%
\Put@Direct(342,0){\set@skel@bond{#1}{a}{c}}%
  % bond between 1 and 2 \@aaa -> \skbondc etc
\Put@Direct(342,0){\set@skel@bond{#1}{b}{b}}%
  % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(342,0){\set@skel@longbond{#1}{c}{skbondhoriz}}%
  % bond between 3 and 3a \@ccc -> \skbondhoriz etc
\Put@Direct(342,0){\set@skel@bond{#1}{j}{e}}%
  % bond between 3a and 7a \@jjj -> \skbonde etc
\Put@Direct(342,0){\set@skel@bond{#1}{i}{d}}%
  % bond between 7a and 1 \@iii -> \skbondd etc
}%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA%
 \let\ccc=\iii\let\bbb=\jjj%
\set@skel@bond{#1}{d}{a}% bond between 3a and 4 \@ddd -> \skbonda etc
\set@skel@bond{#1}{h}{c}% bond between 7 and 7a \@hhh -> \skbondc etc
\set@skel@bond{#1}{g}{d}% bond between 6 and 7 \@ggg -> \skbondd etc
\set@skel@bond{#1}{f}{e}% bond between 5 and 6 \@fff -> \skbonde etc
\set@skel@bond{#1}{e}{f}% bond between 4 and 5 \@eee -> \skbondf etc
}%
\endgroup
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA%
 \let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 3a and 7a
 \Put@Direct(0,0){\bondf}% bond between 4 and 5
 \Put@Direct(0,0){\bondd}% bond between 6 and 7
}%
\else\if\member l\relax%
\else\if\member a\relax%
 \Put@Direct(342,0){\bondc}% bond between 3 and 4
\else\if\member b\relax%
 \Put@Direct(342,0){\bondb}% bond between 2 and 3
\else\if\member c\relax%
 \Put@Direct(342,0){\bondhoriz}% bond between 3 and 3a
\else\if\member d\relax%
{\let\aaa=\hhh \let\bbb=\jjj%
 \Put@Direct(0,0){\bonda}% bond between 4 and 3a
}%
\else\if\member e\relax%
{\let\aaa=\hhh \let\fff=\gggA%
 \Put@Direct(0,0){\bondf}% bond between 4 and 5
}%
\else\if\member f\relax%
{\let\eee=\fff \let\fff=\gggA%
 \Put@Direct(0,0){\bonde}% bond between 5 and 6
}%
\else\if\member g\relax%
{\let\ddd=\eee \let\eee=\fff%
 \Put@Direct(0,0){\bondd}% bond between 6 and 7
}%
\else\if\member h\relax%
{\let\ccc=\iii \let\ddd=\eee%
 \Put@Direct(0,0){\bondc}% bond between 7 and 7a
}%
\else\if\member i\relax%
{\let\eee=\iii%
 \Put@Direct(342,0){\bondd}% bond between 1 and 7a
}%
\else\if\member j\relax%
{\let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 7a and 3a
}%
\else\if\member J\relax%
{\let\eee=\iii\let\fff=\jjj%
 \Put@Direct(342,0){\bonde}% bond between 7a and 3a
}%
\else\if\member A\relax%left aromatic circle 
  \Put@oCircle(0,203){240}%               %circle
\else\if\member B\relax%left aromatic circle 
  \Put@oCircle(342,173){180}%               %circle 1993/11/20 S.Fujita
\else 
 \expandafter\twoCH@@R\member//%
  \def\aax{7a}\def\aay{3a}%
      \if\@@tmpa 1\relax%
        \putratom{304}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 2\relax%
        \putratom{402}{120}{\@@tmpb}%      % right type
      \else\if\@@tmpa 3\relax%
        \putratom{402}{253}{\@@tmpb}%      % right type
      \else\if\@@tmpa 4\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\if\@@tmpa 5\relax%
        \putlatom{-60}{120}{\@@tmpb}%      % left type
      \else\if\@@tmpa 6\relax%
        \putlatom{-60}{253}{\@@tmpb}%      % left type
      \else\if\@@tmpa 7\relax%
        \putratom{-38}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 8\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aax\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aay\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \else\if\@@tmpa 9\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
% ***********************
% * setting fused rings *
% ***********************
   \expandafter\twoCH@R\member//%
   \set@fusion@nonav
\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms and spiro rings %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%
\@tmpclipfalse
%position 7 should be treated before 
%position 1 (using the same \if@clip)
\Put@Direct(0,0){\set@hetatom@sixv{#3}{11}{3}{7}{-1}%
% \@gclipfalse \if@fclip \global\@gcliptrue \fi%
% \@fclipfalse \if@eclip \global\@fcliptrue \fi%
% \@eclipfalse \if@clip \global\@ecliptrue \fi%
 \@gclipfalse \if@fclip \@gcliptrue \fi%
 \@fclipfalse \if@eclip \@fcliptrue \fi%
 \@eclipfalse \if@clip \@ecliptrue \fi%
 \@clipfalse%2006/9/5added
\storeclipinfo
}%substituents on 5 to 7
%\developclipinfo%2006/9/5 deleted
\Put@Direct(342,0){\set@hetatom@sixv{#3}{5}{1}{5}{-1}%
%   \if@bclip \global\@bcliptrue\fi
%   \if@cclip \global\@ccliptrue\fi
%   \if@clip \global\@cliptrue\fi
\storeclipinfo
}% %substituents on 1 to 3
%\developclipinfo%2006/9/5 deleted
\Put@Direct(0,0){\set@hetatom@sixv{#3}{-3}{0}{2}{0}%
% \@aclipfalse \if@aclip \global\@hcliptrue \fi%
 \@hclipfalse \if@aclip \@hcliptrue \fi%
\storeclipinfo
}%%substituent on 4
%\developclipinfo%2006/9/5 deleted
\Put@Direct(0,0){\set@vrtx@nonafusev{#3}%
  \@tmpclipfalse
%  \if@iclip \global\@tmpcliptrue \fi
%  \if@jclip \global\@icliptrue \fi
%  \if@tmpclip \global\@jcliptrue \fi
  \if@iclip \@tmpcliptrue \fi
%  \if@jclip \@icliptrue \fi
%  \if@tmpclip \@jcliptrue \fi
  \if@jclip \@icliptrue \else \@iclipfalse \fi
  \if@tmpclip \@jcliptrue \else \@jclipfalse \fi
\storeclipinfo
%%%====\clipinfo====%%%2006/9/5test
}% fused positions
\developclipinfo
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents and exocyclic bonds %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(342,0){\setsixringv{#4}{5}{1}{5}{-1}}% %substituents on 1 to 3
{\@clipfalse \if@eclip \@cliptrue \fi%      %substituents on 5 to 7
 \@eclipfalse \if@fclip \@ecliptrue \fi%
 \@fclipfalse \if@gclip \@fcliptrue \fi%
\Put@Direct(0,0){\setsixringv{#4}{11}{3}{7}{-1}}%
}%
{\@aclipfalse \if@hclip \@acliptrue \fi%    %substituent on 4
\Put@Direct(0,0){\setsixringv{#4}{-3}{0}{2}{0}}%
}%
{\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \Put@Direct(171,103){\setatombond{#4}{-8}{7}}%    %9 for 7a position
}%
{\@clipfusefalse \if@jclip \@clipfusetrue \fi%
  \Put@Direct(171,303){\setatombond{#4}{-7}{1}}%   %8 for 3a position
}%
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \nonaheterov macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The macro |\test@vertix@nonav| is used to test the presence of 
% a hetero atom or a spiro substituent on a vertex of the 
% nonaheterov nucleus. 
% \changes{v2.00}{1998/12/05}{New command: \cs{test@vertix@nonav}}
%
% \begin{macro}{\test@vertix@nonav}
%    \begin{macrocode}
\def\test@vertix@nonav#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa%
 \or%
   \if\@tmpb s\relax\def\ddd{}\else\def\ddd{@}\fi
 \or%2
   \if\@tmpb s\relax\def\ccc{}\else\def\ccc{@}\fi
 \or%3%
   \if\@tmpb a\relax%
     \def\jjj{@}%3a
   \else\if\@tmpb s\relax%
     \def\bbb{}%3
   \else\if\@tmpb h\relax%
     \def\bbb{@}%3
   \else\ifx\@tmpb\empty\relax%
     \def\bbb{@}%3
   \fi\fi\fi\fi%
 \or%4
   \if\@tmpb s\relax\def\hhh{}\else\def\hhh{@}\fi
 \or%5
   \if\@tmpb s\relax\def\gggA{}\else\def\gggA{@}\fi
 \or%6
   \if\@tmpb s\relax\def\fff{}\else\def\fff{@}\fi
 \or%7
   \if\@tmpb a%
     \xdef\iii{@}%7a
   \else\if\@tmpb s\relax%
     \xdef\eee{}%7s
   \else\if\@tmpb h\relax%
     \xdef\eee{@}%7h
   \else\ifx\@tmpb\empty\relax%
     \xdef\eee{@}%7
   \fi\fi\fi\fi%
\or%8 (= 3a)
   \if\@tmpb s\relax\def\jjj{}\else\def\jjj{@}\fi
\or%9 (= 7a)
   \if\@tmpb s\relax\def\iii{}\else\def\iii{@}\fi
\fi\fi}}% end of \test@vertix@nonav
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@vrtx@nonafusev| is used to set 
% a hetero atom or on a vertex of a bridgehead location.  
%
% \begin{macro}{\set@vrtx@nonafusev}
%    \begin{macrocode}
\def\set@vrtx@nonafusev#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty \relax\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa\or\or
 \or%%%%3
   \if\@tmpb a\relax%
%     \global\@icliptrue%
     \@icliptrue%20001/06/20 by S. Fujita
     \putlatom{207}{280}{\@memberb}% % left type
   \else\relax
   \fi
 \or\or\or
 \or%7
   \if\@tmpb a\relax%
%     \global\@jcliptrue%
     \@jcliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{65}{\@memberb}%  % left type
   \else\relax
   \fi
\or%8 (= 3a)
%     \global\@icliptrue%
     \@icliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{280}{\@memberb}% % left type
\or%9 (= 7a)
%     \global\@jcliptrue%
     \@jcliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{65}{\@memberb}%  % left type
\fi\fi}%
}% end of the macro \set@vrtx@nonafusev
%    \end{macrocode}
% \end{macro}
%
% \subsection{Inverse vertical type}
%
% The standard skeleton of a six-to-five fused heterocycle is selected 
% to have the following locant numbers. 
%
% \begin{verbatim}
% **********************************
% * nonahetero derivatives         *
% *  (vertical type, inverse type) *
% **********************************
% The following numbering is adopted in this macro. 
%
%          7(10) 1
%          * 7a  *
%     6  *   * *   *  2
%       |     |     |
%       |     |_____|
%     5  *   *        3
%          *  3a(8) 
%          4 
%          ^
%          |
%          the original point
% \end{verbatim}
%
% The macro |\nonaheterovi| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \nonaheterovi(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `j' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to j, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The options `A' and `B' represent aromatic circles in two rings. 
% The option `$n+$' ($n=1$ to $9$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST:  list of bonds 
%
%           none or r  :  aromatic six-membered ring
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  3,3a-double bond     d    :  4,3a-double bond
%           e    :  4,5-double bond      f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,7a-double bond
%           i    :  1,7a-double bond     
%           j    :  3a,4a-double bond
%           J    :  3a,4a-double bond in the other ring
%           A    :  aromatic circle (six-membered ring)
%           B    :  aromatic circle (five-membered ring)
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 9)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 9 atoms)
%
%       for n = 1 to 7
%
%            n         : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
%            na        : Hetero atom at 3a or 7b (n=3 or 7)
%                        e.g. 3a==N (or 8==N) for N at 4a-position
%                             7a==N (or 9==N) for N at 8a-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 8 (3a position) and 9 (7a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to j: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \nonaheterovi{1==N}{1==Cl;2==F}
%        \nonaheterovi[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
% \end{verbatim}
%
% The definition of |\nonaheterovi| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| several times in 
% a restricted fashion. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/05}{Added: spiro and fused rings}
% \changes{v2.01}{2001/6/20}{The
% \cs{storeclipinfo} command is added.}
%
% \begin{macro}{\nonaheterovi}
% \begin{macro}{\@nona@heterovi}
% \begin{macro}{\@nona@@heterovi}
% \begin{macro}{\@nonaheterovi}
%    \begin{macrocode}
\def\nonaheterovi{\@ifnextchar({\@nona@heterovi(@}{\@nona@heterovi(@)}}
\def\@nona@heterovi(#1){\@ifnextchar[{\@nona@@heterovi(#1)[@}%
{\@nona@@heterovi(#1)[@]}}
\def\@nona@@heterovi(#1)[#2]#3#4{\@ifnextchar[%
{\@nonaheterovi(#1)[#2]{#3}{#4}[@}%
{\@nonaheterovi(#1)[#2]{#3}{#4}[@]}}
\def\@nonaheterovi(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag\iniatom%initialize
\test@vertix@nonavi{#3}%
% %%%%%%%%%%%%%%%%%%%%%%%
% % adjustment for (yl) %
% %%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{0}{0}{4}{0}% %substituents on 1 to 3
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-342}\def\@@yli{0}\fi
\else
{\let\ddd=\eee\let\eee=\fff\let\fff=\gggA
\ylposition{#4}{0}{3}{7}{0}%%substituents on 4 to 6
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{\let\aaa=\hhh
\ylposition{#4}{-6}{0}{2}{0}%%substituent on 7
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@iclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-7}{7}%   %8 for 3a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-103}\fi
\else
{%
\clipdetection%
\@clipfusefalse \if@jclip \@clipfusetrue \fi%
\ylatombondposition{#4}{-8}{1}%  %9 for 7a position
}%
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-171}\def\@@yli{-303}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1200,880)(-\shiftii,-\shifti){nonaheterovi}%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
\begingroup
\resetbdsw%
\@bond@@omit{#5}%
{\let\fff=\jjj \let\eee=\iii%
\Put@Direct(342,0){\set@skel@bond{#1}{a}{a}}%
  % bond between 1 and 2 \@aaa -> \skbonda etc
\Put@Direct(342,0){\set@skel@bond{#1}{b}{b}}%
  % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(342,0){\set@skel@longbond{#1}{c}{skbondhorizi}}%
  % bond between 3 and 3a \@ccc -> \skbondhoriz etc
\Put@Direct(342,0){\set@skel@bond{#1}{j}{e}}%
  % bond between 3a and 7a \@jjj -> \skbonde etc
\Put@Direct(342,0){\set@skel@bond{#1}{i}{f}}%
  % bond between 7a and 1 \@iii -> \skbondf etc
}%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA%
 \let\ccc=\iii\let\bbb=\jjj%
\set@skel@bond{#1}{h}{a}% bond between 7a and 7 \@hhh -> \skbonda etc
\set@skel@bond{#1}{d}{c}% bond between 3a and 4 \@ddd -> \skbondc etc
\set@skel@bond{#1}{e}{d}% bond between 4 and 5 \@eee -> \skbondd etc
\set@skel@bond{#1}{f}{e}% bond between 5 and 6 \@fff -> \skbonde etc
\set@skel@bond{#1}{g}{f}% bond between 6 and 7 \@ggg -> \skbondf etc
}%
\endgroup
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
{\let\aaa=\hhh \let\ddd=\eee\let\eee=\fff\let\fff=\gggA
 \let\ccc=\iii\let\bbb=\jjj
 \Put@Direct(0,0){\bondb}% bond between 3a and 7a
 \Put@Direct(0,0){\bondf}% bond between 6 and 7
 \Put@Direct(0,0){\bondd}% bond between 4 and 5
}%
\else\if\member l\relax%
\else\if\member a\relax%
 \Put@Direct(342,0){\bonda}% bond between 1 and 2
\else\if\member b\relax%
 \Put@Direct(342,0){\bondb}% bond between 2 and 3
\else\if\member c\relax%
 \Put@Direct(342,0){\bondhorizi}% bond between 3 and 3a
\else\if\member d\relax%
{\let\ccc=\iii \let\ddd=\eee%
 \Put@Direct(0,0){\bondc}% bond between 4 and 3a
}%
\else\if\member e\relax%
{\let\ddd=\eee\let\eee=\fff%
 \Put@Direct(0,0){\bondd}% bond between 4 and 5
}%
\else\if\member f\relax%
{\let\eee=\fff \let\fff=\gggA%
 \Put@Direct(0,0){\bonde}% bond between 5 and 6
}%
\else\if\member g\relax%
{\let\aaa=\hhh \let\fff=\gggA%
 \Put@Direct(0,0){\bondf}% bond between 7 and 6
}%
\else\if\member h\relax%
{\let\aaa=\hhh \let\bbb=\jjj%
 \Put@Direct(0,0){\bonda}% bond between 7 and 7a
}%
\else\if\member i\relax%
{\let\fff=\jjj%
 \Put@Direct(342,0){\bondf}% bond between 1 and 7a
}%
\else\if\member j\relax%
{\let\ccc=\iii\let\bbb=\jjj%
 \Put@Direct(0,0){\bondb}% bond between 7a and 3a
}%
\else\if\member J\relax%
{\let\eee=\iii\let\fff=\jjj%
 \Put@Direct(342,0){\bonde}% bond between 7a and 3a
}%
\else\if\member A\relax%left aromatic circle 
  \Put@oCircle(0,203){240}%               %circle
\else\if\member B\relax%left aromatic circle 
  \Put@oCircle(342,233){180}%               %circle 1993/11/20 S.Fujita
\else 
 \expandafter\twoCH@@R\member//%
  \def\aax{7a}\def\aay{3a}%
      \if\@@tmpa 1\relax%
        \putratom{304}{282}{\@@tmpb}%       % right type
      \else\if\@@tmpa 3\relax%
        \putratom{402}{120}{\@@tmpb}%      % right type
      \else\if\@@tmpa 2\relax%
        \putratom{402}{253}{\@@tmpb}%      % right type
      \else\if\@@tmpa 7\relax%
        \putratom{-38}{282}{\@@tmpb}%      % right type
      \else\if\@@tmpa 6\relax%
        \putlatom{-60}{120}{\@@tmpb}%      % left type
      \else\if\@@tmpa 5\relax%
        \putlatom{-60}{253}{\@@tmpb}%      % left type
      \else\if\@@tmpa 4\relax%
        \putratom{-38}{68}{\@@tmpb}%       % right type
      \else\if\@@tmpa 9\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aax\relax%
        \putratom{60}{253}{\@@tmpb}%       % right type
      \else\ifx\@@tmpa\aay\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \else\if\@@tmpa 8\relax%
        \putratom{60}{120}{\@@tmpb}%       % right type
      \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
% ***********************
% * setting fused rings *
% ***********************
   \expandafter\twoCH@R\member//%
   \set@fusion@nonavi
\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms and spiro rings %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iniflag
\Put@Direct(342,0){\set@hetatom@sixv{#3}{0}{0}{4}{0}%
%   \if@aclip \global\@acliptrue\fi
%   \if@bclip \global\@bcliptrue\fi
%   \if@cclip \global\@ccliptrue\fi
  \@xclipfalse \if@aclip \@xcliptrue \@aclipfalse\fi%avoid conflict position 7 2013/03/24
\storeclipinfo
}% %substituents on 1 to 3
\developclipinfo
\Put@Direct(0,0){\set@hetatom@sixv{#3}{0}{3}{7}{0}%
   \@gclipfalse \if@fclip \@gcliptrue \fi%
   \@fclipfalse \if@eclip \@fcliptrue \fi%
   \@eclipfalse \if@clip \@ecliptrue \fi
\storeclipinfo
}%substituents on 4 to 6
\developclipinfo
\Put@Direct(0,0){\set@hetatom@sixv{#3}{-6}{0}{2}{0}%
  \@hclipfalse \if@aclip \@hcliptrue \fi
\storeclipinfo
}%%substituent on 7
\developclipinfo
\Put@Direct(0,0){\set@vrtx@nonafusevi{#3}%
\storeclipinfo
}% fused positions
\developclipinfo
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents and exocyclic bonds %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{%
\@aclipfalse \if@xclip \@acliptrue \fi%   %avoid conflict 2013/3/24
\Put@Direct(342,0){\setsixringv{#4}{0}{0}{4}{0}}% %substituents on 1 to 3
}%
{\@clipfalse \if@eclip \@cliptrue \fi%     %substituents on 4 to 6
 \@eclipfalse \if@fclip \@ecliptrue \fi%
 \@fclipfalse \if@gclip \@fcliptrue \fi%
\Put@Direct(0,0){\setsixringv{#4}{0}{3}{7}{0}}%
}%
{\@aclipfalse \if@hclip \@acliptrue \fi%   %substituent on 7
\Put@Direct(0,0){\setsixringv{#4}{-6}{0}{2}{0}}%
}%
{\@clipfusefalse \if@iclip \@clipfusetrue \fi%
 \Put@Direct(171,103){\setatombond{#4}{-7}{7}}%   %8 for 3a position
}%
{\@clipfusefalse \if@jclip \@clipfusetrue \fi%
  \Put@Direct(171,303){\setatombond{#4}{-8}{1}}%  %9 for 7a position
}%
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \nonaheterovi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The macro |\test@vertix@nonavi| is used to test the presence of 
% a hetero atom or a spiro substituent on a vertex of the 
% nonaheterovi nucleus. 
% \changes{v2.00}{1998/12/05}{New command: \cs{test@vertix@nonavi}}
%
% \begin{macro}{\test@vertix@nonavi}
%    \begin{macrocode}
\def\test@vertix@nonavi#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa%
 \or%
   \if\@tmpb s\relax\def\aaa{}\else\def\aaa{@}\fi
 \or%2
   \if\@tmpb s\relax\def\bbb{}\else\def\bbb{@}\fi
 \or%3%
   \if\@tmpb a\relax%
     \def\iii{@}%3a
   \else\if\@tmpb s\relax%
     \def\ccc{}%3
   \else\if\@tmpb h\relax%
     \def\ccc{@}%3
   \else\ifx\@tmpb\empty\relax%
     \def\ccc{@}%3
   \fi\fi\fi\fi%
 \or%4
   \if\@tmpb s\relax\def\eee{}\else\def\eee{@}\fi
 \or%5
   \if\@tmpb s\relax\def\fff{}\else\def\fff{@}\fi
 \or%6
   \if\@tmpb s\relax\def\gggA{}\else\def\gggA{@}\fi
 \or%7
   \if\@tmpb a%
     \xdef\jjj{@}%7a
   \else\if\@tmpb s\relax%
     \xdef\hhh{}%7s
   \else\if\@tmpb h\relax%
     \xdef\hhh{@}%7h
   \else\ifx\@tmpb\empty\relax%
     \xdef\hhh{@}%7
   \fi\fi\fi\fi%
\or%8 (= 3a)
   \if\@tmpb s\relax\def\iii{}\else\def\iii{@}\fi
\or%9 (= 7a)
   \if\@tmpb s\relax\def\jjj{}\else\def\jjj{@}\fi
\fi\fi}}
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@vrtx@nonafusevi| is used to set 
% a hetero atom on a vertex of a bridgehead location.  
% \changes{v2.00}{1998/12/05}{New command: \cs{set@vrtx@nonafusevi}}
%
% \begin{macro}{\set@vrtx@nonafusevi}
%    \begin{macrocode}
\def\set@vrtx@nonafusevi#1{%
\@forsemicol\member:=#1\do{%
\ifx\member\empty\else%
\expandafter\@m@mb@r\member;\relax%
\expandafter\twoch@r\@membera{}%
\ifcase\@tmpa\or\or
 \or%%%%3
   \if\@tmpb a\relax%
%     \global\@icliptrue%
     \@icliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{65}{\@memberb}%  % left type
   \else\relax
   \fi
 \or\or\or
 \or%7
   \if\@tmpb a\relax%
%     \global\@jcliptrue%
     \@jcliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{280}{\@memberb}% % left type
   \else\relax
   \fi
\or%8 (= 3a)
%     \global\@icliptrue%
     \@icliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{65}{\@memberb}%  % left type
\or%9 (= 7a)
%     \global\@jcliptrue%
     \@jcliptrue%%20001/06/20 by S. Fujita
     \putlatom{207}{280}{\@memberb}% % left type
\fi\fi}%
}% end of the macro \set@vrtx@nonafusevi
%    \end{macrocode}
% \end{macro}
%
% \subsection{Short-cut commands for fused heterocycles}
%
% The macros |\nonaheterov| and |\nonaheterovi| can be used in the 
% form of a fixed |ATOMLIST|.  Hence, the resulting commands for 
% drawing a fused heterocyle with one or more nitrogen atoms 
% have an argument |SUBSLIST| as well as an optional argument |BONDLIST|. 
%
% \begin{verbatim}
% **********************************************************
% * heterocycles having fused six- and five-membered rings *
% *  (vertical type)                                       *
% **********************************************************
%
%   N-heterocycles:
%
%   \indolev[BONDLIST]{SUBSLIST}
%   \indolevi[BONDLIST]{SUBSLIST}
%
%   \isoindolev[BONDLIST]{SUBSLIST}
%   \isoindolevi[BONDLIST]{SUBSLIST}
%
%   \indolizinev[BONDLIST]{SUBSLIST}
%   \indolizinevi[BONDLIST]{SUBSLIST}
%          (different from the IUPAC numbering)
%
%   \purinev[BONDLIST]{SUBSLIST}
%   \purinevi[BONDLIST]{SUBSLIST}
%          (different from the IUPAC numbering)
%
%   O-heterocycles:
%
%   \benzofuranev[BONDLIST]{SUBSLIST}
%   \benzofuranevi[BONDLIST]{SUBSLIST}
%
%   \isobenzofuranevi[BONDLIST]{SUBSLIST}
%
%   \benzoxazolev[BONDLIST]{SUBSLIST}
%   \benzoxazolevi[BONDLIST]{SUBSLIST}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to j, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The optiona `A' and `B' typeset aromatic circles. 
% The option 
% `$n+$' ($n=1$ to $9$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}  
%     BONDLIST:  list of bonds 
%
%           none or r  :  aromatic six-membered ring
%           []         :  fully saturated form
%           a    :  1,2-double bond      b    :  2,3-double bond
%           c    :  3,3a-double bond     d    :  4,3a-double bond
%           e    :  4,5-double bond      f    :  5,6-double bond
%           g    :  6,7-double bond      h    :  7,7a-double bond
%           i    :  1,7a-double bond     
%           J    :  3a,4a-double bond in the other ring
%           A    :  aromatic circle
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 9)
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 8
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
%
%       for 8 (3a position) and 9 (7a position)
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%
%       e.g. 
%        
%        \indolev{1==N}{1==Cl;2==F}
%        \indolev[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
% \end{verbatim}
%
% \begin{macro}{\purinev}
% \begin{macro}{\purinevi}
%    \begin{macrocode}
\def\purinev{\@ifnextchar[{\@purinev[@}{\@purinev[ra]}}
\def\@purinev[#1]#2{%
\iforigpt \typeout{command `purinev' %
  is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{1==N;3==N;5==N;7==N}{#2}}
\def\purinevi{\@ifnextchar[{\@purinevi[@}{\@purinevi[ra]}}
\def\@purinevi[#1]#2{%
\iforigpt \typeout{command `purinevi' %
  is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{1==N;3==N;5==N;7==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\indolev}
% \begin{macro}{\indolevi}
%    \begin{macrocode}
\def\indolev{\@ifnextchar[{\@indolev[@}{\@indolev[rb]}}
\def\@indolev[#1]#2{%
\iforigpt \typeout{command `indolev' %
 is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{1==N}{#2}}
\def\indolevi{\@ifnextchar[{\@indolevi[@}{\@indolevi[rb]}}
\def\@indolevi[#1]#2{%
\iforigpt \typeout{command `indolevi' %
 is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{1==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\indolizinev}
% \begin{macro}{\indolizinevi}
%    \begin{macrocode}
\def\indolizinev{%
  \@ifnextchar[{\@indolizinev[@}{\@indolizinev[aceg]}}
\def\@indolizinev[#1]#2{%
\iforigpt \typeout{command `indolizinev' %
  is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{7a==N}{#2}}
\def\indolizinevi{%
  \@ifnextchar[{\@indolizinevi[@}{\@indolizinevi[aceg]}}
\def\@indolizinevi[#1]#2{%
\iforigpt \typeout{command `indolizinevi' %
  is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{7a==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\isoindolev}
% \begin{macro}{\isoindolevi}
%    \begin{macrocode}
\def\isoindolev{\@ifnextchar[{\@isoindolev[@}{\@isoindolev[cegi]}}
\def\@isoindolev[#1]#2{%
\iforigpt \typeout{command `isoindolev' %
  is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{2==N}{#2}}
\def\isoindolevi{\@ifnextchar[{\@isoindolevi[@}{\@isoindolevi[cegi]}}
\def\@isoindolevi[#1]#2{%
\iforigpt \typeout{command `isoindolevi' %
  is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{2==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\benzofuranev}
% \begin{macro}{\benzofuranevi}
%    \begin{macrocode}
\def\benzofuranev{%
 \@ifnextchar[{\@benzofuranev[@}{\@benzofuranev[rb]}}
\def\@benzofuranev[#1]#2{%
\iforigpt \typeout{command `benzofuranev' %
  is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{1==O}{#2}}
\def\benzofuranevi{%
 \@ifnextchar[{\@benzofuranevi[@}{\@benzofuranevi[rb]}}
\def\@benzofuranevi[#1]#2{%
\iforigpt \typeout{command `benzofuranevi' %
  is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{1==O}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\isobenzofuranev}
% \begin{macro}{\isobenzofuranevi}
%    \begin{macrocode}
\def\isobenzofuranev{\@ifnextchar[{\@isobenzofuranev[@}%
 {\@isobenzofuranev[cegi]}}
\def\@isobenzofuranev[#1]#2{%
\iforigpt \typeout{command `isobenzofuranev' %
  is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{2==O}{#2}}
\def\isobenzofuranevi{\@ifnextchar[{\@isobenzofuranevi[@}%
 {\@isobenzofuranevi[cegi]}}
\def\@isobenzofuranevi[#1]#2{%
\iforigpt \typeout{command `isobenzofuranevi' %
  is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{2==O}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\benzoxazolev}
% \begin{macro}{\benzoxazolevi}
%    \begin{macrocode}
\def\benzoxazolev{%
 \@ifnextchar[{\@benzoxazolev[@}{\@benzoxazolev[rb]}}
\def\@benzoxazolev[#1]#2{%
\iforigpt \typeout{command `benzoxazolev' %
  is based on `nonaheterov'.}\fi%
\nonaheterov[#1]{1==O;3==N}{#2}}
\def\benzoxazolevi{%
 \@ifnextchar[{\@benzoxazolevi[@}{\@benzoxazolevi[rb]}}
\def\@benzoxazolevi[#1]#2{%
\iforigpt \typeout{command `benzoxazolevi' %
 is based on `nonaheterovi'.}\fi%
\nonaheterovi[#1]{1==O;3==N}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \section{Building blocks}
% \subsection{Six-membered ring unit}
%
% The old function (v1.01) of |\sixunitv| as a fusing ring unit 
% is succeeded by |\sixfusev| and |\sixfusevi|. 
% The command |\sixunitv| has been changed into a subsidiary 
% command of |\sixheterov| (v2.00). 
%
% The macro |\sixunitv| is a six-membered fragment that can be 
% fused to another ring structure to produce a new ring system. 
% The following 
% numbering is adopted in this macro. 
%
% \begin{verbatim}
% **********************
% * six-membered unit  *
% *  (vertical type)   *
% **********************
%
%          1
%          *  
%     6  *   *  2
%       |     |
%       |     |
%     5  *   *  3
%          *
%          4 <===== the original point
% \end{verbatim}
%
% The macro |\sixunitv| has three arguments |ATOMLIST|, |SUBSLIST| 
% and |OMIT| 
% as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
%   \sixunitv[BONDLIST]{ATOMLIST}{SUBSLIST}{OMIT}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to f, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `$n+$' ($n=1$ to $6$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST =
%
%           none       :  fully saturated
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,6-double bond
%           f          :  6,1-double bond
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 6)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 6 atoms)
%
%       for n = 1 to 6
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position, 
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 6 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one bond to be omitted. 
% The omitted edge is regarded as a fused position. 
%
% \begin{verbatim}
%     OMIT:  one bond omitted (a, b, c, d, e, or f)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \sixhunitv{1==N}{1==Cl;2==F}{e}
% \end{verbatim}
%
% The definition of |\sixunitv| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv|. 
% \end{enumerate}
%
% \changes{v1.01a}{1998/06/08}{\cs{sixunitv} bug fix: 
%  \cs{bbb} to \cs{fff} and \cs{ccc} to \cs{eee}}
%
% \begin{macro}{\sixunitv}
% \begin{macro}{\@sixunitv}
%    \begin{macrocode}
\def\sixunitv{\@ifnextchar[{\@sixunitv[@}{\@sixunitv[@]}}
\def\@sixunitv[#1]#2#3#4{\sixheterov[#1]{#2}{#3}[#4]}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v3.00}{2002/04/30}{\cs{sixunitv}: Old definition deleted.} 
% 
% \subsection{Five-membered ring unit}
% \subsubsection{Vertical type}
%
% The old function (v1.01) of |\fiveunitv| as a fusing ring unit 
% is succeeded by |\fivefusev|. 
% The command |\fiveunitv| has been changed into a subsidiary 
% command of |\fiveheterov| (v2.00). 
%
% The macro |\fiveunitv| is a five-membered fragment that can be 
% fused to another 
% ring structure to produce a new ring system. The following 
% numbering is adopted in this macro. 
%
% \begin{verbatim}
% **********************
% * five-membered unit *
% *  (vertical type)   *
% **********************
%
%     4 _______ 3
%       |     |
%       |     |
%     5  *   *  2
%          *
%          1 <===== the original point
% \end{verbatim}
%
% The macro |\fiveunitv| has three arguments |ATOMLIST|, |SUBSLIST| 
% and |OMIT| 
% as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
%   \fiveunitv[BONDLIST]{ATOMLIST}{SUBSLIST}{OMIT}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `$n+$' ($n=1$ to $5$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,1-double bond
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 5)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 5 atoms)
%
%       for n = 1 to 5
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 5 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one bond to be omitted. 
% The omitted edge is regarded as a fused position. 
%
% \begin{verbatim}
%     OMIT:  one bond omitted (a, b, c, d, e, or f)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \fiveunitv{1==N}{1==H;2==F}{a}
% \end{verbatim}
%
% The definition of |\fiveunitv| uses a picture environment and 
% consists of the same unit processes as shown in |\fiveheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
%
% \begin{macro}{\fiveunitv}
% \begin{macro}{\@fiveunitv}
%    \begin{macrocode}
\def\fiveunitv{\@ifnextchar[{\@fiveunitv[@}{\@fiveunitv[r]}}
\def\@fiveunitv[#1]#2#3#4{\fiveheterov[#1]{#2}{#3}[#4]}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v3.00}{2002/04/30}{\cs{fivunitv}: Old definition deleted.} 
% 
% \subsubsection{Inverse vertical type}
%
% The old function (v1.01) of |\fiveunitvi| as a fusing ring unit 
% is succeeded by |\fivefusevi|. 
% The command |\fiveunitvi| has been changed into a subsidiary 
% command of |\fiveheterovi| (v2.00). 
%
% The macro |\fiveunitvi| typesets a five-membered fragment that can be 
% fused to another 
% ring structure to produce a new ring system. The following 
% numbering is adopted in this macro. 
%
% \begin{verbatim}
% ************************************
% * five-membered unit               *
% *  (vertical type, inverse type)   *
% ************************************
%
%          1
%          * 
%     6  *   *  2
%       |     |
%       |_____|
%     4         3
%          *
%        (0,0) <===== the original point
% \end{verbatim}
%
% The macro |\fiveunitvi| has three arguments |ATOMLIST|, |SUBSLIST| 
% and |OMIT| 
% as well as an optional argument |BONDLIST|.  
%
% \begin{verbatim}
%   \fiveunitvi[BONDLIST]{ATOMLIST}{SUBSLIST}{OMIT}
% \end{verbatim}
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `$n+$' ($n=1$ to $5$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           d          :  4,5-double bond
%           e          :  5,1-double bond
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 5)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 5 atoms)
%
%       for n = 1 to 5
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 5 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one bond to be omitted. 
% The omitted edge is regarded as a fused position. 
%
% \begin{verbatim}
%     OMIT:  one bond omitted (a, b, c, d, e, or f)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \fiveunitvi{1==N}{1==H;2==F}{a}
% \end{verbatim}
%
% The definition of |\fiveunitvi| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
%
% \begin{macro}{\fiveunitvi}
% \begin{macro}{\@fiveunitvi}
%    \begin{macrocode}
\def\fiveunitvi{\@ifnextchar[{\@fiveunitvi[@}{\@fiveunitvi[r]}}
\def\@fiveunitvi[#1]#2#3#4{\fiveheterovi[#1]{#2}{#3}[#4]}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v3.00}{2002/04/30}{\cs{fivunitvi}: Old definition deleted.} 
%
% \section{Four-membered heterocycles}
% \subsection{Horizontal bonds}
%
% \begin{macro}{\bondshoriz}
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%
% % horizontal bond %
% %%%%%%%%%%%%%%%%%%%
% horizontal inner bond for four-membered rings
\def\bondshoriz{%
 \begin{sfpicture}(200,300)(0,0)
  \ifx\fff\empty%
    \ifx\bbb\empty%
     \Put@Line(-138,270)(1,0){134}%double bond 4-3
    \else%
     \Put@Line(-138,270)(1,0){115}%double bond 4-3
    \fi%
  \else%
    \ifx\bbb\empty%
     \Put@Line(-120,270)(1,0){115}%double bond 4-3
    \else%
     \Put@Line(-120,270)(1,0){96}%double bond 4-3
    \fi%
  \fi\end{sfpicture}}%
% horizontal inner bond for four-membered rings (inverse type) 
\def\bondshorizi{%
 \begin{sfpicture}(200,300)(0,0)
  \ifx\eee\empty%
    \ifx\ccc\empty%
     \Put@Line(-138,136)(1,0){134}%double bond 4-3
    \else%%
     \Put@Line(-138,136)(1,0){115}%double bond 4-3
    \fi%
  \else%
    \ifx\ccc\empty%
     \Put@Line(-120,136)(1,0){115}%double bond 4-3
    \else%
     \Put@Line(-120,136)(1,0){96}%double bond 4-3
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondshoriz}
%    \begin{macrocode}
%horizontal bond for four-membered rings
\def\skbondshoriz{%
 \begin{sfpicture}(200,300)(0,0)
  \ifx\fff\empty%
    \ifx\bbb\empty%
     \Put@Line(-171,303)(1,0){200}%bond 4-3
    \else%
     \Put@Line(-171,303)(1,0){158}%bond 4-3
    \fi%
  \else%
    \ifx\bbb\empty%
     \Put@Line(29,303)(-1,0){158}%bond 4-3
    \else%
     \Put@Line(-129,303)(1,0){116}%bond 4-3
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondshorizi}
%    \begin{macrocode}
%horizontal bond for four-membered rings (inverse type)
\def\skbondshorizi{%
 \begin{sfpicture}(200,300)(0,0)
  \ifx\eee\empty%
    \ifx\ccc\empty%
     \Put@Line(-171,103)(1,0){200}%bond 4-3
    \else%
     \Put@Line(-171,103)(1,0){158}%bond 4-3
    \fi%
  \else%
    \ifx\ccc\empty%
     \Put@Line(29,103)(-1,0){158}%bond 4-3
    \else%
     \Put@Line(-129,103)(1,0){116}%bond 4-3
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondshoriz}
%    \begin{macrocode}
%horizontal bond for four-membered rings
\def\dotskbondshoriz{%
 \begin{sfpicture}(200,300)(0,0)
  \ifx\fff\empty%
    \ifx\bbb\empty%
       \dotorline(-171,303)(1,0){200}/(-171,303)(29,303)%
    \else%
       \dotorline(-171,303)(1,0){158}/(-171,303)(-29,303)%
    \fi%
  \else%
    \ifx\bbb\empty%
       \dotorline(29,303)(-1,0){158}/(29,303)(-129,303)%
    \else%
       \dotorline(-129,303)(1,0){116}/(-129,303)(-13,303)%
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondshorizi}
%    \begin{macrocode}
%horizontal bond for four-membered rings (inverse type)
\def\dotskbondshorizi{%
 \begin{sfpicture}(200,300)(0,0)
  \ifx\eee\empty%
    \ifx\ccc\empty%
       \dotorline(-171,103)(1,0){200}/(-171,103)(29,103)%
    \else%
       \dotorline(-171,103)(1,0){158}/(-171,103)(-29,103)%
    \fi%
  \else%
    \ifx\ccc\empty%
       \dotorline(29,103)(-1,0){158}/(29,103)(-129,103)%
    \else%
       \dotorline(-129,103)(1,0){116}/(-129,103)(-13,103)%
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \subsection{Drawing four-membered heterocycles}
%
% The macro |\fourhetero| typesets a four-membered ring.  The following 
% numbering is adopted in this macro. 
%
% \begin{verbatim}
% **************************
% * fourhetero derivatives *
% *  (vertical type)       *
% **************************
% The following numbering is adopted in this macro. 
%
%          c
%     4  _____  3
%    d  |     |  b
%       |     |
%     1  -----  2<===== the original point
%          a
% \end{verbatim}
%
% The macro |\fourhetero| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \fourhetero(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `d' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to e, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `$n+$' ($n=1$ to $4$) represents a plus charge on a hetero atom 
% at the $n$-position. 
%
% \begin{verbatim}
%     BONDLIST: list of inner double bonds 
%
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  4,3-double bond
%           e          :  4,1-double bond
%
%           {n+}       :  plus at the n-nitrogen atom (n = 1 to 4)
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 4 atoms)
%
%       for n = 1 to 4
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 4 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to d: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \fourhetero{1==N}{1==H;2==F}
%        \fourhetero[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \fourhetero[eb]{1==N}{1D==O;4SA==MeO;4SB==OMe;5W==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\fourhetero| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/5}{Add: spiro and fused rings}
%
% \begin{macro}{\fourhetero}
% \begin{macro}{\@four@hetero}
% \begin{macro}{\@four@@hetero}
% \begin{macro}{\@fourhetero}
%    \begin{macrocode}
\def\fourhetero{\@ifnextchar({\@four@hetero(@}{\@four@hetero(@)}}
\def\@four@hetero(#1){\@ifnextchar[{\@four@@hetero(#1)[@}%
{\@four@@hetero(#1)[@]}}
\def\@four@@hetero(#1)[#2]#3#4{\@ifnextchar[%
{\@fourhetero(#1)[#2]{#3}{#4}[@}%
{\@fourhetero(#1)[#2]{#3}{#4}[@]}}
\def\@fourhetero(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniatom\iniflag%initialize
\test@vertix@sixv{#3}{e}{c}{b}{f}{@}{@}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{5}{1}{4}{-1}% for 2 to 3
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{142}\def\@@yli{0}\fi
\else
\ylposition{#4}{4}{4}{6}{0}% for 1
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\else
\ylposition{#4}{2}{5}{7}{0}% for 4
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{0}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,880)(-571,-137){fourhetero}%
(571,137)(171,-103)%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{\resetbdsw%
\@bond@@omit{#5}%
\Put@Direct(0,0){\set@skel@longbond{#1}{a}{skbondshorizi}}%
       % bond between 1 and 2 \@aaa -> \skbondshorizi etc
\Put@Direct(-142,0){\set@skel@bond{#1}{b}{b}}%
       % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(0,0){\set@skel@longbond{#1}{c}{skbondshoriz}}%
      % bond between 3 and 4 \@ccc -> \skbondshoriz etc
\Put@Direct(0,0){\set@skel@bond{#1}{d}{e}}%
     % bond between 4 and 1 \@ddd -> \skbonde etc
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
\else\if\member a\relax \Put@Direct(0,0){\bondshorizi}%
\else\if\member b\relax \Put@Direct(-142,0){\bondb}%
\else\if\member c\relax \Put@Direct(0,0){\bondshoriz}%
\else\if\member d\relax \Put@Direct(0,0){\bonde}%
\else 
% %%%%%%%%%%%%%%%%%%%%%%%%%
% % inner bond attachment %
% %%%%%%%%%%%%%%%%%%%%%%%%%
   \expandafter\twoCH@@R\member//%
    \set@fusionadd@fourv
\fi\fi\fi\fi\fi}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%
% % setting heteroatoms %
% %%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(-142,0){\set@hetatom@sixv{#3}{5}{1}{4}{-1}%
\storeclipinfo%added 2001/06/20 by S. Fujita
}% for 2 to 3
\developclipinfo%added 2001/06/20 by S. Fujita
\Put@Direct(0,0){\set@hetatom@sixv{#3}{4}{4}{6}{0}%
\storeclipinfo%added 2001/06/20 by S. Fujita
}% for 1
\developclipinfo%added 2001/06/20 by S. Fujita
\Put@Direct(0,0){\set@hetatom@sixv{#3}{2}{5}{7}{0}%
\storeclipinfo%added 2001/06/20 by S. Fujita
}% for 4
\developclipinfo%added 2001/06/20 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(-142,0){\setsixringv{#4}{5}{1}{4}{-1}}% for 2 to 3
\Put@Direct(0,0){\setsixringv{#4}{4}{4}{6}{0}}% for 1
\Put@Direct(0,0){\setsixringv{#4}{2}{5}{7}{0}}% for 4
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \fourhetero macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The macro |\set@fusionadd@fourv| is an inner command contained 
% in the definition of |\fourhetero| etc., where   
% the macro is used for setting an additive 
% or a fused ring at each bond (designated by |\@@tmpa|).  The 
% fused ring is typeset by the inner command |\set@fusion@fourv|. 
%
% \begin{macro}{\set@fusionadd@fourv}
% \changes{v2.00}{1998/12/5}{New command: \cs{set@fusionadd@fourv}}
%    \begin{macrocode}
\def\set@fusionadd@fourv{%
      \if\@@tmpa 1\relax%
        \putlatom{-200}{120}{\scriptsize \@@tmpb}%       % right type
      \else\if\@@tmpa 2\relax%
        \putratom{60}{120}{\scriptsize \@@tmpb}%        % right type
      \else\if\@@tmpa 3\relax%
        \putratom{60}{233}{\scriptsize \@@tmpb}%        % right type
      \else\if\@@tmpa 4\relax%
        \putlatom{-200}{233}{\scriptsize \@@tmpb}%       % right type
      \else
% %%%%%%%%%%%%%%%%%%%%%
% % inner bond fusion %
% %%%%%%%%%%%%%%%%%%%%%
        \set@fusion@fourv
      \fi\fi\fi\fi%
}% 
%    \end{macrocode}
% \end{macro}
%
% The inner command |\set@fusion@fourv| is used for typesetting 
% a fused ring at each bond represented by |\@@tmpa|.  Warnings 
% concerning mismatched ring-fusions are based on the command 
% |\FuseWarning|. 
%
% \begin{macro}{\set@fusion@fourv}
% \changes{v2.00}{1998/12/5}{New command: \cs{set@fusion@fourv}}
% \changes{v5.00}{2010/10/01}{\cs{FuseWarning} recovered for bond coloring}
%    \begin{macrocode}
\def\set@fusion@fourv{%
% %%%%%%%%%%%%%%%%%%%%%
% % inner bond fusion %
% %%%%%%%%%%%%%%%%%%%%%
\if\@@tmpa d\relax%
        \putlratom{-171}{303}{\@@tmpb}%     % bond fused
        \FuseWarning{0}{200}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{d}%
      \else\if\@@tmpa D\relax%
        \putlratom{-171}{103}{\@@tmpb}%     % bond fused
        \FuseWarning{0}{-200}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{D}%
      \else\if\@@tmpa a\relax%
        \putlratom{-173}{103}{\@@tmpb}%     % bond fused
        \FuseWarning{-200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{f}%
      \else\if\@@tmpa A\relax%
        \putlratom{27}{103}{\@@tmpb}%       % bond fused
        \FuseWarning{200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{A}%
      \else\if\@@tmpa b\relax%
        \putlratom{27}{103}{\@@tmpb}%    % bond fused
        \FuseWarning{0}{-200}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{b}%
      \else\if\@@tmpa B\relax%
        \putlratom{27}{303}{\@@tmpb}%    % bond fused
        \FuseWarning{0}{200}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{B}%
      \else\if\@@tmpa c\relax%
        \putlratom{27}{303}{\@@tmpb}%    % bond fused
        \FuseWarning{200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{c}%
      \else\if\@@tmpa C\relax%
        \putlratom{-171}{303}{\@@tmpb}%      % bond fused
        \FuseWarning{-200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{C}%
\fi\fi\fi\fi\fi\fi\fi\fi%
\global\let\FuseWarning=\FuseW@rning%added 2010/10/01
}% end of the macro \set@fusion@fourv
%    \end{macrocode}
% \end{macro}
%
%
% \changes{v5.01}{2013/3/19}{added \cs{oxetane}, \cs{thietane}, and \cs{azetidine} }
% \begin{macro}{\oxetane}
% \begin{macro}{\azetidine}
% \begin{macro}{\thietane}
%    \begin{macrocode}
\def\oxetane{\@ifnextchar[{\@oxetane[@}{\@oxetane[]}}
\def\@oxetane[#1]#2{%
\iforigpt \typeout{command `oxetane' %
  is based on `fourhetero'.}\fi%
\fourhetero[#1]{1==O}{#2}}
\def\azetidine{\@ifnextchar[{\@azetidine[@}{\@azetidine[]}}
\def\@azetidine[#1]#2{%
\iforigpt \typeout{command `azetidine' %
  is based on `fourhetero'.}\fi%
\fourhetero[#1]{1==N}{#2}}
\def\thietane{\@ifnextchar[{\@thietane[@}{\@thietane[]}}
\def\@thietane[#1]#2{%
\iforigpt \typeout{command `thietane' %
  is based on `fourhetero'.}\fi%
\fourhetero[#1]{1==S}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \section{Three-membered heterocycles}
% \subsection{Vertical type}
% \subsubsection{Sloped bonds}
%
% \begin{macro}{\bondtria}
%    \begin{macrocode}
% **********************
% * bonds for triangle *
% **********************
% fff 3--------2bbb
%      `     /
%   ddd  `1/ <===== the original point
% bond between 1 and 2
 \def\bondtria{%
  \ifx\ddd\empty%
   \ifx\bbb\empty%
    \Put@Line(-6,42)(3,5){72}%           %double bond 1-2
   \else%
    \Put@Line(-6,42)(3,5){60}%           %double bond 1-2
   \fi%
  \else%
   \ifx\bbb\empty%
    \Put@Line(6,62)(3,5){60}%            %double bond 1-2
   \else%
    \Put@Line(10,32)(3,5){60}%           %double bond 1-2
   \fi%                                    
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bondtrib}
%    \begin{macrocode}
% bond between 1 and 3
 \def\bondtrib{%
  \ifx\ddd\empty%
   \ifx\fff\empty%
    \Put@Line(6,42)(-3,5){72}%           %double bond 1-3
   \else%
    \Put@Line(6,42)(-3,5){60}%           %double bond 1-3
   \fi%
  \else%
   \ifx\fff\empty%
    \Put@Line(-6,62)(-3,5){60}%          %double bond 1-2
   \else%
    \Put@Line(6,42)(-3,5){60}%           %double bond 1-2
   \fi%                                    
  \fi%
 }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondtria}
%    \begin{macrocode}
%bond between 1 and 2
\def\skbondtria{%
 \begin{sfpicture}(200,200)(0,0)
  \ifx\ddd\empty%
    \ifx\bbb\empty%
     \Put@Line(0,0)(3,5){103}%           %bond 1-2
    \else%
     \Put@Line(0,0)(3,5){80}%            %bond 1-2
    \fi%
  \else%
    \ifx\bbb\empty%
     \Put@Line(103,171)(-3,-5){80}%      %bond 1-2
    \else%
     \Put@Line(35,21)(3,5){60}%          %bond 1-2
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skbondtrib}
%    \begin{macrocode}
%bond between 1 and 3
\def\skbondtrib{%
 \begin{sfpicture}(200,200)(0,0)
  \ifx\ddd\empty%
    \ifx\fff\empty%
     \Put@Line(0,0)(-3,5){103}%         %bond 1-3
    \else%
     \Put@Line(0,0)(-3,5){80}%          %bond 1-3
    \fi%
  \else%
%    \ifx\eee\empty%bug fix 1993/11/19
    \ifx\fff\empty%
     \Put@Line(-103,171)(3,-5){80}%     %bond 1-3
    \else%
     \Put@Line(-35,21)(-3,5){60}%       %bond 1-3
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondtria}
%    \begin{macrocode}
%bond between 1 and 2
\def\dotskbondtria{%
 \begin{sfpicture}(200,200)(0,0)
  \ifx\ddd\empty%
    \ifx\bbb\empty%
       \dotorline(0,0)(3,5){103}/(0,0)(103,171)%
    \else%
       \dotorline(0,0)(3,5){80}/(0,0)(80,133)%
    \fi%
  \else%
    \ifx\bbb\empty%
       \dotorline(103,171)(-3,-5){80}/(103,171)(23,38)%
    \else%
       \dotorline(35,21)(3,5){60}/(35,21)(95,121)%
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dotskbondtrib}
%    \begin{macrocode}
%bond between 1 and 3
\def\dotskbondtrib{%
 \begin{sfpicture}(200,200)(0,0)
  \ifx\ddd\empty%
    \ifx\fff\empty%
       \dotorline(0,0)(-3,5){103}/(0,0)(-103,171)%
    \else%
       \dotorline(0,0)(-3,5){80}/(0,0)(-80,133)%
    \fi%
  \else%
    \ifx\fff\empty%
       \dotorline(-103,171)(3,-5){80}/(-103,171)(-23,38)%
    \else%
       \dotorline(-35,21)(-3,5){60}/(-35,21)(-95,121)%
    \fi%
  \fi\end{sfpicture}}%
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Drawing three-membered heterocycles}
%
% The macro |\threehetero| typesets a three-membered ring.  The following 
% numbering is adopted in this macro. 
%
% \begin{verbatim}
% ****************************
% * thereehetero derivatives *
% *  (vertical type)         *
% ****************************
%
%         b
%     3--------2
%    c `     / a
%        `1/ <===== the original point
% \end{verbatim}
%
% The macro |\threehetero| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \threehetero(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
%   \threeheterov(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `c' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to c, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `$n+$' ($n=1$ to $3$) represents a plus charge on a hetero atom 
% at the $n$-position. 
% The option `$n+$' ($n=4$ to $6$) represents a plus charge outside the ring. 
% The option `$0+$' typesets a plus charge at the center of the ring. 
%
% \begin{verbatim}
%     BONDLIST = 
%
%           none       :  saturated 
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  3,1-double bond
%           A          :  aromatic circle 
%           {n+}       :  plus at the n-hetero atom (n = 1 to 3)
%                      :  n=4 -- outer plus at 1 position
%                      :  n=5 -- outer plus at 2 position
%                      :  n=6 -- outer plus at 3 position
%           {0+}       :  plus at the center of a cyclopropane ring
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 3 atoms)
%
%       for n = 1 to 3
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position, 
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 3 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to c: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \threehetero{1==N}{1==Cl;2==F}
%        \threehetero[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \threehetero{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\threehetero| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/5}{Add: spiro and fused rings}
% \changes{v2.01}{2001/6/20}{The
% \cs{storeclipinfo} command is added.}
%
% \begin{macro}{\threehetero}
% \begin{macro}{\@three@hetero}
% \begin{macro}{\@three@@hetero}
% \begin{macro}{\@threehetero}
%    \begin{macrocode}
\def\threehetero{\@ifnextchar({\@three@hetero(@}{\@three@hetero(@)}}
\def\@three@hetero(#1){\@ifnextchar[{\@three@@hetero(#1)[@}%
{\@three@@hetero(#1)[@]}}
\def\@three@@hetero(#1)[#2]#3#4{\@ifnextchar[%
{\@threehetero(#1)[#2]{#3}{#4}[@}%
{\@threehetero(#1)[#2]{#3}{#4}[@]}}
\def\@threehetero(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniatom\iniflag%initialize
\test@vertix@sixv{#3}{d}{b}{f}{@}{@}{@}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{3}{3}{5}{0}%subst 1
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{68}\def\@@yli{0}\fi
\else
\ylposition{#4}{0}{1}{3}{0}%subst 2
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{142}\def\@@yli{132}\fi
\else
\ylposition{#4}{3}{5}{7}{0}%subst 3
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{132}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,580)(-468,-240){threeheterov}%
(468,240)(68,0)%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{\resetbdsw%
\@bond@@omit{#5}%
\Put@Direct(-68,0){\set@skel@longbond{#1}{a}{skbondtria}}%
       % bond between 1 and 2 \@aaa -> \skbondtria etc
\Put@Direct(0,-132){\set@skel@longbond{#1}{b}{skbondshoriz}}%
       % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(-68,0){\set@skel@longbond{#1}{c}{skbondtrib}}%
       % bond between 3 and 1 \@ccc -> \skbondtria etc
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
\else\if\member a\relax\Put@Direct(-68,0){\bondtria}%
\else\if\member b\relax\Put@Direct(0,-126){\bondshoriz}%
\else\if\member c\relax\Put@Direct(-68,0){\bondtrib}%
\else\if\member A\relax% aromatic circle 
  \Put@oCircle(-70,108){100}%               %circle
\else
% %%%%%%%%%%%%%%%%%%%%%%%%%
% % inner bond attachment %
% %%%%%%%%%%%%%%%%%%%%%%%%%
   \expandafter\twoCH@@R\member//%
    \set@fusionadd@threev
\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms %
% %%%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(-68,0){\set@hetatom@sixv{#3}{3}{3}{5}{0}%
%\if@clip\global\@cliptrue\fi
\storeclipinfo
}%subst 1
\developclipinfo
\Put@Direct(-142,-132){\set@hetatom@sixv{#3}{0}{1}{3}{0}%
%\if@bclip\global\@bcliptrue\fi
\storeclipinfo
}%subst 2
\developclipinfo
\Put@Direct(0,-132){\set@hetatom@sixv{#3}{3}{5}{7}{0}%
%\if@fclip\global\@fcliptrue\fi
\storeclipinfo
}%subst 3
\developclipinfo
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(-68,0){\setsixringv{#4}{3}{3}{5}{0}}%subst 1
\Put@Direct(-142,-132){\setsixringv{#4}{0}{1}{3}{0}}%subst 2
\Put@Direct(0,-132){\setsixringv{#4}{3}{5}{7}{0}}%subst 3
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \threehetero macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\threeheterov}
%    \begin{macrocode}
\let\threeheterov=\threehetero
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@fusionadd@threev| is an inner command contained 
% in the definition of |\threehetero| etc., where   
% the macro is used for setting an additive 
% or a fused ring at each bond (designated by |\@@tmpa|).  The 
% fused ring is typeset by the inner command |\set@fusion@threev|. 
%
% \begin{macro}{\set@fusionadd@threev}
% \changes{v2.00}{1998/12/5}{New command: \cs{set@fusionadd@threev}}
%    \begin{macrocode}
\def\set@fusionadd@threev{%
      \if\@@tmpa 0\relax%
        \putratom{-94}{92}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 1\relax%
        \putratom{-94}{60}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 2\relax%
        \putratom{-52}{120}{\scriptsize\@@tmpb}%     % right type
      \else\if\@@tmpa 3\relax%
        \putratom{-126}{126}{\scriptsize\@@tmpb}%    % right type
      \else\if\@@tmpa 4\relax%
        \putratom{-30}{-20}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 5\relax%
        \putratom{52}{110}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 6\relax%
        \putratom{-250}{110}{\scriptsize\@@tmpb}%    % right type
      \else
% %%%%%%%%%%%%%%%%%%%%%
% % inner bond fusion %
% %%%%%%%%%%%%%%%%%%%%%
        \set@fusion@threev
      \fi\fi\fi\fi\fi\fi\fi%
}% 
%    \end{macrocode}
% \end{macro}
%
% The inner command |\set@fusion@threev| is used for typesetting 
% a fused ring at each bond represented by |\@@tmpa|.  Warnings 
% concerning mismatched ring-fusions are based on the command 
% |\FuseWarning|. 
%
% \begin{macro}{\set@fusion@threev}
% \changes{v2.00}{1998/12/5}{New command: \cs{set@fusion@threev}}
% \changes{v5.00}{2010/10/01}{\cs{FuseWarning} recovered for bond coloring}
%    \begin{macrocode}
\def\set@fusion@threev{%
% %%%%%%%%%%%%%%%%%%%%%
% % inner bond fusion %
% %%%%%%%%%%%%%%%%%%%%%
\if\@@tmpa b\relax%
        \putlratom{29}{171}{\@@tmpb}%    % bond fused
        \FuseWarning{200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{b}%
      \else\if\@@tmpa B\relax%
        \putlratom{-171}{171}{\@@tmpb}%      % bond fused
        \FuseWarning{-200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{B}%
      \else\if\@@tmpa a\relax%
        \putlratom{-68}{0}{\@@tmpb}%    % bond fused
        \FuseWarning{-103}{-171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{a}%
      \else\if\@@tmpa A\relax%
        \putlratom{29}{171}{\@@tmpb}%    % bond fused
        \FuseWarning{103}{171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{A}%
      \else\if\@@tmpa c\relax%
        \putlratom{-171}{171}{\@@tmpb}%      % bond fused
        \FuseWarning{-103}{171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{c}%
      \else\if\@@tmpa C\relax%
        \putlratom{-68}{0}{\@@tmpb}%    % bond fused
        \FuseWarning{103}{-171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{C}%
\fi\fi\fi\fi\fi\fi%
\global\let\FuseWarning=\FuseW@rning%added 2010/10/01
}% end of the macro \set@fusion@threev
%    \end{macrocode}
% \end{macro}
%
% \changes{v5.01}{2013/3/19}{added \cs{oxiranev}, \cs{aziridinev}, and \cs{thiiranev} }
% \begin{macro}{\oxiranev}
% \begin{macro}{\aziridinev}
% \begin{macro}{\thiiranev}
%    \begin{macrocode}
\def\oxiranev{\@ifnextchar[{\@oxiranev[@}{\@oxiranev[]}}
\def\@oxiranev[#1]#2{%
\iforigpt \typeout{command `oxiranev' %
  is based on `threeheterov'.}\fi%
\threeheterov[#1]{1==O}{#2}}
\def\aziridinev{\@ifnextchar[{\@aziridinev[@}{\@aziridinev[]}}
\def\@aziridinev[#1]#2{%
\iforigpt \typeout{command `aziridinev' %
  is based on `threeheterov'.}\fi%
\threeheterov[#1]{1==N}{#2}}
\def\thiiranev{\@ifnextchar[{\@thiiranev[@}{\@thiiranev[]}}
\def\@thiiranev[#1]#2{%
\iforigpt \typeout{command `thiiranev' %
  is based on `threeheterov'.}\fi%
\threeheterov[#1]{1==S}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Inverse vertical type}
% \subsubsection{Sloped bonds}
%
% \changes{v1.02}{1998/10/20}{Newly added commands: 
% \cs{Bondtria}}
% \begin{macro}{\Bondtria}
%    \begin{macrocode}
% **********************
% * bonds for triangle *
% **********************
%
%   aaa /1` <===== the original point
%      /    `   
% eee 3--------2ccc
% bond between 1 and 2
 \def\Bondtria{%
  \ifx\aaa\empty%
   \ifx\ccc\empty%
    \Put@Line(-6,-42)(3,-5){72}%           %double bond 1-2
   \else%
    \Put@Line(-6,-42)(3,-5){60}%           %double bond 1-2
   \fi%
  \else%
   \ifx\ccc\empty%
    \Put@Line(6,-62)(3,-5){60}%            %double bond 1-2
   \else%
    \Put@Line(10,-32)(3,-5){60}%           %double bond 1-2
   \fi%                                    
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.02}{1998/10/20}{Newly added commands: \cs{Bondtrib}}
% \begin{macro}{\Bondtrib}
%    \begin{macrocode}
% bond between 1 and 3
 \def\Bondtrib{%
  \ifx\aaa\empty%
   \ifx\eee\empty%
    \Put@Line(6,-42)(-3,-5){72}%           %double bond 1-3
   \else%
    \Put@Line(6,-42)(-3,-5){60}%           %double bond 1-3
   \fi%
  \else%
   \ifx\fff\empty%
    \Put@Line(-6,-62)(-3,-5){60}%          %double bond 1-2
   \else%
    \Put@Line(6,-42)(-3,-5){60}%           %double bond 1-2
   \fi%                                    
  \fi%
 }%
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.02}{1998/10/20}{Newly added commands: 
% \cs{skBondtria}}
% \begin{macro}{\skBondtria}
%    \begin{macrocode}
%bond between 1 and 2
\def\skBondtria{%
% \begin{sfpicture}(200,200)(0,0)
% \begin{sfpicture}(0,0)(0,0)
  \ifx\aaa\empty%
    \ifx\ccc\empty%
     \Put@Line(0,0)(3,-5){103}%           %bond 1-2
    \else%
     \Put@Line(0,0)(3,-5){80}%            %bond 1-2
    \fi%
  \else%
    \ifx\ccc\empty%
     \Put@Line(103,-171)(-3,5){80}%      %bond 1-2
    \else%
     \Put@Line(35,-21)(3,-5){60}%          %bond 1-2
    \fi%
  \fi
%\end{sfpicture}
}%
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.02}{1998/10/20}{Newly added commands: 
% \cs{skBondtrib}}
% \begin{macro}{\skBondtrib}
%    \begin{macrocode}
%bond between 1 and 3
\def\skBondtrib{%
% \begin{sfpicture}(0,0)(0,0)
% \begin{sfpicture}(200,200)(0,0)
  \ifx\aaa\empty%
    \ifx\eee\empty%
     \Put@Line(0,0)(-3,-5){103}%         %bond 1-3
    \else%
     \Put@Line(0,0)(-3,-5){80}%          %bond 1-3
    \fi%
  \else%
    \ifx\eee\empty%
     \Put@Line(-103,-171)(3,5){80}%     %bond 1-3
    \else%
     \Put@Line(-35,-21)(-3,-5){60}%       %bond 1-3
    \fi%
  \fi
%\end{sfpicture}
}%
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.00}{1998/12/25}{Newly added commands: 
% \cs{dotskBondtria}}
% \begin{macro}{\dotskBondtria}
%    \begin{macrocode}
%bond between 1 and 2
\def\dotskBondtria{%
  \ifx\aaa\empty%
    \ifx\ccc\empty%
       \dotorline(0,0)(3,-5){103}/(0,0)(103,-171)%
    \else%
       \dotorline(0,0)(3,-5){80}/(0,0)(80,-133)%
    \fi%
  \else%
    \ifx\ccc\empty%
       \dotorline(103,-171)(-3,5){80}/(103,-171)(23,-38)%
    \else%
       \dotorline(35,-21)(3,-5){60}/(35,-21)(95,-121)%
    \fi%
  \fi
}%
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.00}{1998/12/25}{Newly added commands: 
% \cs{dotskBondtrib}}
% \begin{macro}{\dotskBondtrib}
%    \begin{macrocode}
%bond between 1 and 3
\def\dotskBondtrib{%
  \ifx\aaa\empty%
    \ifx\eee\empty%
       \dotorline(0,0)(-3,-5){103}/(0,0)(-103,-171)%
    \else%
       \dotorline(0,0)(-3,-5){80}/(0,0)(-80,-133)%
    \fi%
  \else%
    \ifx\eee\empty%
       \dotorline(-103,-171)(3,5){80}/(-103,-171)(-23,-38)%
    \else%
       \dotorline(-35,-21)(-3,-5){60}/(-35,-21)(-95,-121)%
    \fi%
  \fi
}%
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Drawing three-membered heterocycles (inverse)}
%
% The macro |\threeheteroi| typesets a three-membered ring of 
% inverse vertical type.  The following numbering is adopted 
% in this macro. 
% \changes{v1.02}{1998/10/20}{Newly added commands: 
% \cs{threeheteroi}}
%
% \begin{verbatim}
% ****************************
% * thereehetero derivatives *
% *  (inverse vertical type) *
% ****************************
%
%        /1` <===== the original point
%    c /     ` a
%     3--------2
%         b
% \end{verbatim}
%
% The macro |\threeheteroi| has two arguments |ATOMLIST| and |SUBSLIST| 
% as well as an optional argument |BONDLIST|.  
% Two optional arguments |SKBONDLIST| and |OMIT| are added to 
% treat stereochemical information or other bond situations. 
%
% \begin{verbatim}
%   \threeheteroi(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
%   \threeheterovi(SKBONDLIST)[BONDLIST]{ATOMLIST}{SUBSLIST}[OMIT]
% \end{verbatim}
%
% The |SKBONDLIST| argument contains pairs of two alphabets in 
% parentheses, e.g. (\{bA\}\{fB\}).  Each pair contains a lowercase 
% character selected from bond specifiers `a' to `c' and a uppercase
% character `A' or `B'. 
%
% The |BONDLIST| argument contains one 
% character selected from a to c, each of which indicates the presence of 
% an inner (endcyclic) double bond on the corresponding position. 
% The option `$n+$' ($n=1$ to $3$) represents a plus charge on a hetero atom 
% at the $n$-position. 
% The option `$n+$' ($n=4$ to $6$) represents a plus charge outside the ring. 
% The option `$0+$' typesets a plus charge at the center of the ring. 
%
% \begin{verbatim}
%     BONDLIST = 
%
%           none       :  saturated 
%           a          :  1,2-double bond
%           b          :  2,3-double bond
%           c          :  3,1-double bond
%           A          :  aromatic circle 
%           {n+}       :  plus at the n-hetero atom (n = 1 to 3)
%                      :  n=4 -- outer plus at 1 position
%                      :  n=5 -- outer plus at 2 position
%                      :  n=6 -- outer plus at 3 position
%           {0+}       :  plus at the center of a cyclopropane ring
% \end{verbatim}
%
% The |ATOMLIST| argument contains one or more heteroatom descriptors 
% which are separated from each other by a semicolon.  Each heteroatom 
% descriptor consists of a locant number and a heteroatom, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     ATOMLIST: list of heteroatoms (max 3 atoms)
%
%       for n = 1 to 3
%
%           n          : Hetero atom, e.g. N, O, etc. at n-position, 
%                        e.g. 1==N for N at 1-position
% \end{verbatim}
%
% The |SUBSLIST| argument contains one or more substitution descriptors 
% which are separated from each other by a semicolon.  Each substitution 
% descriptor has a locant number with a bond modifier and a substituent, 
% where these are separated with a double equality symbol. 
%
% \begin{verbatim}
%     SUBSLIST: list of substituents
%
%       for n = 1 to 3 
%
%           nD         :  exocyclic double bond at n-atom
%           n or nS    :  exocyclic single bond at n-atom
%           nA         :  alpha single bond at n-atom
%           nB         :  beta single bond at n-atom
%           nSA        :  alpha single bond at n-atom (boldface)
%           nSB        :  beta single bond at n-atom (dotted line)
%           nSa        :  alpha (not specified) single bond at n-atom
%           nSb        :  beta (not specified) single bond at n-atom
%
%           nSd        :  alpha single bond at n-atom (dotted line) 
%                           with an alternative direction to nSA 
%           nSu        :  beta single bond at n-atom (boldface) 
%                           with an alternative direction to nSB 
%           nFA        :  alpha single bond at n-atom (dotted line) 
%                           for ring fusion 
%           nFB        :  beta single bond at n-atom (boldface) 
%                           for ring fusion 
%           nGA        :  alpha single bond at n-atom (dotted line) 
%                           for the other ring fusion 
%           nGB        :  beta single bond at n-atom (boldface) 
%                           for the other ring fusion 
% \end{verbatim}
%
% The argument |OMIT| represents one or more bonds to be omitted. 
% The omitted edges may be regarded as both fused and non-fused 
% positions. 
%
% \begin{verbatim}
%     OMIT:  one or more bonds omitted (a to c: see BONDLIST)
% \end{verbatim}
%
% Several examples are shown as follows.
% \begin{verbatim}
%       e.g. 
%        
%        \threeheteroi{1==N}{1==Cl;2==F}
%        \threeheteroi[c]{1==N}{1==Cl;4==F;2==CH$_{3}$}
%        \threeheteroi{1==N}{1D==O;4SA==MeO;4SB==OMe;5==Cl;6==Cl}
% \end{verbatim}
%
% The definition of |\threehetero| uses a picture environment and 
% consists of the same unit processes as shown in |\sixheterov|: 
% \begin{enumerate}
% \item treatment of atom list, 
% \item placing outer skeletons, 
% \item placing inner double bonds, 
% \item setting hetero atoms, and 
% \item placing substituents by using |\setsixringv| partially. 
% \end{enumerate}
% \changes{v1.02}{1998/10/31}{Adding \cs{ylposition}, \cs{if@ylsw},
% \cs{yl@shifti}, \cs{@ylii}, \cs{yl@shiftii}, \cs{@ylii}, 
% \cs{yl@xdiff} and \cs{yl@ydiff}}
% \changes{v2.00}{1998/12/5}{Add: spiro and fused rings}
% \changes{v2.01}{2001/6/20}{The
% \cs{storeclipinfo} command is added.}
%
% \begin{macro}{\threeheteroi}
% \begin{macro}{\@three@heteroi}
% \begin{macro}{\@three@@heteroi}
% \begin{macro}{\@threeheteroi}
%    \begin{macrocode}
\def\threeheteroi{\@ifnextchar({\@three@heteroi(@}{\@three@heteroi(@)}}
\def\@three@heteroi(#1){\@ifnextchar[{\@three@@heteroi(#1)[@}%
{\@three@@heteroi(#1)[@]}}
\def\@three@@heteroi(#1)[#2]#3#4{\@ifnextchar[%
{\@threeheteroi(#1)[#2]{#3}{#4}[@}%
{\@threeheteroi(#1)[#2]{#3}{#4}[@]}}
\def\@threeheteroi(#1)[#2]#3#4[#5]{%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%
% % treatment of atom list %
% %%%%%%%%%%%%%%%%%%%%%%%%%%
\iniatom\iniflag%initialize
\test@vertix@sixv{#3}{a}{c}{e}{@}{@}{@}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % adustment of subs positions %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@reset@ylsw%
\ylposition{#4}{0}{0}{2}{0}%subst 1
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{68}\def\@@yli{406}\fi
\else
\ylposition{#4}{1}{2}{4}{0}%subst 2
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{142}\def\@@yli{275}\fi
\else
\ylposition{#4}{2}{4}{6}{0}%subst 3
\fi
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{0}\def\@@yli{275}\fi
\fi
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(800,580)(-468,-340){threeheterovi}%
(468,340)(68,0)%2002/4/30 by S. Fujita
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%
% % outer skeleton %
% %%%%%%%%%%%%%%%%%%
{\resetbdsw%
\@bond@@omit{#5}%
\Put@Direct(-68,0){\set@skel@longbond{#1}{a}{skBondtria}}%
       % bond between 1 and 2 \@aaa -> \skBondtria etc
\Put@Direct(0,-275){\set@skel@longbond{#1}{b}{skbondshorizi}}%
       % bond between 2 and 3 \@bbb -> \skbondb etc
\Put@Direct(-68,0){\set@skel@longbond{#1}{c}{skBondtrib}}%
       % bond between 3 and 1 \@ccc -> \skBondtrib etc
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%
% % inner double bond %
% %%%%%%%%%%%%%%%%%%%%%
\@tfor\member:=#2\do{%
\if\member r\relax%
\else\if\member a\relax\Put@Direct(-68,0){\Bondtria}%
\else\if\member b\relax\Put@Direct(0,-274){\bondshorizi}%
\else\if\member c\relax\Put@Direct(-68,0){\Bondtrib}%
\else\if\member A\relax% aromatic circle 
  \Put@oCircle(-70,-108){100}%               %circle
\else
% %%%%%%%%%%%%%%%%%%%%%%%%%
% % inner bond attachment %
% %%%%%%%%%%%%%%%%%%%%%%%%%
   \expandafter\twoCH@@R\member//%
    \set@fusionadd@threevi
\fi\fi\fi\fi\fi%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting hetero atoms %
% %%%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(-68,-406){\set@hetatom@sixv{#3}{0}{0}{2}{0}%
%\if@aclip\global\@acliptrue\fi
\storeclipinfo
}%subst 1
\developclipinfo
\Put@Direct(0,-275){\set@hetatom@sixv{#3}{2}{4}{6}{0}%
%\if@eclip\global\@ecliptrue\fi
\storeclipinfo
}%subst 3
\developclipinfo
\Put@Direct(-142,-275){\set@hetatom@sixv{#3}{1}{2}{4}{0}%
%\if@cclip\global\@ccliptrue\fi
\storeclipinfo
}%subst 2
\developclipinfo
%    \end{macrocode}
%
%    \begin{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%
% % setting substituents %
% %%%%%%%%%%%%%%%%%%%%%%%%
\Put@Direct(-68,-406){\setsixringv{#4}{0}{0}{2}{0}}%subst 1
\Put@Direct(0,-275){\setsixringv{#4}{2}{4}{6}{0}}%subst 3
\Put@Direct(-142,-275){\setsixringv{#4}{1}{2}{4}{0}}%subst 2
\end{ShiftPicEnvB}\iniatom\iniflag}% %end of \threeheteroi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\threeheterovi}
%    \begin{macrocode}
\let\threeheterovi=\threeheteroi
%    \end{macrocode}
% \end{macro}
%
% The macro |\set@fusionadd@threevi| is an inner command contained 
% in the definition of |\threeheteroi| etc., where   
% the macro is used for setting an additive 
% or a fused ring at each bond (designated by |\@@tmpa|).  The 
% fused ring is typeset by the inner command |\set@fusion@threevi|. 
%
% \begin{macro}{\set@fusionadd@threevi}
% \changes{v2.00}{1998/12/5}{New command: \cs{set@fusionadd@threevi}}
%    \begin{macrocode}
\def\set@fusionadd@threevi{%
      \if\@@tmpa 0\relax%
        \putratom{-94}{-120}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 1\relax%
        \putratom{-94}{-80}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 2\relax%
        \putratom{-52}{-150}{\scriptsize\@@tmpb}%     % right type
      \else\if\@@tmpa 3\relax%
        \putratom{-126}{-150}{\scriptsize\@@tmpb}%    % right type
      \else\if\@@tmpa 4\relax%
        \putratom{-30}{0}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 5\relax%
        \putratom{32}{-130}{\scriptsize\@@tmpb}%      % right type
      \else\if\@@tmpa 6\relax%
        \putratom{-230}{-130}{\scriptsize\@@tmpb}%    % right type
      \else
% %%%%%%%%%%%%%%%%%%%%%
% % inner bond fusion %
% %%%%%%%%%%%%%%%%%%%%%
        \set@fusion@threevi
      \fi\fi\fi\fi\fi\fi\fi%
}% 
%    \end{macrocode}
% \end{macro}
%
% The inner command |\set@fusion@threevi| is used for typesetting 
% a fused ring at each bond represented by |\@@tmpa|.  Warnings 
% concerning mismatched ring-fusions are based on the command 
% |\FuseWarning|. 
%
% \begin{macro}{\set@fusion@threevi}
% \changes{v2.00}{1998/12/5}{New command: \cs{set@fusion@threevi}}
% \changes{v5.00}{2010/10/01}{\cs{FuseWarning} recovered for bond coloring}
%    \begin{macrocode}
\def\set@fusion@threevi{%
% %%%%%%%%%%%%%%%%%%%%%
% % inner bond fusion %
% %%%%%%%%%%%%%%%%%%%%%
\if\@@tmpa b\relax%
        \putlratom{29}{-171}{\@@tmpb}%    % bond fused
        \FuseWarning{200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{b}%
  \else\if\@@tmpa B\relax%
        \putlratom{-171}{-171}{\@@tmpb}%      % bond fused
        \FuseWarning{-200}{0}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{B}%
  \else\if\@@tmpa a\relax%
        \putlratom{-68}{0}{\@@tmpb}%    % bond fused
        \FuseWarning{-103}{171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{a}%
  \else\if\@@tmpa A\relax%
        \putlratom{29}{-171}{\@@tmpb}%      % bond fused
        \FuseWarning{103}{-171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{A}%
  \else\if\@@tmpa c\relax%
        \putlratom{-171}{-171}{\@@tmpb}%      % bond fused
        \FuseWarning{103}{171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{c}%
  \else\if\@@tmpa C\relax%
        \putlratom{-68}{0}{\@@tmpb}%    % bond fused
        \FuseWarning{-103}{-171}%
          {\fuseAx}{\fuseAy}{\fuseBx}{\fuseBy}{C}%
\fi\fi\fi\fi\fi\fi%
\global\let\FuseWarning=\FuseW@rning%added 2010/10/01
}% end of the macro \set@fusion@threevi
%</hetarom>
%    \end{macrocode}
% \end{macro}
%
% \changes{v5.01}{2013/3/19}{added \cs{oxiranev}, \cs{aziridinev}, and \cs{thiiranev} }
% \begin{macro}{\oxiranevi}
% \begin{macro}{\aziridinevi}
% \begin{macro}{\thiiranevi}
%    \begin{macrocode}
\def\oxiranevi{\@ifnextchar[{\@oxiranevi[@}{\@oxiranevi[]}}
\def\@oxiranevi[#1]#2{%
\iforigpt \typeout{command `oxiranevi' %
  is based on `threeheterovi'.}\fi%
\threeheterovi[#1]{1==O}{#2}}
\def\aziridinevi{\@ifnextchar[{\@aziridinevi[@}{\@aziridinevi[]}}
\def\@aziridinevi[#1]#2{%
\iforigpt \typeout{command `aziridinevi' %
  is based on `threeheterovi'.}\fi%
\threeheterovi[#1]{1==N}{#2}}
\def\thiiranevi{\@ifnextchar[{\@thiiranevi[@}{\@thiiranevi[]}}
\def\@thiiranevi[#1]#2{%
\iforigpt \typeout{command `thiiranevi' %
  is based on `threeheterovi'.}\fi%
\threeheterovi[#1]{1==S}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \Finale
%
\endinput
