% \iffalse meta-comment
%% File: steroid.dtx
%
%  Copyright 2009 by Shinsaku Fujita
%  Copyright for the XyMTeX system 1993,1996,1998,2001,2002,2004,2005,2009 by Shinsaku Fujita
%
%  This file is part of XyMTeX system.
%  -------------------------------------
%
% This file is a successor to:
%
% steroid.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].  
%
% Copying of this file is authorized only if either
%  (1) you make absolutely no changes to your copy, including name and 
%     directory name; or
%  (2) if you do make changes, 
%     (a) you name it something other than the names included in the 
%         ``xymtex'' directory and 
%     (b) you are requested to leave this notice intact.
% This restriction ensures that all standard styles are identical.
%
% 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-ken, 258-0019, Japan.
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \def\j@urnalname{steroid}
% \def\versi@ndate{June 15, 2009}
% \def\versi@nno{ver1.00}
% \def\copyrighth@lder{SF}% Shinsaku Fujita
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \fi
%
% \CheckSum{1766}
%% \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.00}{2009/06/15}{The first version}
% \fi
%
% \iffalse
%<*driver>
\NeedsTeXFormat{pLaTeX2e}
% \fi
\ProvidesFile{steroid.dtx}[2009/06/15 v1.00 for Ver. 4.04 of XyMTeX{} package file]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{steroid.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{Steroid derivatives by {\sffamily steroid.sty} 
of \XyMTeX{} (\fileversion) }
\author{Shinsaku Fujita \\ 
Shonan Institute of Chemoinformatics and Mathematical Chemistry, \\
Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun Kanagawa-ken, 258-0019, Japan.
}
\date{\filedate}
%
\begin{document}
   \maketitle
   \DocInput{steroid.dtx}
\end{document}
%</driver>
% \fi
%
% \section{Introduction}\label{steroid:intro}
%
% \subsection{Options for {\sffamily docstrip}}
%
% \DeleteShortVerb{\|}
% \begin{center}
% \begin{tabular}{|l|l|}
% \hline
% \emph{option} & \emph{function}\\ \hline
% steroid & steroid.sty \\
% driver & driver for this dtx file \\
% \hline
% \end{tabular}
% \end{center}
% \MakeShortVerb{\|}
%
% \subsection{Version Information}
%
%    \begin{macrocode}
%<*steroid>
\typeout{XyMTeX for Drawing Chemical Structural Formulas. Version 4.04}
\typeout{       -- Released June 16, 2009 by Shinsaku Fujita}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\j@urnalname{steroid}
\def\versi@ndate{June 15, 2009}
\def\versi@nno{ver1.00}
\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 steroid.sty}
%
% \begin{verbatim}
% *********************************
% * steroid.sty: list of commands *
% *********************************
%
%  <Macros for drawing basic steroids>
%
%  \gonane
%  \gonanealpha
%  \gonanebeta
%
%  \estrane
%  \estranealpha
%  \estranebeta
%
%  \steroidnochainandrostane
%  \androstane
%  \androstanealpha
%  \androstanebeta
%
%  \steroidethylchain
%  \steroidethylchainpregnane
%  \pregnane
%  \pregnanealpha
%  \pregnanebeta
%
%  <Macros for drawing steroids with chains (modern type)>
%  C22-C23: transoid 
%
%  \steroidChain
%  \steroidChaindiMe
%  \cholestaneAlpha
%  \cholestaneBeta
%  \cholestane
%
%  \ergostaneAlpha
%  \ergostaneBeta
%  \ergostane
%
%  \campestaneAlpha
%  \campestaneBeta
%  \campestane
%
%  \poriferastaneAlpha
%  \poriferastaneBeta
%  \poriferastane
%
%  \stigmastaneAlpha
%  \stigmastaneBeta
%  \stigmastane
%
%  <Macros for drawing steroids with short chains (modern type)>
%  C22-C23: transoid 
%
%  \steroidShortChain
%  \steroidShortChainMe
%  \cholaneAlpha
%  \cholaneBeta
%
%  <Macros for drawing steroids with short chains (old type)>
%  C22-C23: transoid 
%
%  \steroidshortchain
%  \steroidshortchainMe
%  \cholanealpha
%  \cholanebeta
%  \cholanE
%
%  <Macros for drawing steroids with chains (old type)>
%  C22-C23: cisoid 
%
%  \steroidchaindiMe
%  \cholestanealpha
%  \cholestanebeta
%  \cholestanE
%
%  \ergostanealpha
%  \ergostanebeta
%  \ergostanE
%
%  \campestanealpha
%  \campestanebeta
%  \campestanE
%
%  \poriferastanealpha
%  \poriferastanebeta
%  \poriferastanE
%
%  \stigmastanealpha
%  \stigmastanebeta
%  \stigmastanE
%
%  <Macros for drawing spirostans>
%
%  \steroidspiro
%  \steroidspirotriMe
%  \spirostanalpha
%  \spirostanbeta
%  \spirostan
%  \spirostannor
%
%  <Macros for drawing furostans>
%
%  \steroidfuros
%  \steroidspirotriMe
%  \furostanalpha
%  \furostanbeta
%  \furostan
%
%  <Macros for drawing spiro pyranoses>
%
%  \pyranoseChairi
%  \pyranoseChairii
%
% \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 steroid.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}{}
\@ifundefined{steroidchain}{\input carom.sty\relax}{}
\@ifundefined{ylchairiposition}{\input ccycle.sty\relax}{}
\unitlength=0.1pt
%    \end{macrocode}
%
% The commands |\steroid| and |\steroidchain| for drawing raw skeletons of 
% steroid derivatives have been already defined in {\sf carom.sty}, which 
% is loaded automatically as above. 
%
% \section{Macros for Steroids with No Side Chains}
% 
% By starting from the commands |\steroid| defined in the {\sf carom.sty}, 
% several intermediate commands are defined to draw steroid derivatives 
% without side chains. 
%
% \begin{macro}{\gonane}
% \begin{macro}{\gonanealpha}
% \begin{macro}{\gonanebeta}
% \begin{macro}{\estrane}
% \begin{macro}{\estranealpha}
% \begin{macro}{\estranebeta}
%    \begin{macrocode}
% ***********************************************
% * For drawing side chains of the common style *
% ***********************************************
% *******************
% * gonane, estrane *
% *******************
\def\gonanealpha{\@ifnextchar[{\@gonanealpha}{\@gonanealpha[]}}
\def\@gonanealpha[#1]#2{%
\steroid[#1]{#2;5A==H;8B==H;9A==H;{10}B==H;{13}B==H;{14}A==H}}
\def\gonanebeta{\@ifnextchar[{\@gonanebeta}{\@gonanebeta[]}}
\def\@gonanebeta[#1]#2{%
\steroid[#1]{#2;5B==H;8B==H;9A==H;{10}B==H;{13}B==H;{14}A==H}}
\def\gonane{\@ifnextchar[{\@gonane}{\@gonane[]}}
\def\@gonane[#1]#2{%
\steroid[#1]{#2;8B==H;9A==H;{10}B==H;{13}B==H;{14}A==H}}
\def\estranealpha{\@ifnextchar[{\@estranealpha}{\@estranealpha[]}}
\def\@estranealpha[#1]#2{%
\steroid[#1]{#2;5A==H;8B==H;9A==H;{10}B==H;{13}B==CH$_{3}$;{14}A==H}}
\def\estranebeta{\@ifnextchar[{\@estranebeta}{\@estranebeta[]}}
\def\@estranebeta[#1]#2{
\steroid[#1]{#2;5B==H;8B==H;9A==H;{10}B==H;{13}B==CH$_{3}$;{14}A==H}}
\def\estrane{\@ifnextchar[{\@estrane}{\@estrane[]}}
\def\@estrane[#1]#2{
\steroid[#1]{#2;8B==H;9A==H;{10}B==H;{13}B==CH$_{3}$;{14}A==H}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\steroidnochainandrostane}
% \begin{macro}{\androstane}
% \begin{macro}{\androstanealpha}
% \begin{macro}{\androstanebeta}
%    \begin{macrocode}
% **************
% * androstane *
% **************
\def\steroidnochainandrostane[#1]#2{%
\steroid[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H}}
\def\androstanealpha{\@ifnextchar[{\@androstanealpha}{\@androstanealpha[]}}
\def\@androstanealpha[#1]#2{\steroidnochainandrostane[#1]{#2;5A==H}}
\def\androstanebeta{\@ifnextchar[{\@androstanebeta}{\@androstanebeta[]}}
\def\@androstanebeta[#1]#2{\steroidnochainandrostane[#1]{#2;5B==H}}
\def\androstane{\@ifnextchar[{\@androstane}{\@androstane[]}}
\def\@androstane[#1]#2{\steroidnochainandrostane[#1]{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Steroids with a Ethyl Chain}
% 
% After the definition of the macro |\steroidethylchain| for 
% drawing steroids with an ethyl chain, several commands for 
% drawing pregnane derivative are defined. 
%
% \begin{macro}{\steroidethylchain}
%    \begin{macrocode}
\def\steroidethylchain{\@ifnextchar[{\@steroidethylchain[@}{\@steroidethylchain[Z]}}
\def\@steroidethylchain[#1]#2{%
\@reset@ylsw\reset@@yl
\yl@steroidposition{#2}%
\ylposition{#2}{-21}{0}{3}{0}%for 22 and 23 positions
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi
\else
\ylposition{#2}{-14}{5}{7}{0}%for 20 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi\else
\ylposition{#2}{-20}{3}{5}{0}%for 24 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1397}\def\@@yli{-709}\fi\fi
\if@ylsw
 \yl@shiftii=\@ylii
 \ifx\@@ylii\empty\else
 \advance\yl@shiftii\@@ylii\fi
 \yl@shifti=\@yli
 \ifx\@@yli\empty\else
 \advance\yl@shifti\@@yli\fi
 \advance\yl@shiftii\yl@xdiff
 \advance\yl@shifti\yl@ydiff
 \begin{sfpicture}(0,0)(-\yl@shiftii,-\yl@shifti)%
 \reset@yl@xydiff%1999/1/6 by S. Fujita
\else
 \begin{sfpicture}(1850,1500)(-\shiftii,-\shifti)%
  \iforigpt \typeout{command `steroidethylchain' is based on `steroid'.}\fi%
\fi
  \Put@Direct(0,0){\@steroidskeleton{#1}{#2}}%
  \Put@Line(855,709)(0,1){200}%       %bond 17-20
  \Put@Line(1026,1012)(-5,-3){171}%   %bond 22-20
\@tfor\member:=#1\do{%
\expandafter\twoCH@R\member//\relax%
\if\@tmpa Z\relax%
 \ifx\@tmpb\empty%no action
 \else\if\@tmpb a%
  \Put@Line(888,735)(0,1){148}%       %double bond 17-20
 \else\if\@tmpb b%
  \Put@Line(1020,970)(-5,-3){126}%    %double bond 22-20
  \fi\fi\fi\fi}%
\Put@Direct(1026,606){\setsixringv{#2}{-21}{0}{3}{0}}%for 22 and 23 positions
\Put@Direct(1026,606){\setsixringv{#2}{-14}{5}{7}{0}}%for 20 position
%\Put@Direct(1197,709){\setsixringv{#2}{-20}{3}{5}{0}}%for 24 position
%\Put@Direct(1397,709){\setatombond{#2}{-24}{4}}%      % for 25
\end{sfpicture}}%               %end of \steroidethylchain macro%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\steroidethylchainpregnane}
% \begin{macro}{\pregnane}
% \begin{macro}{\pregnanealpha}
% \begin{macro}{\pregnanebeta}
%    \begin{macrocode}
% ************
% * pregnane *
% ************
\def\steroidethylchainpregnane[#1]#2{%
\steroidethylchain[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{17}SA==\raisebox{-4pt}{~H}}}
\def\pregnanealpha{\@ifnextchar[{\@pregnanealpha}{\@pregnanealpha[]}}
\def\@pregnanealpha[#1]#2{\steroidethylchainpregnane[#1]{#2;5A==H}}
\def\pregnanebeta{\@ifnextchar[{\@pregnanebeta}{\@pregnanebeta[]}}
\def\@pregnanebeta[#1]#2{\steroidethylchainpregnane[#1]{#2;5B==H}}
\def\pregnane{\@ifnextchar[{\@pregnane}{\@pregnane[]}}
\def\@pregnane[#1]#2{\steroidethylchainpregnane[#1]{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Steroids with Chains (Modern Types)}
%
% For drawing steroids with side chains of modern expressions, the command |\steroidChain| 
% is created in addition to the previous command |\steroidchain| for drawing a side chain 
% of an old expression. 
%
% \begin{macro}{\steroidChain}
%    \begin{macrocode}
% ************************************************************
% * Raw Skeleton for drawing side chains of the modern style *
% ************************************************************
\def\steroidChain{\@ifnextchar[{\@steroidChain[@}{\@steroidChain[Z]}}
\def\@steroidChain[#1]#2{%
\@reset@ylsw\reset@@yl
\yl@steroidposition{#2}%
\ylposition{#2}{-21}{0}{3}{0}%for 22 and 23 positions
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi
\else
\ylposition{#2}{-14}{5}{7}{0}%for 20 position
\fi
\if@ylsw
\ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi%%set 20 position
\else
\ylposition{#2}{-23}{0}{2}{0}%for 24 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1368}\def\@@yli{-606}\fi%%set 24 positions
\else
\ylatombondposition{#2}{-24}{4}%      % for 25
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1539}\def\@@yli{-909}\fi%%set 25 positions
\else
\ylatombondposition{#2}{-25}{4}%      % for 26
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1710}\def\@@yli{-1012}\fi%%set 26 positions
\else
\ylatombondposition{#2}{-26}{4}%      % for 27
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1539}\def\@@yli{-709}\fi%%set 27 positions
\fi
\if@ylsw
 \yl@shiftii=\@ylii
 \ifx\@@ylii\empty\else
 \advance\yl@shiftii\@@ylii\fi
 \yl@shifti=\@yli
 \ifx\@@yli\empty\else
 \advance\yl@shifti\@@yli\fi
 \advance\yl@shiftii\yl@xdiff
 \advance\yl@shifti\yl@ydiff
 \begin{sfpicture}(0,0)(-\yl@shiftii,-\yl@shifti)%
 \reset@yl@xydiff%1999/1/6 by S. Fujita
\else
 \begin{sfpicture}(2300,1500)(-\shiftii,-\shifti)%
  \iforigpt \typeout{command `steroidChain' is based on `steroid'.}\fi%
\fi
  \Put@Direct(0,0){\@steroidskeleton{#1}{#2}}%
  \Put@Line(855,709)(0,1){200}%       %bond 17-20
  \Put@Line(1026,1012)(-5,-3){171}%   %bond 22-20
  \Put@Line(1026,1012)(5,-3){171}%    %bond 22-23
  \Put@Line(1197,909)(5,3){171}%      %bond 23-24
  \Put@Line(1368,1012)(5,-3){171}%    %bond 24-25
  \Put@Line(1539,909)(5,3){171}%      %bond 25-26
  \Put@Line(1539,909)(0,-1){200}%      %bond 25-27
\@tfor\member:=#1\do{%
\expandafter\twoCH@R\member//\relax%
\if\@tmpa Z\relax%
 \ifx\@tmpb\empty%no action
 \else\if\@tmpb a%
  \Put@Line(888,735)(0,1){148}%       %double bond 17-20
 \else\if\@tmpb b%
  \Put@Line(1020,970)(-5,-3){126}%    %double bond 22-20
 \else\if\@tmpb c%
  \Put@Line(1032,970)(5,-3){126}%     %double bond 22-23
 \else\if\@tmpb d%
  \Put@Line(1203,952)(5,3){126}%     %double bond 23-24
 \else\if\@tmpb e%
  \Put@Line(1372,970)(5,-3){126}%     %double bond 24-25
 \else\if\@tmpb f%
  \Put@Line(1545,952)(5,3){126}%     %double bond 25-26
 \else\if\@tmpb F%
  \Put@Line(1580,890)(5,3){126}%     %double bond 25-26(alternative)
 \else\if\@tmpb g%
  \Put@Line(1580,890)(0,-1){148}%     %double bond 25-27
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}%
\Put@Direct(1026,606){\setsixringv{#2}{-21}{0}{2}{0}}%for 22 position
\Put@Direct(1192,909){\setsixringv{#2}{-19}{3}{5}{0}}%for 23 position
\Put@Direct(1368,606){\setsixringv{#2}{-23}{0}{2}{0}}%for 24 position
\Put@Direct(1539,909){\setatombond{#2}{-24}{5}}%     % for 25
\Put@Direct(1026,606){\setsixringv{#2}{-14}{5}{7}{0}}%for 20 position
\end{sfpicture}}%               %end of \steroidChain macro%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\steroidChaindiMe}
%    \begin{macrocode}
\def\steroidChaindiMe[#1]#2{%
\steroidChain[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{17}SA==\raisebox{-4pt}{~H};{20}SA==H$_{3}$C;{20}SB==H}}
%    \end{macrocode}
% \end{macro}
% 
% Sometimes,  |\cholestane[{Z}{Zb}]{}| may be used in place of 
% |\cholestane[{Zb}]{}| because the latter gives an erroneous 
% result. 
% 
%
% \begin{macro}{\cholestaneAlpha}
% \begin{macro}{\cholestaneBeta}
% \begin{macro}{\cholestane}
% \begin{macro}{\ergostaneAlpha}
% \begin{macro}{\ergostaneBeta}
% \begin{macro}{\ergostane}
% \begin{macro}{\campestaneAlpha}
% \begin{macro}{\campestaneBeta}
% \begin{macro}{\campestane}
% \begin{macro}{\poriferastaneAlpha}
% \begin{macro}{\poriferastaneBeta}
% \begin{macro}{\poriferastane}
% \begin{macro}{\stigmastaneAlpha}
% \begin{macro}{\stigmastaneBeta}
% \begin{macro}{\stigmastane}
%    \begin{macrocode}
% *****************************************************
% * Intermediate skeletons for drawing                *
% * cholestane, ergostane, campestane, poriferastane, *
% * and stigmastane (the modern type)                 *
% *****************************************************
\def\cholestaneAlpha{\@ifnextchar[{\@cholestaneAlpha}{\@cholestaneAlpha[]}}
\def\@cholestaneAlpha[#1]#2{\steroidChaindiMe[#1]{#2;5A==H}}
\def\cholestaneBeta{\@ifnextchar[{\@cholestaneBeta}{\@cholestaneBeta[]}}
\def\@cholestaneBeta[#1]#2{\steroidChaindiMe[#1]{#2;5B==H}}
\def\cholestane{\@ifnextchar[{\@cholestane}{\@cholestane[]}}
\def\@cholestane[#1]#2{\steroidChaindiMe[#1]{#2}}
\def\ergostaneAlpha{\@ifnextchar[{\@ergostaneAlpha}{\@ergostaneAlpha[]}}
\def\@ergostaneAlpha[#1]#2{%
\@cholestaneAlpha[#1]{#2;{24}SA==CH$_{3}$;{24}SB==H}}
\def\ergostaneBeta{\@ifnextchar[{\@ergostaneBeta}{\@ergostaneBeta[]}}
\def\@ergostaneBeta[#1]#2{%
\@cholestaneBeta[#1]{#2;{24}SA==CH$_{3}$;{24}SB==H}}
\def\ergostane{\@ifnextchar[{\@ergostane}{\@ergostane[]}}
\def\@ergostane[#1]#2{%
\@cholestane[#1]{#2;{24}SA==CH$_{3}$;{24}SB==H}}
\def\campestaneAlpha{\@ifnextchar[{\@campestaneAlpha}{\@campestaneAlpha[]}}
\def\@campestaneAlpha[#1]#2{%
\@cholestaneAlpha[#1]{#2;{24}Su==\mbox{C\rlap{H$_{3}$}\kern20\unitlength};{24}Sd==~H}}
\def\campestaneBeta{\@ifnextchar[{\@campestaneBeta}{\@campestaneBeta[]}}
\def\@campestaneBeta[#1]#2{%
\@cholestaneBeta[#1]{#2;{24}Su==\mbox{C\rlap{H$_{3}$}\kern20\unitlength};{24}Sd==~H}}
\def\campestane{\@ifnextchar[{\@campestane}{\@campestane[]}}
\def\@campestane[#1]#2{%
\@cholestane[#1]{#2;{24}Su==\mbox{C\rlap{H$_{3}$}\kern20\unitlength};{24}Sd==~H}}
\def\poriferastaneAlpha{\@ifnextchar[{\@poriferastaneAlpha}{\@poriferastaneAlpha[]}}
\def\@poriferastaneAlpha[#1]#2{%
\@cholestaneAlpha[#1]{#2;{24}SA==\dimethylene{}{1==(yl)};{24}SB==H}}
\def\poriferastaneBeta{\@ifnextchar[{\@poriferastaneBeta}{\@poriferastaneBeta[]}}
\def\@poriferastaneBeta[#1]#2{%
\@cholestaneBeta[#1]{#2;{24}SA==\dimethylene{}{1==(yl)};{24}SB==H}}
\def\poriferastane{\@ifnextchar[{\@poriferastane}{\@poriferastane[]}}
\def\@poriferastane[#1]#2{%
\@cholestane[#1]{#2;{24}SA==\dimethylene{}{1==(yl)};{24}SB==H}}
\def\stigmastaneAlpha{\@ifnextchar[{\@stigmastaneAlpha}{\@stigmastaneAlpha[]}}
\def\@stigmastaneAlpha[#1]#2{%
\@cholestaneAlpha[#1]{#2;{24}Su==\dimethylene{}{1==(yl)};{24}Sd==H}}
\def\stigmastaneBeta{\@ifnextchar[{\@stigmastaneBeta}{\@stigmastaneBeta[]}}
\def\@stigmastaneBeta[#1]#2{%
\@cholestaneBeta[#1]{#2;{24}Su==\dimethylene{}{1==(yl)};{24}Sd==H}}
\def\stigmastane{\@ifnextchar[{\@stigmastane}{\@stigmastane[]}}
\def\@stigmastane[#1]#2{%
\@cholestane[#1]{#2;{24}Su==\dimethylene{}{1==(yl)};{24}Sd==H}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Steroids with Short Chains (Modern Types)}
%
%
% \begin{macro}{\steroidShortChain}
%    \begin{macrocode}
% ******************************************************************
% * Raw Skeleton for drawing short side chains of the modern style *
% ******************************************************************
\def\steroidShortChain{\@ifnextchar[{\@steroidShortChain[@}{\@steroidShortChain[Z]}}
\def\@steroidShortChain[#1]#2{%
\@reset@ylsw\reset@@yl
\yl@steroidposition{#2}%
\ylposition{#2}{-21}{0}{3}{0}%for 22 and 23 positions
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi
\else
\ylposition{#2}{-14}{5}{7}{0}%for 20 position
\fi
\if@ylsw
\ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi%%set 20 position
\else
\ylposition{#2}{-23}{0}{2}{0}%for 24 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1368}\def\@@yli{-606}\fi%%set 24 positions
\fi
\if@ylsw
 \yl@shiftii=\@ylii
 \ifx\@@ylii\empty\else
 \advance\yl@shiftii\@@ylii\fi
 \yl@shifti=\@yli
 \ifx\@@yli\empty\else
 \advance\yl@shifti\@@yli\fi
 \advance\yl@shiftii\yl@xdiff
 \advance\yl@shifti\yl@ydiff
 \begin{sfpicture}(0,0)(-\yl@shiftii,-\yl@shifti)%
 \reset@yl@xydiff%1999/1/6 by S. Fujita
\else
 \begin{sfpicture}(2000,1500)(-\shiftii,-\shifti)%
  \iforigpt \typeout{command `steroidChain' is based on `steroid'.}\fi%
\fi
  \Put@Direct(0,0){\@steroidskeleton{#1}{#2}}%
  \Put@Line(855,709)(0,1){200}%       %bond 17-20
  \Put@Line(1026,1012)(-5,-3){171}%   %bond 22-20
  \Put@Line(1026,1012)(5,-3){171}%    %bond 22-23
  \Put@Line(1197,909)(5,3){171}%      %bond 23-24
\@tfor\member:=#1\do{%
\expandafter\twoCH@R\member//\relax%
\if\@tmpa Z\relax%
 \ifx\@tmpb\empty%no action
 \else\if\@tmpb a%
  \Put@Line(888,735)(0,1){148}%       %double bond 17-20
 \else\if\@tmpb b%
  \Put@Line(1020,970)(-5,-3){126}%    %double bond 22-20
 \else\if\@tmpb c%
  \Put@Line(1032,970)(5,-3){126}%     %double bond 22-23
 \else\if\@tmpb d%
  \Put@Line(1203,952)(5,3){126}%     %double bond 23-24
  \fi\fi\fi\fi\fi\fi}%
\Put@Direct(1026,606){\setsixringv{#2}{-21}{0}{2}{0}}%for 22 position
\Put@Direct(1192,909){\setsixringv{#2}{-19}{3}{5}{0}}%for 23 position
\Put@Direct(1368,606){\setsixringv{#2}{-23}{0}{2}{0}}%for 24 position
%\Put@Direct(1539,909){\setatombond{#2}{-24}{5}}%     % for 25
\Put@Direct(1026,606){\setsixringv{#2}{-14}{5}{7}{0}}%for 20 position
\end{sfpicture}}%               %end of \steroidShortChain macro%
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\steroidShortChainMe}
%    \begin{macrocode}
\def\steroidShortChainMe[#1]#2{%
\steroidShortChain[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{17}SA==\raisebox{-4pt}{~H};{20}SA==H$_{3}$C;{20}SB==H}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\cholaneAlpha}
% \begin{macro}{\cholaneBeta}
% \begin{macro}{\cholane}
%    \begin{macrocode}
% *****************************************************************
% * Intermediate skeletons for drawing choranes (the modern type) *
% *****************************************************************
\def\cholaneAlpha{\@ifnextchar[{\@cholaneAlpha}{\@cholaneAlpha[]}}
\def\@cholaneAlpha[#1]#2{\steroidShortChainMe[#1]{#2;5A==H}}
\def\cholaneBeta{\@ifnextchar[{\@cholaneBeta}{\@cholaneBeta[]}}
\def\@cholaneBeta[#1]#2{\steroidShortChainMe[#1]{#2;5B==H}}
\def\cholane{\@ifnextchar[{\@cholane}{\@cholane[]}}
\def\@cholane[#1]#2{\steroidShortChainMe[#1]{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Steroids with Short Chains (Old Types)}
% 
% \begin{macro}{\steroidshortchain}
%    \begin{macrocode}
% ******************************************************
% * Raw skeletons drawing side chains of the old style *
% ******************************************************
\def\steroidshortchain{\@ifnextchar[{\@steroidshortchain[@}{\@steroidshortchain[Z]}}
\def\@steroidshortchain[#1]#2{%
\@reset@ylsw\reset@@yl
\yl@steroidposition{#2}%
\ylposition{#2}{-21}{0}{3}{0}%for 22 and 23 positions
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi
\else
\ylposition{#2}{-14}{5}{7}{0}%for 20 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi\else
\ylposition{#2}{-20}{3}{5}{0}%for 24 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1397}\def\@@yli{-709}\fi\fi
\if@ylsw
 \yl@shiftii=\@ylii
 \ifx\@@ylii\empty\else
 \advance\yl@shiftii\@@ylii\fi
 \yl@shifti=\@yli
 \ifx\@@yli\empty\else
 \advance\yl@shifti\@@yli\fi
 \advance\yl@shiftii\yl@xdiff
 \advance\yl@shifti\yl@ydiff
 \begin{sfpicture}(0,0)(-\yl@shiftii,-\yl@shifti)%
 \reset@yl@xydiff%1999/1/6 by S. Fujita
\else
 \begin{sfpicture}(1850,1500)(-\shiftii,-\shifti)%
  \iforigpt \typeout{command `steroidshortchain' is based on `steroid'.}\fi%
\fi
  \Put@Direct(0,0){\@steroidskeleton{#1}{#2}}%
  \Put@Line(855,709)(0,1){200}%       %bond 17-20
  \Put@Line(1026,1012)(-5,-3){171}%   %bond 22-20
  \Put@Line(1026,1012)(5,-3){171}%    %bond 22-23
  \Put@Line(1197,709)(0,1){200}%      %bond 24-23
\@tfor\member:=#1\do{%
\expandafter\twoCH@R\member//\relax%
\if\@tmpa Z\relax%
 \ifx\@tmpb\empty%no action
 \else\if\@tmpb a%
  \Put@Line(888,735)(0,1){148}%       %double bond 17-20
 \else\if\@tmpb b%
  \Put@Line(1020,970)(-5,-3){126}%    %double bond 22-20
 \else\if\@tmpb c%
  \Put@Line(1032,970)(5,-3){126}%     %double bond 22-23
 \else\if\@tmpb d%
  \Put@Line(1164,735)(0,1){148}%      %double bond 24-23
 \fi\fi\fi\fi\fi\fi}%
\Put@Direct(1026,606){\setsixringv{#2}{-21}{0}{3}{0}}%for 22 and 23 positions
\Put@Direct(1026,606){\setsixringv{#2}{-14}{5}{7}{0}}%for 20 position
\Put@Direct(1197,709){\setsixringv{#2}{-20}{3}{5}{0}}%for 24 position
\end{sfpicture}}%               %end of \steroidshortchain macro%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\steroidshortchainMe}
% \begin{macro}{\cholanealpha}
% \begin{macro}{\cholanebeta}
% \begin{macro}{\cholanE}
%    \begin{macrocode}
% ***********
% * cholane *
% ***********
\def\steroidshortchainMe[#1]#2{%
\steroidshortchain[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{17}SA==\raisebox{-4pt}{~H};{20}SA==H$_{3}$C;{20}SB==H}}
\def\cholanealpha{\@ifnextchar[{\@cholanealpha}{\@cholanealpha[]}}
\def\@cholanealpha[#1]#2{\steroidshortchainMe[#1]{#2;5A==H}}
\def\cholanebeta{\@ifnextchar[{\@cholanebeta}{\@cholanebeta[]}}
\def\@cholanebeta[#1]#2{\steroidshortchainMe[#1]{#2;5B==H}}
\def\cholanE{\@ifnextchar[{\@cholanE}{\@cholanE[]}}
\def\@cholanE[#1]#2{\steroidshortchainMe[#1]{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Steroids with Chains (Old Types)}
%
% For drawing steroids with side chains of old expressions, the command |\steroidchain| 
% defined in {\sf carom.sty} is used. 
%
% \begin{macro}{\steroidchaindiMe}
% \begin{macro}{\cholestanealpha}
% \begin{macro}{\cholestanebeta}
% \begin{macro}{\cholestanE}
% \begin{macro}{\ergostanealpha}
% \begin{macro}{\ergostanebeta}
% \begin{macro}{\ergostanE}
% \begin{macro}{\campestanealpha}
% \begin{macro}{\campestanebeta}
% \begin{macro}{\campestanE}
%    \begin{macrocode}
% ************************************************
% * cholestane, ergostane, campestane (old type) *
% ************************************************
\def\steroidchaindiMe[#1]#2{%
\steroidchain[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{17}SA==\raisebox{-4pt}{~H};{20}SA==H$_{3}$C;{20}SB==H}}
\def\cholestanealpha{\@ifnextchar[{\@cholestanealpha}{\@cholestanealpha[]}}
\def\@cholestanealpha[#1]#2{\steroidchaindiMe[#1]{#2;5A==H}}
\def\cholestanebeta{\@ifnextchar[{\@cholestanebeta}{\@cholestanebeta[]}}
\def\@cholestanebeta[#1]#2{\steroidchaindiMe[#1]{#2;5B==H}}
\def\cholestanE{\@ifnextchar[{\@cholestanE}{\@cholestanE[]}}
\def\@cholestanE[#1]#2{\steroidchaindiMe[#1]{#2}}
\def\ergostanealpha{\@ifnextchar[{\@ergostanealpha}{\@ergostanealpha[]}}
\def\@ergostanealpha[#1]#2{%
\@cholestanealpha[#1]{#2;{24}Su==CH$_{3}$;{24}Sd==H}}
\def\ergostanebeta{\@ifnextchar[{\@ergostanebeta}{\@ergostanebeta[]}}
\def\@ergostanebeta[#1]#2{%
\@cholestanebeta[#1]{#2;{24}Su==CH$_{3}$;{24}Sd==H}}
\def\ergostanE{\@ifnextchar[{\@ergostanE}{\@ergostanE[]}}
\def\@ergostanE[#1]#2{%
\@cholestanE[#1]{#2;{24}Su==CH$_{3}$;{24}Sd==H}}
\def\campestanealpha{\@ifnextchar[{\@campestanealpha}{\@campestanealpha[]}}
\def\@campestanealpha[#1]#2{%
\@cholestanealpha[#1]{#2;{24}Sd==\mbox{C\rlap{H$_{3}$}\kern20\unitlength};{24}Su==~H}}
\def\campestanebeta{\@ifnextchar[{\@campestanebeta}{\@campestanebeta[]}}
\def\@campestanebeta[#1]#2{%
\@cholestanebeta[#1]{#2;{24}Sd==\mbox{C\rlap{H$_{3}$}\kern20\unitlength};{24}Su==~H}}
\def\campestanE{\@ifnextchar[{\@campestanE}{\@campestanE[]}}
\def\@campestanE[#1]#2{%
\@cholestanE[#1]{#2;{24}Sd==\mbox{C\rlap{H$_{3}$}\kern20\unitlength};{24}Su==~H}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\poriferastanealpha}
% \begin{macro}{\poriferastanebeta}
% \begin{macro}{\poriferastanE}
% \begin{macro}{\stigmastanealpha}
% \begin{macro}{\stigmastanebeta}
% \begin{macro}{\stigmastanE}
%    \begin{macrocode}
% *****************************************
% * poriferastane, stigmastane (old type) *
% *****************************************
\def\poriferastanealpha{\@ifnextchar[{\@poriferastanealpha}{\@poriferastanealpha[]}}
\def\@poriferastanealpha[#1]#2{%
\@cholestanealpha[#1]{#2;{24}Su==\dimethylenei{}{1==(yl)};{24}Sd==H}}
\def\poriferastanebeta{\@ifnextchar[{\@poriferastanebeta}{\@poriferastanebeta[]}}
\def\@poriferastanebeta[#1]#2{%
\@cholestanebeta[#1]{#2;{24}Su==\dimethylenei{}{1==(yl)};{24}Sd==H}}
\def\poriferastanE{\@ifnextchar[{\@poriferastanE}{\@poriferastanE[]}}
\def\@poriferastanE[#1]#2{%
\@cholestanE[#1]{#2;{24}Su==\dimethylenei{}{1==(yl)};{24}Sd==H}}
\def\stigmastanealpha{\@ifnextchar[{\@stigmastanealpha}{\@stigmastanealpha[]}}
\def\@stigmastanealpha[#1]#2{%
\@cholestanealpha[#1]{#2;{24}SA==\dimethylenei{}{1==(yl)};{24}SB==H}}
\def\stigmastanebeta{\@ifnextchar[{\@stigmastanebeta}{\@stigmastanebeta[]}}
\def\@stigmastanebeta[#1]#2{%
\@cholestanebeta[#1]{#2;{24}SA==\dimethylenei{}{1==(yl)};{24}SB==H}}
\def\stigmastanE{\@ifnextchar[{\@stigmastanE}{\@stigmastanE[]}}
\def\@stigmastanE[#1]#2{%
\@cholestanE[#1]{#2;{24}SA==\dimethylenei{}{1==(yl)};{24}SB==H}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Spirostans}
%
% After the macro |\steroidspiro| is defined as a basic macro 
% several macros for drawing spirostans are defined. 
%
% \begin{macro}{\steroidspiro}
%    \begin{macrocode}
% ***************************************
% * Raw skeleton for drawing spirostans * 
% ***************************************
\def\steroidspiro{\@ifnextchar[{\@steroidspiro[@}{\@steroidspiro[Z]}}
\def\@steroidspiro[#1]#2{%
\@reset@ylsw\reset@@yl
\yl@steroidposition{#2}%
\ylposition{#2}{-20}{1}{3}{0}%for 22 position
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi
\else
\ylposition{#2}{-14}{5}{7}{0}%for 20 position
\fi
\if@ylsw
\ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi%%set 20 position
\else
\ylposition{#2}{-22}{0}{2}{0}%for 23 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1368}\def\@@yli{-400}\fi%%set 23 position
\else
\ylatombondposition{#2}{-23}{4}%      % for 24
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1539}\def\@@yli{-909}\fi%%set 24 position
\else
\ylatombondposition{#2}{-24}{4}%      % for 25
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1539}\def\@@yli{-1109}\fi%%set 25 position
\else
\ylatombondposition{#2}{-25}{4}%      % for 26
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1368}\def\@@yli{-1212}\fi%%set 26 position
\fi
\if@ylsw
 \yl@shiftii=\@ylii
 \ifx\@@ylii\empty\else
 \advance\yl@shiftii\@@ylii\fi
 \yl@shifti=\@yli
 \ifx\@@yli\empty\else
 \advance\yl@shifti\@@yli\fi
 \advance\yl@shiftii\yl@xdiff
 \advance\yl@shifti\yl@ydiff
 \begin{sfpicture}(0,0)(-\yl@shiftii,-\yl@shifti)%
 \reset@yl@xydiff%1999/1/6 by S. Fujita
\else
 \begin{sfpicture}(2300,1500)(-\shiftii,-\shifti)%
  \iforigpt \typeout{command `steroidspiro' is based on `steroid'.}\fi%
\fi
  \Put@Direct(0,0){\@steroidskeleton{#1}{#2}}%
  \Put@Line(855,709)(0,1){200}%       %bond 17-20
  \Put@Line(855,909)(1,0){342}%       %bond 20-22
  \Put@Line(1197,909)(0,-1){140}%       %bond 22-O (down)
  \Put@Line(1026,606)(5,3){120}%       %bond 16-O
  \Put@Direct(1197,709){\makebox(0,0){O}}%
  \dotorline(1197,909)(0,1){140}/(1197,909)(1197,1049)% 22-O (up)
  {\thicklines
  \Put@Line(1197,909)(5,-3){171}%       %bond 22-23
  }%
  \Put@Line(1539,909)(-5,-3){171}%       %bond 24-23
  \Put@Line(1539,909)(0,1){200}%       %bond 24-25
  \Put@Line(1539,1109)(-5,3){171}%       %bond 25-26
  \Put@Line(1368,1212)(-5,-3){120}%       %bond 26-O (down)
  \Put@Direct(1197,1109){\makebox(0,0){O}}%
\@tfor\member:=#1\do{%
\expandafter\twoCH@R\member//\relax%
\if\@tmpa Z\relax%
 \ifx\@tmpb\empty%no action
 \else\if\@tmpb a%
  \Put@Line(888,735)(0,1){148}%       %double bond 17-20
 \else\if\@tmpb b%
  \Put@Line(888,880)(1,0){276}%    %double bond 20-22
 \else\if\@tmpb c%
  \Put@Line(1164,880)(0,-1){116}%    %double bond 22-O
 \else\if\@tmpb d%
  \Put@Line(1039,650)(5,3){100}%       %double bond 16-O
 \else\if\@tmpb e%
  \Put@Line(1240,930)(5,-3){126}%    %double bond 22-23
 \else\if\@tmpb f%
  \Put@Line(1366,848)(5,3){140}%     %double bond 23-24
 \else\if\@tmpb g%
  \Put@Line(1504,930)(0,1){148}%     %double bond 24-25
 \else\if\@tmpb h%
  \Put@Line(1366,1166)(5,-3){140}%     %double bond 26-25
 \else\if\@tmpb i%
  \Put@Line(1366,1166)(-5,-3){110}%     %double bond 26-O
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}%
\Put@Direct(1026,606){\setsixringv{#2}{-14}{5}{7}{0}}%for 20 position
\Put@Direct(1026,606){\setsixringv{#2}{-112}{4}{6}{0}}%for 17 position (117 as Exception)
\Put@Direct(1368,806){\setsixringv{#2}{-25}{0}{2}{0}}%for 26
\Put@Direct(1368,806){\setsixringv{#2}{-23}{1}{3}{0}}%for 25
\Put@Direct(1368,806){\setsixringv{#2}{-21}{2}{4}{0}}%for 24
\Put@Direct(1368,806){\setsixringv{#2}{-19}{3}{5}{0}}%for 23
\end{sfpicture}}%               %end of \steroidspiro macro%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\steroidspirotriMe}
% \begin{macro}{\spirostanalpha}
% \begin{macro}{\spirostanbeta}
% \begin{macro}{\spirostan}
% \begin{macro}{\spirostannor}
%    \begin{macrocode}
% **************
% * spirostans * 
% **************
\def\steroidspirotriMe[#1]#2{%
\steroidspiro[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{117}FA==H;{20}A==H$_{3}$C;{16}FA==H}}
\def\spirostanalpha{\@ifnextchar[{\@spirostanalpha}{\@spirostanalpha[]}}
\def\@spirostanalpha[#1]#2{\steroidspirotriMe[#1]{#2;5A==H;{25}B==CH$_{3}$}}
\def\spirostanbeta{\@ifnextchar[{\@spirostanbeta}{\@spirostanbeta[]}}
\def\@spirostanbeta[#1]#2{\steroidspirotriMe[#1]{#2;5B==H;{25}B==CH$_{3}$}}
\def\spirostan{\@ifnextchar[{\@spirostan}{\@spirostan[]}}
\def\@spirostan[#1]#2{\steroidspirotriMe[#1]{#2;{{25}}==\null}}
\def\spirostannor{\@ifnextchar[{\@spirostannor}{\@spirostannor[]}}
\def\@spirostannor[#1]#2{\steroidspirotriMe[#1]{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Furostans}
%
% After the macro |\steroidfuros| is defined as a basic macro, 
% several macros for drawing furostans are defined. 
%
% \begin{macro}{\steroidfuros}
%    \begin{macrocode}
% **************************************
% * Raw skeleton for drawing furostans * 
% **************************************
\def\steroidfuros{\@ifnextchar[{\@steroidfuros[@}{\@steroidfuros[Z]}}
\def\@steroidfuros[#1]#2{%
\@reset@ylsw\reset@@yl
\yl@steroidposition{#2}%
\ylposition{#2}{-20}{1}{3}{0}%for 22 position
\if@ylsw \ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi
\else
\ylposition{#2}{-14}{5}{7}{0}%for 20 position
\fi
\if@ylsw
\ifx\@@ylii\empty
\def\@@ylii{-1026}\def\@@yli{-606}\fi%%set 20 position
\else
\ylposition{#2}{-22}{0}{2}{0}%for 23 position
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1368}\def\@@yli{-606}\fi%%set 23 position
\else
\ylatombondposition{#2}{-23}{4}%      % for 24
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1539}\def\@@yli{-909}\fi%%set 24 position
\else
\ylatombondposition{#2}{-24}{4}%      % for 25
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1710}\def\@@yli{-1012}\fi%%set 25 position
\else
\ylatombondposition{#2}{-25}{4}%      % for 26
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1710}\def\@@yli{-1212}\fi%%set 26 position
\else
\ylatombondposition{#2}{-26}{4}%      % for 27
\fi
\if@ylsw\ifx\@@ylii\empty
\def\@@ylii{-1881}\def\@@yli{-909}\fi%%set 27 position
\fi
\if@ylsw
 \yl@shiftii=\@ylii
 \ifx\@@ylii\empty\else
 \advance\yl@shiftii\@@ylii\fi
 \yl@shifti=\@yli
 \ifx\@@yli\empty\else
 \advance\yl@shifti\@@yli\fi
 \advance\yl@shiftii\yl@xdiff
 \advance\yl@shifti\yl@ydiff
 \begin{sfpicture}(0,0)(-\yl@shiftii,-\yl@shifti)%
 \reset@yl@xydiff%1999/1/6 by S. Fujita
\else
 \begin{sfpicture}(2300,1500)(-\shiftii,-\shifti)%
  \iforigpt \typeout{command `steroidfuros' is based on `steroid'.}\fi%
\fi
  \Put@Direct(0,0){\@steroidskeleton{#1}{#2}}%
  \Put@Line(855,709)(0,1){200}%       %bond 17-20
  \Put@Line(855,909)(1,0){342}%       %bond 20-22
  \Put@Line(1197,909)(0,-1){140}%       %bond 22-O (down)
  \Put@Line(1026,606)(5,3){120}%       %bond 16-O
  \Put@Direct(1197,709){\makebox(0,0){O}}%
  \Put@Line(1197,909)(5,3){171}%       %bond 22-23
  \Put@Line(1368,1012)(5,-3){171}%       %bond 23-24
  \Put@Line(1539,909)(5,3){171}%       %bond 24-25
  \Put@Line(1710,1012)(5,-3){171}%       %bond 25-27
  \Put@Line(1710,1012)(0,1){200}%       %bond 25-27
\@tfor\member:=#1\do{%
\expandafter\twoCH@R\member//\relax%
\if\@tmpa Z\relax%
 \ifx\@tmpb\empty%no action
 \else\if\@tmpb a%
  \Put@Line(888,735)(0,1){148}%       %double bond 17-20
 \else\if\@tmpb b%
  \Put@Line(888,880)(1,0){276}%    %double bond 20-22
 \else\if\@tmpb c%
  \Put@Line(1164,880)(0,-1){116}%    %double bond 22-O
 \else\if\@tmpb d%
  \Put@Line(1039,650)(5,3){100}%       %double bond 16-O
 \else\if\@tmpb e%
  \Put@Line(1240,900)(5,3){126}%    %double bond 22-23
 \else\if\@tmpb f%
  \Put@Line(1410,1022)(5,-3){126}%     %double bond 23-24
 \else\if\@tmpb g%
  \Put@Line(1582,900)(5,3){126}%    %double bond 24-25
 \else\if\@tmpb h%
  \Put@Line(1740,1035)(0,1){150}%     %double bond 25-26
 \else\if\@tmpb i%
  \Put@Line(1752,1022)(5,-3){126}%     %double bond 25-27
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}%
\Put@Direct(1026,606){\setsixringv{#2}{-14}{5}{7}{0}}%for 20 position
\Put@Direct(1026,606){\setsixringv{#2}{-112}{4}{6}{0}}%for 17 position (117 as Exception)
\Put@Direct(1197,503){\setsixringv{#2}{-21}{0}{2}{0}}%for 22 
\Put@Direct(1368,606){\setsixringv{#2}{-22}{0}{2}{0}}%for 23
\Put@Direct(1539,909){\setsixringv{#2}{-20}{3}{5}{0}}%for 24
\Put@Direct(1710,1012){\setatombond{#2}{-24}{3}}%      % for 25
\Put@Direct(1539,909){\setsixringv{#2}{-24}{1}{3}{0}}%for 26
\Put@Direct(1710,606){\setsixringv{#2}{-25}{1}{3}{0}}%for 27
\end{sfpicture}}%               %end of \steroidfuros macro%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\steroidfurostriMe}
% \begin{macro}{\furostanalpha}
% \begin{macro}{\furostanbeta}
% \begin{macro}{\furostan}
%    \begin{macrocode}
% *************
% * furostans *
% *************
\def\steroidfurostriMe[#1]#2{%
\steroidfuros[#1]{#2;8B==H;9A==H;{10}B==CH$_{3}$;{13}B==CH$_{3}$;{14}A==H;%
{117}FA==H;{20}A==H$_{3}$C;{16}FA==H}}
\def\furostanalpha{\@ifnextchar[{\@furostanalpha}{\@furostanalpha[]}}
\def\@furostanalpha[#1]#2{\steroidfurostriMe[#1]{#2;5A==H}}
\def\furostanbeta{\@ifnextchar[{\@furostanbeta}{\@furostanbeta[]}}
\def\@furostanbeta[#1]#2{\steroidfurostriMe[#1]{#2;5B==H}}
\def\furostan{\@ifnextchar[{\@furostan}{\@furostan[]}}
\def\@furostan[#1]#2{\steroidfurostriMe[#1]{#2}}
%</steroid>
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Macros for Spiro Pyranoses}
%
% The macro |\pyranoseChairi| is defined to draw steroid with spiro pyranose rings 
% The switch |\pyranoseChairalphatrue| is declared to draw an alpha bond (a dashed line). 
%
% \begin{macro}{\ifpyranoseChairalpha}
% \begin{macro}{\pyranoseChairi}
%    \begin{macrocode}
\newif\ifpyranoseChairalpha 
\pyranoseChairalphatrue
\def\pyranoseChairi{\@ifnextchar[{\@pyranoseChairi}{\@pyranoseChairi[r]}}
\def\@pyranoseChairi[#1]#2{%
\@reset@ylsw%
\ylchairiposition{#2}%
\def\@@ylii{0}\def\@@yli{0}%
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1600,800)(-400,-319){chairi}%
(400,319)%2002/4/30 by S. Fujita
% skeletal bonds
   \thinlines%
\ifpyranoseChairalpha
  \dotorline(0,0)(3,4){140}/(0,0)(140,187)% bond 1 to 6
\else
      \Put@Line(0,0)(3,4){140}%         % bond 1 to 6
\fi
      \Put@Line(573,91)(-3,1){360}%      %      5 to 6
      \Put@Direct(130,190){O}%
      \Put@Line(573,91)(3,1){270}%      %      5 to 4
   {\thicklines%
    \molfronttrue%
      \Put@Line(843,181)(-3,-4){170}%    %      4 to 3
      \Put@Line(673,-46)(-3,1){403}%     %      3 to 2
      \Put@Line(0,0)(3,1){270}%          %      1 to 2
   }%
   \thinlines%
% inner double bonds
\@tfor\member:=#1\do{%
\if\member r%no endcyclic bonds
\else \if\member c%%%a%
       \Put@Line(767,139)(-3,-4){110}%   % double bond 3 to 4
\else \if\member b%%%d%%%b%
      \Put@Line(640,-5)(-3,1){343}%      %             4 to 5
\else \if\member a%%%e%%%%c%
       \Put@Line(240,111)(-3,-1){190}%   %             5 to 6
\else \if\member f%%%d%
      \Put@Line(63,40)(3,4){110}%        %             6 to 7
\else \if\member e%%%l%
      \Put@Line(182,187)(3,-1){343}%     %             7 to 10
\else \if\member d%%%k%%%f%
      \Put@Line(768,131)(-3,-1){170}%    %             10 to 3
\fi\fi\fi\fi\fi\fi\fi}%
% %
\@forsemicol\member:=#2\do{%
\ifx\member\empty\else
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}%
\ifx\@memberb\@yl\else
\ifcase\@tmpa%0 omit
 \or \@chairia% subst. on 1
 \or \@chairib% subst. on 2
 \or \@chairic% subst. on 3
 \or \@chairid% subst. on 4
 \or \@chairie% subst. on 5
 \or \@chairif% subst. on 6
\fi %end of ifcase
\fi\fi%
}\end{ShiftPicEnvB}}%               %end of \pyranoseChairi macro
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% The macro |\pyranoseChairii| is defined to draw steroid with spiro pyranose rings 
%
% \begin{macro}{\pyranoseChairi}
%    \begin{macrocode}
\def\pyranoseChairii{\@ifnextchar[{\@pyranoseChairii}{\@pyranoseChairii[r]}}
\def\@pyranoseChairii[#1]#2{%
\@reset@ylsw%
\ylchairiposition{#2}%
\def\@@ylii{0}\def\@@yli{0}%
\begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/%
(1600,800)(-400,-319){chairi}%
(400,319)%2002/4/30 by S. Fujita
% skeletal bonds
   \thinlines%
\ifpyranoseChairalpha
  \dotorline(0,0)(3,4){170}/(0,0)(170,227)% bond 1 to 6
\else
      \Put@Line(0,0)(3,4){170}%         % bond 1 to 6
\fi
      \Put@Line(170,226)(3,-1){403}%    %      6 to 5
      \Put@Line(573,91)(3,1){270}%      %      5 to 4
      \Put@Direct(230,50){O}%
   {\thicklines%
    \molfronttrue%
      \Put@Line(843,181)(-3,-4){170}%    %      4 to 3
      \Put@Line(673,-46)(-3,1){360}%     %      3 to 2
      \Put@Line(0,0)(3,1){230}%          %      1 to 2
   }%
   \thinlines%
% inner double bonds
\@tfor\member:=#1\do{%
\if\member r%no endcyclic bonds
\else \if\member c%%%a%
       \Put@Line(767,139)(-3,-4){110}%   % double bond 3 to 4
\else \if\member b%%%d%%%b%
      \Put@Line(640,-5)(-3,1){343}%      %             4 to 5
\else \if\member a%%%e%%%%c%
       \Put@Line(240,111)(-3,-1){190}%   %             5 to 6
\else \if\member f%%%d%
      \Put@Line(63,40)(3,4){110}%        %             6 to 7
\else \if\member e%%%l%
      \Put@Line(182,187)(3,-1){343}%     %             7 to 10
\else \if\member d%%%k%%%f%
      \Put@Line(768,131)(-3,-1){170}%    %             10 to 3
\fi\fi\fi\fi\fi\fi\fi}%
% %
\@forsemicol\member:=#2\do{%
\ifx\member\empty\else
\expandafter\@m@mb@r\member;\relax%
\expandafter\threech@r\@membera{}{}%
\ifx\@memberb\@yl\else
\ifcase\@tmpa%0 omit
 \or \@chairia% subst. on 1
 \or \@chairib% subst. on 2
 \or \@chairic% subst. on 3
 \or \@chairid% subst. on 4
 \or \@chairie% subst. on 5
 \or \@chairif% subst. on 6
\fi %end of ifcase
\fi\fi%
}\end{ShiftPicEnvB}}%               %end of \pyranoseChairii macro
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.00}{2009/6/15}{Creating \cs{cholestanealfa} etc.}
%
% \Finale
%
\endinput
