%%
%% This is file `chemstyle.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% chemstyle.dtx  (with options: `package')
%%  ----------------------------------------------------------------
%%  The chemstyle package --- Writing chemistry with style
%%  Maintained by Joseph Wright
%%  E-mail: joseph.wright@morningstar2.co.uk
%%  Released under the LaTeX Project Public License v1.3 or later
%%  See http://www.latex-project.org/lppl.txt
%%  ----------------------------------------------------------------
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{chemstyle}
  [2007/10/31 v1.1h Writing chemistry with style]
\RequirePackage{graphicx,varioref,caption}
\let\cst@emph\relax
\def\cst@hyph{}
\let\cst@super\relax
\newif  \ifcst@prefix   \cst@prefixtrue
\def\cst@radical#1#2{%
  \expandafter\newcommand\expandafter{\csname #1#2\endcsname}{}%
  \expandafter\DeclareRobustCommand\expandafter{%
    \csname #1#2\endcsname}{%
    \ifcst@prefix
      \cst@super{\cst@emph{#1}}\cst@hyph#2%
    \else
      #2\cst@hyph\cst@super{\cst@emph{#1}}%
    \fi%
    \cst@xspace
  }
}
\cst@radical{n}{Pr}%
\cst@radical{i}{Pr}%
\cst@radical{n}{Bu}%
\cst@radical{i}{Bu}%
\cst@radical{s}{Bu}%
\cst@radical{t}{Bu}%
\newif  \ifcst@notes    \cst@notestrue
\newif  \ifcst@phrases  \cst@phrasestrue
\newif  \ifcst@si       \cst@sifalse
\newif  \ifcst@xspace   \cst@xspacefalse
\DeclareOption{ch}{\ExecuteOptions{chapter}}
\DeclareOption{chapter}%
  {\PassOptionsToPackage{chapter}{chemscheme}}
\DeclareOption{chemcompounds}%
  {\PassOptionsToPackage{chemcompounds}{chemscheme}}
\DeclareOption{nonotes}{\cst@notesfalse}
\DeclareOption{nophrases}{\cst@phrasesfalse}
\DeclareOption{siunits}{\cst@sitrue}
\DeclareOption{SIunits}{\cst@sitrue}
\DeclareOption{xspace}{\cst@xspacetrue}
\let\cst@option\relax
\DeclareOption*{%
  \ifx\cst@option\relax\else
    \PackageWarning{chemstyle}
      {Extra option \cst@option\space ignored}
  \fi
  \edef\cst@option{\CurrentOption}
}
\@ifpackageloaded{SIunits}
  {\ExecuteOptions{siunits}}
  {\@ifpackageloaded{siunits}
    {\ExecuteOptions{siunits}}
    {}}
\ProcessOptions*
\ifcst@si
  \@ifpackageloaded{unitsdef}
    {\PackageWarning{chemstyle}{%
      You have set the SIunits option,\MessageBreak
      but have already loaded unitsdef!\MessageBreak
      unitsdef will be used for extra unit macros}
    \cst@sifalse}
    {\AtBeginDocument{%
      \@ifpackageloaded{siunits}%
        {}
        {\RequirePackage{SIunits}}%
      }
    }
\else
  \ifx\fg\@undefined
  \else
    \ifx\fg\relax
    \else
      \let\cst@fg\fg
      \let\fg\@undefined
    \fi
  \fi
  \RequirePackage{unitsdef}
  \ifx\cst@fg\@undefined
    \let\fg\@undefined
  \else
    \let\fg\cst@fg
  \fi
  \AtBeginDocument{%
    \ifx\fg\@undefined
      \newcommand{\fg}{\femtogram}
    \fi
  }
\fi
\RequirePackage{chemscheme}
\ifcst@si
  \newcommand{\cubiccentimeter}{\centi\metre\cubed}
  \newcommand{\Molar}{\textsc{m}}
  \newcommand{\molar}{\mole\usk\deci\metre\rpcubed}
  \newcommand{\mmHg}{\milli\metre~Hg}
  \newcommand{\mol}{\mole}
\else
  \newunit{\cubiccentimeter}{\cm\unitsuperscript{3}}
  \newunit{\Molar}{\textsc{m}}
  \newunit{\molar}{\mole\unitsep\dm\unitsuperscript{--3}}
  \newunit{\mmHg}{mm\unitsep{}Hg}
  \newunit{\mol}{\mole}
\fi
\newcommand{\cmc}{\cubiccentimeter}
\newcommand{\Hz}{\hertz}
\DeclareSymbolFont{CSTAMS}{U}{msb}{m}{n}
\DeclareMathSymbol{\cst@varnothing}{\mathord}{CSTAMS}{"3F}
\providecommand*{\standardstate}%
  {\textsuperscript{\rotatebox[origin=c]{138.8}%
  {\ensuremath{\cst@varnothing}}}}
\@ifclassloaded{memoir}
  {\let\newfloat\@undefined
   \RequirePackage{float}}
  {}
\floatstyle{plaintop}
\restylefloat{table}
\floatstyle{plain}
\restylefloat{scheme}
\restylefloat{figure}
\floatplacement{table}{htbp}
\floatplacement{scheme}{htbp}
\floatplacement{figure}{htbp}
\floatcontentscentre
\AtBeginDocument{%
  \labelformat{scheme}{\schemename~#1}}
\labelformat{figure}{\figurename~#1}
\labelformat{table}{\tablename~#1}
\let\latinemphon\relax
\let\latinemphoff\relax
\let\cst@latin\relax
\ifcst@phrases
  \newcommand{\latinemphon}{\let\cst@latin\emph}
  \newcommand{\latinemphoff}{\let\cst@latin\relax}
  \AtBeginDocument{%
    \providecommand\latin{\cst@latin}
  }
\fi
\latinemphon
\newif  \ifcst@comma    \cst@commafalse
\AtBeginDocument{%
  \ifcst@comma
    \def\cst@punct{.,\cst@xspace}
    \def\cst@addpunct{%
      \cst@add@punct\relax%
    }
    \def\cst@add@punct#1{%
      \futurelet\@tempa\cst@add@punct@%
    }
    \def\cst@add@punct@{%
      \ifx\@tempa.%
        \let\@tempb\cst@add@punct%
      \else
        \ifx\@tempa,%
          \let\@tempb\cst@add@punct%
        \else
          \let\@tempb\cst@punct%
        \fi
      \fi
      \@tempb%
    }
  \fi
}
\ifcst@xspace
  \RequirePackage{xspace}
  \let\cst@xspace\xspace
\else
  \let\cst@xspace\relax
\fi
\ifcst@phrases
  \AtBeginDocument{
    \providecommand{\etc}%
      {\@ifnextchar.{\cst@etc}{\cst@etc.\cst@xspace}}
    \providecommand{\invacuo}%
      {\latin{in vacuo}\cst@xspace}
    \providecommand{\etal}%
      {\@ifnextchar.{\cst@etal}{\cst@etal.\cst@xspace}}
    \ifcst@comma
      \providecommand{\eg}%
        {\cst@eg\cst@addpunct}
      \providecommand{\ie}%
        {\cst@ie\cst@addpunct}
    \else
      \providecommand{\eg}%
        {\@ifnextchar.{\cst@eg}{\cst@eg.\cst@xspace}}
      \providecommand{\ie}%
        {\@ifnextchar.{\cst@ie}{\cst@ie.\cst@xspace}}
    \fi
  }
\fi
\def\cst@etal{\latin{et~al}}
\def\cst@etc{\latin{etc}}
\def\cst@ie{\latin{i.e\spacefactor999\relax}}
\def\cst@eg{\latin{e.g\spacefactor999\relax}}
\newif  \ifcst@notesbefore  \cst@notesbeforetrue
\def\cst@name@refs#1#2#3{%
  \ifcst@notesbefore
    #3\space#2\space#1%
  \else
    #1\space#2\space#3%
  \fi
}
\def\cst@language{english}
\@ifundefined{refname}{%
  \@ifundefined{bibname}{%
     \PackageWarning{chemstyle}%
       {No bibliography name command defined in document class}%
     \def\cst@namerefs#1#2#3#4{}%
  }{%
     \def\cst@refsection{\bibname}%
  }
}{%
   \def\cst@refsection{\refname}%
}
\@ifundefined{cst@namerefs}{%
  \def\cst@namerefs#1#2#3#4{%
    \ifcst@notes%
      \def\cst@language@check{#1}
      \ifx\cst@language\cst@language@check
        \expandafter\renewcommand\expandafter{\cst@refsection}%
          {\cst@name@refs{#2}{#3}{#4}}%
      \fi
      \AtBeginDocument{%
        \@ifpackageloaded{babel}{%
          \expandafter\addto\expandafter{\csname captions#1\endcsname}%
            {\expandafter\renewcommand\expandafter{\cst@refsection}%
            {\cst@name@refs{#2}{#3}{#4}}}%
          \expandafter\selectlanguage\expandafter{\languagename}}
        {}}
    \else%
      \ifx#1\cst@language
        \expandafter\renewcommand\expandafter{\cst@refsection}{#2}%
      \fi
      \AtBeginDocument{%
        \@ifpackageloaded{babel}{%
          \expandafter\addto\expandafter{\csname captions#1\endcsname}%
            {\expandafter\renewcommand\expandafter{\cst@refsection}{#2}}%
          \expandafter\selectlanguage\expandafter{\languagename}}%
        {}}
    \fi%
  }
}{}
\cst@namerefs{english}{References}{and}{Notes}
\cst@namerefs{UKenglish}{References}{and}{Notes}
\cst@namerefs{ngerman}{Literatur}{und}{Notizen}
\cst@namerefs{german}{Literatur}{und}{Notizen}
\cst@namerefs{french}{R\'ef\'erences}{et}{Notes}
\cst@namerefs{frenchb}{R\'ef\'erences}{et}{Notes}
\ifx\cst@option\relax
  \PackageWarning{chemstyle}
    {You didn't say which style to use \MessageBreak
     Defaulting to the ``no change'' style: none}
  \def\cst@option{none}
\fi
\InputIfFileExists{\cst@option.jdf}
  {\PackageInfo{chemstyle}
    {Loaded \cst@option.jdf}}
  {\PackageWarning{chemstyle}
    {Required style \cst@option\space does not exist}}
\endinput
%%
%% End of file `chemstyle.sty'.
