%%
%% This is file `rsc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% rsc.dtx  (with options: `package')
%% ----------------------------------------------------------------
%% rsc --- BibTeX styles for Royal Society of Chemistry and Wiley
%%   journals
%% E-mail: joseph.wright@morningstar2.co.uk
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rsc}
  [2016/08/22 v31.f Support for RSC and Wiley journals]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family = rsc,
  prefix = rsc@
}
\DeclareBoolOption{linkdoi}
\DeclareBoolOption{mciteplus}
\DeclareBoolOption{super}
\DeclareBoolOption{usetitle}
\DeclareBoolOption{usedoi}
\DeclareStringOption{maxauthors}
\setkeys{rsc}{
  linkdoi    = false,
  mciteplus  = true,
  maxauthors = 0,
  usetitle   = false,
  usedoi     = false,
  super      = true
}
\ProcessKeyvalOptions{rsc}
\ifrsc@super
  \RequirePackage[sort&compress,numbers,super]{natbib}
  \IfFileExists{natmove.sty}{%
    \RequirePackage{natmove}}{}
\else
  \RequirePackage[sort&compress,numbers]{natbib}
\fi
\newwrite\rsc@bib@file
\newcommand*{\rsc@bib@message}{%
  This is an auxiliary file used by the `rsc' package.^^J%
  This file may safely be deleted. It will be recreated as
  required.^^J
}
\newcommand*{\rsc@bib@name}{rsc-\jobname.bib}
\newcommand*{\rsc@bib@write}{%
  \if@filesw
    \expandafter\rsc@bib@write@aux
  \fi
}
\AtBeginDocument{\rsc@bib@write}
\newcommand*{\rsc@bib@write@aux}{%
  \immediate\openout\rsc@bib@file\rsc@bib@name\relax
  \immediate\write\rsc@bib@file{\rsc@bib@message}%
  \edef\@tempa##1##2{%
    \space\space##1\space = \space"##2",^^J%
  }%
  \immediate\write\rsc@bib@file{%
    @Control\string{%
      rsc-control,^^J%
      \@tempa{ctrl-use-title}{%
        \ifrsc@usetitle yes\else no\fi
      }%
      \@tempa{ctrl-use-doi-all}{%
        \ifrsc@usedoi yes\else no\fi
      }%
      \@tempa{ctrl-link-doi}{%
        \ifrsc@linkdoi yes\else no\fi
      }%
      \@tempa{ctrl-etal-number}{\rsc@maxauthors}%
    \string}^^J%
  }%
  \immediate\write\@auxout{%
    \string\citation\string{rsc-control\string}%
  }%
  \AtEndDocument{%
    \immediate\closeout\rsc@bib@file\relax
  }%
}
\IfFileExists{mciteplus.sty}{%
  \ifrsc@mciteplus
    \RequirePackage{mciteplus}
  \fi
}{}
\AtBeginDocument{%
  \let\rsc@bibliography\bibliography
  \renewcommand*{\bibliography}[1]{%
    \rsc@bibliography{rsc-\jobname,#1}%
  }%
}
%% 
%% Copyright (C) 2006-2009,2011,2013,2016 by
%%   Joseph Wright <joseph.wright@morningstar2.co.uk>
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%%   Joseph Wright.
%% 
%% This work consists of the file  rsc.dtx
%%           and the derived files rsc.pdf,
%%                                 rsc.ins,
%%                                 rsc.sty,
%%                                 rsc.bib and
%%                                 rsc-demo.tex.
%% 
%% 
%%
%% End of file `rsc.sty'.
