%%
%% This is file `subdepth.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% subdepth.dtx  (with options: `package')
%% 
%%   __________________________________
%%   Copyright (C) 2007  Will Robertson
%% 
%%   License information appended.
%% 
\ProvidesPackage{subdepth}
  [2007/09/02 v0.1 Unify subscript depths]
\@ifpackageloaded{dchem}{\PackageWarning{subdepth incorporated within dchem; aborting loading}\endinput}{}
\newif\if@wspr@sup@low@
\DeclareOption{low-sup}{\@wspr@sup@low@true}
\ProcessOptions
\addto@hook\every@math@size{\dch@scr@hook}
\def\dch@scr@adjust{\@ifundefined{dch@sizet\f@size}%
  {\expandafter\dch@set@script\csname dch@sizet\f@size\endcsname}%
  {\csname dch@sizet\f@size\endcsname}}
\def\dch@set@script#1{%
  \begingroup % fontdimen settings are global anyway
    \frozen@everymath{}% Prevent recursion!
    \let#1\@empty
    \let\dch@do@one\relax
    \dch@set@one\scriptscriptstyle\scriptscriptfont#1\ssf@size
    \dch@set@one\scriptstyle\scriptfont#1\sf@size
    \dch@set@one\textstyle\textfont#1\f@size
  \endgroup
  #1}
\def\dch@set@one#1#2#3#4{%
  \@ifundefined{dch@size#4}%
   {\expandafter\xdef\csname dch@size#4\endcsname{%
      \unless\if@wspr@sup@low@
        \fontdimen13\the#2\tw@=\the\fontdimen13#2\tw@
        \fontdimen14\the#2\tw@=\the\fontdimen14#2\tw@
        \fontdimen15\the#2\tw@=\the\fontdimen15#2\tw@
      \fi
      \fontdimen16\the#2\tw@=\the\fontdimen16#2\tw@
      \fontdimen17\the#2\tw@=\the\fontdimen17#2\tw@}%
  }{\csname dch@size#4\endcsname}%
  \setbox\z@\hbox{$#1H_2$}\@tempdima\dp\z@
  \setbox\z@\hbox{$#1H_2^{+\vrule \@height 1em}$}%
  \ifdim\@tempdima<\dp\z@
    \@tempdima\dimexpr (\@tempdima+\dp\z@)/2 \relax
    \@tempdimb\dimexpr (\dp\z@-\@tempdima+\ht\z@-1em) \relax
    \xdef#3{#3\dch@do@one#2{\the\@tempdimb}{\the\@tempdima}}%
  \fi}
\def\dch@do@one#1#2#3{%
  \unless\if@wspr@sup@low@
    \fontdimen13#1\tw@#2\relax
    \fontdimen14#1\tw@\fontdimen13#1\tw@
    \fontdimen15#1\tw@\fontdimen13#1\tw@
  \fi
  \fontdimen\sixt@@n#1\tw@#3
  \fontdimen17#1\tw@
  \fontdimen\sixt@@n#1\tw@}%
\let\dch@scr@hook\dch@scr@adjust
\ifx\glb@currsize\f@size
  \dch@scr@adjust
\fi
%% 
%% Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Will Robertson.
%% 
%% This work consists of the file  subdepth.dtx
%%           and the derived files subdepth.pdf,
%%                                 subdepth.sty, and
%%                                 subdepth.ins.
%% 
%%
%% End of file `subdepth.sty'.
