% \iffalse meta-comment
%% File: chemtimes.dtx
%  Copyright 2009, 2010 by Shinsaku Fujita
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \typeout{Package `chemtimes' (v. 1.00) Shinsaku Fujita 2009/10/25}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \fi
%
% \CheckSum{1110}
%% \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
%<*driver>
\NeedsTeXFormat{pLaTeX2e}
% \fi
 \ProvidesFile{chemtimes.dtx}[2010/11/21 v5.00a chemtimes package]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{chemtimes.dtx}
%
\title{Times Fonts for Chemistry and Mathamatics by {\sffamily chemtimes.sty} (\fileversion)}
\author{Shinsaku Fujita \\ 
Shonan Institute of Chemoinformatics and 
Mathematical Chemistry 
}
\date{\filedate}
%
\begin{document}
   \maketitle
   \DocInput{chemtimes.dtx}
\end{document}
%</driver>
% \fi
%
% \section{Introduction}
% \subsection{Options for {\sffamily docstrip}}
%
% \DeleteShortVerb{\|}
% \begin{center}
% \begin{tabular}{|l|l|}
% \hline
% \emph{option} & \emph{function}\\ \hline
% chemtimes & chemtimes.sty \\
% driver & driver for this dtx file \\
% \hline
% \end{tabular}
% \end{center}
% \MakeShortVerb{\|}
%
% \subsection{Version Information}
%
%    \begin{macrocode}
%<*chemtimes>
\typeout{Package `chemtimes' (v. 5.00a) Shinsaku Fujita 2010/11/21}
%    \end{macrocode}
%
% \section{Times Fonts}
%
% The option ``chemist'' is to load the \textsf{chemist} package in place of 
% the default loading of the \textsf{chmst-ps} package. By the option ``chemtimes'' 
% of the \textsf{chemist} or \textsf{chmst-ps} package, the switch \verb/\@chemtimestrue/ 
% or \verb/\@@@chemtimestrue/ becomes effective. Thereby, the mathversions ``chem'' and 
% ``boldchem'' defined in the \textsf{chemist} package are entirely ignored so as to be 
% replaced by those defined in the \textsf{chemtimes} package. 
%
%    \begin{macrocode}
\@ifundefined{chemcorr}{}{%
  \PackageError{chemtimes}
    {The ``chemist'' or ``chmst-ps'' package is not permitted here}
    {The ``chemist'' or ``chmst-ps'' package will be automatically loaded \MessageBreak
    when the ``chemtimes'' package is loaded.}
}
%    \end{macrocode}
%
%    \begin{macrocode}
\newif\ifchemtimes%%
\newif\if@chemtimes%%for chemist package
\newif\if@@@chemtimes%%for chmst-ps package
\newif\if@@chemtimes%%for chmst-ps package 
\DeclareOption{chemist}{\chemtimestrue}
\chemtimesfalse
\ProcessOptions
\ifchemtimes
\RequirePackage[chemtimes]{chemist}%
\else
\@@chemtimestrue
\RequirePackage[chemtimes]{chmst-ps}%
\fi
%    \end{macrocode}
%
% \section{Definition of Macros}
%
% Times-like fonts are used by declaring ``ptm'' (times roman) and ``phv'' (Helvetica) 
% in place of the corresponding roman and san serif families. 
% while computer modern type-writer fonts are used without change. 
%
%    \begin{macrocode}
%chemtimes package
%times, helvetica
%times from ot1ptm.fd 2007/07/31
\renewcommand{\rmdefault}{ptm}
%Helvetica from ot1phv.fd 2007/07/31
\def\Hv@scale{0.90}%scalable font
\renewcommand{\sfdefault}{phv}
%typewriter
%\renewcommand{\ttdefault}{pcr}
% with the default (computer modern typewriter font)
%% change the defalt values (\thinmuskip 3mu to 2mu etc.)
\thinmuskip=2mu
\medmuskip=2.5mu plus 1mu minus 1mu
\thickmuskip=4mu plus 1.5mu minus 1mu
%    \end{macrocode}
%
% Fonts for normal mathversion are used on the same line 
% as \textsf{mathptmx} package:
%
%    \begin{macrocode}
%mathversion normal
\DeclareSymbolFont{letters}     {OML}{ztmcm}{m}{it}
\DeclareSymbolFont{operators}   {OT1}{ztmcm}{m}{n}
\DeclareSymbolFont{symbols}     {OMS}{ztmcm}{m}{n}
\DeclareSymbolFont{largesymbols}{OMX}{ztmcm}{m}{n}
\DeclareSymbolFont{bold}        {OT1}{ptm}{bx}{n}
\DeclareSymbolFont{italic}      {OT1}{ptm}{m}{it}
\DeclareMathAlphabet{\mathbf}{OT1}{ptm}{bx}{n}
\DeclareMathAlphabet{\mathit}{OT1}{ptm}{m}{it}
\DeclareMathAlphabet{\mathbfit}{OT1}{ptm}{b}{it}%2009/11/22
\DeclareMathAlphabet{\mathsf}{OT1}{phv}{m}{n}
%\DeclareMathAlphabet{\mathtt}{OT1}{pcr}{m}{n}
\DeclareMathAlphabet{\mathtt}{OT1}{cmtt}{m}{n}
%Uppercase Greeks
  \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{0}
  \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{1}
  \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{2}
  \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{3}
  \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{4}
  \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{5}
  \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{6}
  \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{7}
  \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{8}
  \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{9}
  \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{10}
%    \end{macrocode}
%
% The following fonts are used for bold mathversion. 
%
%    \begin{macrocode}
%mathversion bold
%\SetSymbolFont{letters}     {bold}{OML}{ptm}{b}{it}%
\SetSymbolFont{letters}     {bold}{OT1}{ptm}{b}{it}%
\SetSymbolFont{operators}   {bold}{OT1}{ptm}{b}{n}%
\SetSymbolFont{symbols}     {bold}{OMS}{ptm}{b}{n}%
\SetSymbolFont{largesymbols}{bold}{OMX}{ztmcm}{m}{n}%
%    \end{macrocode}
%
% Font sizes for math modes are defined as follows 
% on the same line as \textsf{mathptmx} package:
%
%    \begin{macrocode}
\def\defaultscriptratio{.74}
\def\defaultscriptscriptratio{.6}
\DeclareMathSizes{5}{5}{5}{5}
\DeclareMathSizes{6}{6}{5}{5}
\DeclareMathSizes{7}{7}{5}{5}
\DeclareMathSizes{8}{8}{6}{5}
\DeclareMathSizes{9}{9}{7}{5}
\DeclareMathSizes{10}{10}{7.4}{6}
\DeclareMathSizes{10.95}{10.95}{8}{6}
\DeclareMathSizes{12}{12}{9}{7}
\DeclareMathSizes{14.4}{14.4}{10.95}{8}
\DeclareMathSizes{17.28}{17.28}{12}{10}
\DeclareMathSizes{20.74}{20.74}{14.4}{12}
\DeclareMathSizes{24.88}{24.88}{17.28}{14.4}
%    \end{macrocode}
%
% Letter strings for judging mathversions: 
%
%    \begin{macrocode}
\newif\ifnewl@tex \newl@textrue
\@ifundefined{DeclareMathVersion}%
 {\global\newl@texfalse}{\global\newl@textrue}%
\def\math@chem{chem}
\def\math@boldchem{boldchem}
\def\math@bold{bold}
\def\math@normal{normal}
%    \end{macrocode}
%
% The original setting of each Greek letter is stored tentatively.
%    \begin{macrocode}
%%added 2005/09/02
\let\oldalpha=\alpha
\let\oldbeta=\beta
\let\oldgamma=\gamma
\let\olddelta=\delta
\let\oldepsilon=\epsilon
\let\oldzeta=\zeta
\let\oldeta=\eta
\let\oldtheta=\theta
\let\oldiota=\iota
\let\oldkappa=\kappa
\let\oldlambda=\lambda
\let\oldmu=\mu
\let\oldnu=\nu
\let\oldxi=\xi
\let\oldpi=\pi
\let\oldrho=\rho
\let\oldsigma=\sigma
\let\oldtau=\tau
\let\oldupsilon=\upsilon
\let\oldphi=\phi
\let\oldchi=\chi
\let\oldpsi=\psi
\let\oldomega=\omega
\let\oldvarepsilon=\varepsilon
\let\oldvartheta=\vartheta
\let\oldvarpi=\varpi
\let\oldvarrho=\varrho
\let\oldvarsigma=\varsigma
\let\oldvarphi=\varphi
\let\oldGamma=\Gamma
\let\oldDelta=\Delta
\let\oldTheta=\Theta
\let\oldLamda=\Lambda
\let\oldXi=\Xi
\let\oldPi=\Pi
\let\oldSigma=\Sigma
\let\oldUpsilon=\Upsilon
\let\oldPhi=\Phi
\let\oldPsi=\Psi
\let\oldOmega=\Omega
%    \end{macrocode}
%
% \begin{macro}{\chemGreekpalette}
% \begin{macro}{\chemGreekletter}
% The command \verb/\chemGreekletter/ selects a lowercase greek letter 
% for each mathversion. 
%  \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
%
%    \begin{macrocode}
\def\chemGreekpalette#1#2#3{%
\mathchoice%
{\mathord{\hbox{\usefont{OML}{#1}{#3}{it}\char"#2}}}%
{\mathord{\hbox{\usefont{OML}{#1}{#3}{it}\char"#2}}}%
{\mathord{\hbox{\scriptsize\usefont{OML}{#1}{#3}{it}\char"#2}}}%
{\mathord{\hbox{\tiny\usefont{OML}{#1}{#3}{it}\char"#2}}}}%
\def\chemGreekletter#1#2{%
\expandafter\def\csname #1\endcsname{\bgroup%added 2010/11/21 by S. Fujita
\ifx\math@version\math@chem
%\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}
\chemGreekpalette{ztmcm}{#2}{m}%
\else
\ifx\math@version\math@boldchem
%\mathord{\hbox{\mathversion{bold}$\mathchar"#2$}}%
\chemGreekpalette{cmm}{#2}{b}%
\else
\ifx\math@version\math@bold
%\csname old#1\endcsname
\chemGreekpalette{cmm}{#2}{b}%
\else
\csname old#1\endcsname
\fi\fi\fi\egroup}}%added 2010/11/21 by S. Fujita
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%  \begin{macro}{\ChemAccent}
%
%  \changes{v4.05}{2009/10/25}{Defined: \cs{ChemAccent}}
%    \begin{macrocode}
%\if@chemtimes\else%for chemtimes package
\def\ChemAccent#1#2#3{%
\expandafter\def\csname #1\endcsname{%
\ifx\math@version\math@chem
#2{\hbox{\kern-0.15em\usefont{OML}{cmm}{m}{it}\char"#3}}\else
\ifx\math@version\math@boldchem
#2{\hbox{\kern-0.2em\usefont{OML}{cmm}{b}{it}\char"#3}}\else
\ifx\math@version\math@bold
\ifupgreekrm
#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
\upgreekrmfalse
\else
#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
\fi
\else
#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
\fi\fi\fi}}
%\fi
%    \end{macrocode}
%  \end{macro}
%
%
% \begin{macro}{\rm}
% The command \verb/\rm/ is redefined to use \verb/\ifupgreekrm/ 
% for switching slanted letters into upright letters. 
%    \begin{macrocode}
\newif\ifupgreekrm \upgreekrmfalse
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm\upgreekrmtrue}
%\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\upgreekrmtrue\mathrm}
\DeclareOldFontCommand{\bfit}{\normalfont\itshape\bfseries}{\mathbfit}%2009/11/22
\let\oldmathrm=\mathrm
\def\mathrm#1{\oldmathrm{\upgreekrmtrue #1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\chemUpGreekletter}
% The command \verb/\chemUpGreekletter/ selects an uppercase greek letter 
% for each mathversion.
%  \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
%    \begin{macrocode}
\newif\ifm@thnorm@l
\def\chemUpGreekletter#1#2{%
\expandafter\def\csname #1\endcsname{\bgroup%2010/11/21 by S. Fujita
\ensuremath{%
\ifx\math@version\math@chem
%\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}\else
\ifm@thnorm@l
\mathord{\hbox{\usefont{OML}{cmm}{m}{it}\char"#2}}%
\else
\mathord{\hbox{\usefont{OT1}{cmr}{m}{n}\char"#2}}%
\fi
\else
\ifx\math@version\math@boldchem
%\mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}\else
\ifm@thnorm@l
\mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
\else
\mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}%
\fi
\else
\ifx\math@version\math@bold
\ifupgreekrm
\ifm@thnorm@l
\mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
\else
\mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}%
\fi
%%%\upgreekrmfalse
\else
\mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
%\csname old#1\endcsname
\fi
\else
\csname old#1\endcsname
\fi\fi\fi}\egroup}}%added 2010/11/21 by S. Fujita
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\ctSFOpalette}
% \begin{macro}{\chemtimesSubFontOrd}
% The command \verb/\chemtimesSubFontOrd/ selects a symbol for substitution 
% (computer modern font) if there is no such font of times family.
%  \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
%    \begin{macrocode}
\def\ctSFOpalette#1#2#3{%
\mathchoice
{#2{\hbox{\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
{#2{\hbox{\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
{#2{\hbox{\scriptsize\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
{#2{\hbox{\tiny\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
}
\def\chemtimesSubFontOrd#1#2#3{%
\expandafter\def\csname #1\endcsname{\bgroup%added 2010/11/21 by S. Fujita
 \PackageWarning{chemtimes}
  {The symbol \expandafter\string\csname #1\endcsname\space 
  is not available with this package. 
  This font will be substituted by an appropriate commputer modern font}%
\ifx\math@version\math@chem
%#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
\ctSFOpalette{m}{#2}{#3}%
\else\ifx\math@version\math@boldchem
%#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
\ctSFOpalette{b}{#2}{#3}%
\else\ifx\math@version\math@bold
%{#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}}%
\ctSFOpalette{b}{#2}{#3}%
\else\ifx\math@version\math@normal
%#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
\ctSFOpalette{m}{#2}{#3}%
\else
%#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
\ctSFOpalette{m}{#2}{#3}%
\fi\fi\fi\fi\egroup}}%added 2010/11/21 by S. Fujita
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ctSFBpalette}
% \begin{macro}{\ctSFBBpalette}
% \begin{macro}{\chemtimesSubFontBin}
% The command \verb/\chemtimesSubFontBin/ selects a symbol (binary operation) 
% for substitution (computer modern font) if there is no such font of times family.
%  \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
%    \begin{macrocode}
\def\ctSFBpalette#1#2#3{%
\mathchoice
{#2{\hbox{\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
{#2{\hbox{\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
{#2{\hbox{\scriptsize\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
{#2{\hbox{\tiny\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
}
\def\ctSFBBpalette#1#2#3{%
\mathchoice
{#2{\hbox{\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
{#2{\hbox{\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
{#2{\hbox{\scriptsize\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
{#2{\hbox{\tiny\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
}
\def\chemtimesSubFontBin#1#2#3{%
\expandafter\def\csname #1\endcsname{\bgroup%added 2010/11/21 by S. Fujita
 \PackageWarning{chemtimes}
  {The symbol \expandafter\string\csname #1\endcsname\space 
  is not available with this package. 
  This font will be substituted by an appropriate commputer modern font}%
\ifx\math@version\math@chem
%#2{\hbox{\usefont{OMS}{cmsy}{m}{n}\char"#3}}%
\ctSFBpalette{m}{#2}{#3}%
\else\ifx\math@version\math@boldchem
%#2{\hbox{\usefont{OMS}{cmsy}{b}{n}\char"#3}}%
\ctSFBpalette{b}{#2}{#3}%
\else\ifx\math@version\math@bold
%#2{\hbox{\usefont{OMS}{cmsy}{b}{n}\char"#3}}%
\ctSFBpalette{b}{#2}{#3}%
\else\ifx\math@version\math@normal
%#2{\hbox{\usefont{OMS}{cmsy}{m}{n}\char"#3}}%
\ctSFBpalette{m}{#2}{#3}%
\else
%#2{\hbox{\usefont{OMS}{cmm}{m}{n}\char"#3}}%
\ctSFBBpalette{m}{#2}{#3}%
\fi\fi\fi\fi\egroup}}%added 2010/11/21 by S. Fujita
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\chemtimesSubFontLOp}
% The command \verb/\chemtimesSubFontLOp/ selects a symbol (large operation) 
% for substitution (computer modern font) if there is no such font of times family.
%  \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
%    \begin{macrocode}
\def\chemtimesSubFontLOp#1#2#3{%
\expandafter\def\csname #1\endcsname{\bgroup%%added 2010/11/21 by S. Fujita
 \PackageWarning{chemtimes}
  {The symbol \expandafter\string\csname #1\endcsname\space 
  is not available with this package. 
  This font will be substituted by an appropriate commputer modern font}%
\ifx\math@version\math@chem
\mathop{\mathchoice%
{\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
{\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%
}%
\else\ifx\math@version\math@boldchem
\mathop{\mathchoice%
{\raise2.2ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#3}}%
{\raise1.8ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#2}}{}{}%
}%
\else\ifx\math@version\math@bold
\mathop{\mathchoice%
{\raise2.2ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#3}}%
{\raise1.8ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#2}}{}{}%
}%
\else\ifx\math@version\math@normal
\mathop{\mathchoice%
{\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
{\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%
}%
\else
\mathop{\mathchoice%
{\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
{\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%
}%
\fi\fi\fi\fi\egroup}}%%added 2010/11/21 by S. Fujita
%    \end{macrocode}
% \end{macro}
%
%
% Lowercase and uppercase Greek letters are redefined as follows: 
%    \begin{macrocode}
\def\SetChemSymbol{%
%\chemGreekletter{alpha}{010B}%
%\chemGreekletter{beta}{010C}%
%\chemGreekletter{gamma}{010D}%
%\chemGreekletter{delta}{010E}%
%\chemGreekletter{epsilon}{010F}%
%\chemGreekletter{zeta}{0110}%
%\chemGreekletter{eta}{0111}%
%\chemGreekletter{theta}{0112}%
%\chemGreekletter{iota}{0113}%
%\chemGreekletter{kappa}{0114}%
%\chemGreekletter{lambda}{0115}%
%\chemGreekletter{mu}{0116}%
%\chemGreekletter{nu}{0117}%
%\chemGreekletter{xi}{0118}%
%\chemGreekletter{pi}{0119}%
%\chemGreekletter{rho}{011A}%
%\chemGreekletter{sigma}{011B}%
%\chemGreekletter{tau}{011C}%
%\chemGreekletter{upsilon}{011D}%
%\chemGreekletter{phi}{011E}%
%\chemGreekletter{chi}{011F}%
%\chemGreekletter{psi}{0120}%
%\chemGreekletter{omega}{0121}%
%\chemGreekletter{varepsilon}{0122}%
%\chemGreekletter{vartheta}{0123}%
%\chemGreekletter{varpi}{0124}%
%\chemGreekletter{varrho}{0125}%
%\chemGreekletter{varsigma}{0126}%
%\chemGreekletter{varphi}{0127}%
%
\chemGreekletter{alpha}{0B}%
\chemGreekletter{beta}{0C}%
\chemGreekletter{gamma}{0D}%
\chemGreekletter{delta}{0E}%
\chemGreekletter{epsilon}{0F}%
\chemGreekletter{zeta}{10}%
\chemGreekletter{eta}{11}%
\chemGreekletter{theta}{12}%
\chemGreekletter{iota}{13}%
\chemGreekletter{kappa}{14}%
\chemGreekletter{lambda}{15}%
\chemGreekletter{mu}{16}%
\chemGreekletter{nu}{17}%
\chemGreekletter{xi}{18}%
\chemGreekletter{pi}{19}%
\chemGreekletter{rho}{1A}%
\chemGreekletter{sigma}{1B}%
\chemGreekletter{tau}{1C}%
\chemGreekletter{upsilon}{1D}%
\chemGreekletter{phi}{1E}%
\chemGreekletter{chi}{1F}%
\chemGreekletter{psi}{20}%
\chemGreekletter{omega}{21}%
\chemGreekletter{varepsilon}{22}%
\chemGreekletter{vartheta}{23}%
\chemGreekletter{varpi}{24}%
\chemGreekletter{varrho}{25}%
\chemGreekletter{varsigma}{26}%
\chemGreekletter{varphi}{27}%
%
%\chemUpGreekletter{Gamma}{7000}%
%\chemUpGreekletter{Delta}{7001}%
%\chemUpGreekletter{Theta}{7002}%
%\chemUpGreekletter{Lambda}{7003}%
%\chemUpGreekletter{Xi}{7004}%
%\chemUpGreekletter{Pi}{7005}%
%\chemUpGreekletter{Sigma}{7006}%
%\chemUpGreekletter{Upsilon}{7007}%
%\chemUpGreekletter{Phi}{7008}%
%\chemUpGreekletter{Psi}{7009}%
%
\chemUpGreekletter{Gamma}{00}%
\chemUpGreekletter{Delta}{01}%
\chemUpGreekletter{Theta}{02}%
\chemUpGreekletter{Lambda}{03}%
\chemUpGreekletter{Xi}{04}%
\chemUpGreekletter{Pi}{05}%
\chemUpGreekletter{Sigma}{06}%
\chemUpGreekletter{Upsilon}{07}%
\chemUpGreekletter{Phi}{08}%
\chemUpGreekletter{Psi}{09}%
\chemUpGreekletter{Omega}{0A}%
%
\chemtimesSubFontOrd{imath}{\mathord}{7B}%
\chemtimesSubFontOrd{jmath}{\mathord}{7C}%
\chemtimesSubFontBin{amalg}{\mathbin}{71}%
\chemtimesSubFontLOp{coprod}{60}{61}%
%2009/11/22
\chemtimesSubFontOrd{mathless}{\mathrel}{3C}%
\chemtimesSubFontOrd{mathgreater}{\mathrel}{3E}%
\chemtimesSubFontOrd{leftharpoonup}{\mathrel}{28}%
\chemtimesSubFontOrd{leftharpoondown}{\mathrel}{29}%
\chemtimesSubFontOrd{rightharpoonup}{\mathrel}{2A}%
\chemtimesSubFontOrd{rightharpoondown}{\mathrel}{2B}%
\chemtimesSubFontOrd{ell}{\mathord}{60}%
\chemtimesSubFontOrd{wp}{\mathord}{7D}%
\chemtimesSubFontOrd{partial}{\mathord}{40}%
\chemtimesSubFontOrd{flat}{\mathord}{5B}%
\chemtimesSubFontOrd{natural}{\mathord}{5C}%
\chemtimesSubFontOrd{sharp}{\mathord}{5D}%
\chemtimesSubFontOrd{triangleleft}{\mathbin}{2F}%
\chemtimesSubFontOrd{triangleright}{\mathbin}{2E}%
\chemtimesSubFontOrd{smile}{\mathrel}{5E}%
\chemtimesSubFontOrd{frown}{\mathrel}{5F}%
\chemtimesSubFontOrd{star}{\mathbin}{3F}%
\ChemAccent{vec}{\rlap}{7E}%
}
%    \end{macrocode}
%
% \begin{macro}{\mathversion}
% The command \verb/\mathversion/ is redefined to typeset punctuation symbols 
% properly. 
%    \begin{macrocode}
\DeclareRobustCommand\mathversion[1]
         {\@nomath\mathversion
          \expandafter\ifx\csname mv@#1\endcsname\relax
          \@latex@error{Math version `#1' is not defined}\@eha\else
          \edef\math@version{#1}%
          \gdef\glb@currsize{}%
%%%%%%2002/5/30 and 2004/11/17
\ifx\math@version\math@chem
 \mathcode`\.="012E
 \mathcode`\,="612C
 \mathcode`\/="012F
 \SetChemSymbol
\else\ifx\math@version\math@boldchem
 \mathcode`\.="012E
 \mathcode`\,="612C
 \mathcode`\/="012F
 \SetChemSymbol
\else\ifx\math@version\math@bold
 \mathcode`\.="012E
 \mathcode`\,="612C
 \mathcode`\/="012F
 \SetChemSymbol%
\else
 \mathcode`\.="013A
 \mathcode`\,="613B
 \mathcode`\/="013D
 \SetChemSymbol%
\fi\fi\fi
%%%%%%
          \aftergroup\glb@settings
          \fi}
%    \end{macrocode}
% \end{macro}
%
% New mathversions (chem and boldchem) are defined, where upright fonts of times family 
% are used in math modes in place of slanted fonts. 
%
%    \begin{macrocode}
\ifnewl@tex
\@ifundefined{mv@chem}{%
\DeclareMathVersion{chem}%
\SetSymbolFont{letters}{chem}     {OT1}{ptm}{m}{n}%
\SetSymbolFont{operators}{chem}   {OT1}{ztmcm} {m}{n}%
\SetSymbolFont{symbols}  {chem}   {OMS}{ztmcm}{m}{n}%
\SetSymbolFont{largesymbols}{chem}{OMX}{ztmcm}{b}{n}%
\DeclareMathVersion{boldchem}%2009/10/23<--2002/5/30
\SetSymbolFont{letters}{boldchem}     {OT1}{ptm}{b}{n}%
\SetSymbolFont{operators}{boldchem}   {OT1}{ptm}{b}{n}%
\SetSymbolFont{symbols}{boldchem}     {OMS}{ptm}{b}{n}%
\SetSymbolFont{largesymbols}{boldchem}{OMX}{ztmcm}{b}{n}%
}{%
   \PackageWarning%
   {chemtimes}%
   {The mathversion "chem" or "boldchem" has been already defined. ^^J%
   The old mathversion remains effective unless it is removed. }%
}
\else
   \PackageWarning%
   {chemtimes}%
   {Mathversions cannot be defined. Use LaTeX2e or a later version.}%
\fi
%    \end{macrocode}
%
% \begin{macro}{\hbar}
% The command \verb/\hbar/ is redefined to typeset the symbol 
% properly. This command is a slight modification of the one 
% which has been described in the \textsf{mathptmx} package. 
%    \begin{macrocode}
\DeclareRobustCommand\hbar{{%from mathptmx package
\dimen@.06em \dimen@ii.06em%
\def\@tempa##1##2{%
   \lower##1\dimen@\rlap{\kern##1\dimen@ii\the##2 0\char22}}%
 \mathchoice{\@tempa{\@ne}{\textfont}}%
            {\@tempa{\@ne}{\textfont}}%
            {\@tempa{\defaultscriptratio}{\scriptfont}}%
            {\@tempa{\defaultscriptscriptratio}{\scriptscriptfont}}%
  h}}
%    \end{macrocode}
% \end{macro}
%
%  \begin{macro}{\mathnormal}
%
% The macro \verb/\mathnormal/ for outputting numbers of old style 
% has been redefined to meet ``boldchem''. 
%
%  \changes{v4.05}{2009/10/25}{Redefined for oldsytle fonts}
%  \changes{v4.05}{2009/11/22}{Switch by \cs{bfit}}
%
%    \begin{macrocode}
\let\oldmathnormal=\mathnormal
\def\mathnormal#1{%
\ifx\math@version\math@chem
%\mathgroup\@ne
\m@thnorm@ltrue
\ensuremath{\it \usefont{OML}{cmm}{m}{it}#1}%
\else\ifx\math@version\math@boldchem
\m@thnorm@ltrue
\ensuremath{\bfit \usefont{OML}{cmm}{b}{it}#1}%
\else\ifx\math@version\math@bold
\ifupgreekrm
\m@thnorm@ltrue
\ensuremath{\bfit \usefont{OML}{cmm}{b}{it}#1}%
\else
\ensuremath{\usefont{OML}{cmm}{b}{it}#1}%
\fi
\else
\oldmathnormal{#1}%
\fi\fi\fi%
\m@thnorm@lfalse
}%
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\oldstyle}
%
% The command \verb/\oldstyle/ should be used in the form of \verb/{\oldstyle ...}/ 
% in a math mode. 
%
%  \changes{v4.05}{2009/10/25}{Redefined for oldsytle fonts}
%
%    \begin{macrocode}
\def\oldstyle{\egroup%
\ifx\math@version\math@chem
\hbox\bgroup\usefont{OML}{cmm}{m}{it}%
\else\ifx\math@version\math@boldchem
\hbox\bgroup\usefont{OML}{cmm}{b}{it}%
\else\ifx\math@version\math@bold
\ifupgreekrm
\oldmathnormal\bgroup%
\upgreekrmfalse
\else
\hbox\bgroup\usefont{OML}{cmm}{b}{it}%
\fi
\else
\oldmathnormal\bgroup%
\fi\fi\fi}%
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\mathcal}
%
% The macro \verb/\mathcal/ for outputting calligraphic letters 
% has been redefined to meet ``boldchem''. 
%
%  \changes{v4.05}{2009/10/25}{Redefined for calligraphic letters}
%  \changes{v4.05}{2009/11/20}{Switch by \cs{if@chemtimes} for chemtimes package}
%
%    \begin{macrocode}
\let\oldmathcal=\mathcal
\def\mathcal#1{%
\ifx\math@version\math@chem
\mathgroup\tw@{\usefont{OMS}{cmsy}{m}{n}#1}%
\else\ifx\math@version\math@boldchem
\mathgroup\tw@{\usefont{OMS}{cmsy}{b}{n}#1}%
\else\ifx\math@version\math@bold
\ifupgreekrm \oldmathcal{#1}%\upgreekrmfalse
\else \oldmathcal{#1}\fi
\else
\oldmathcal{#1}%
\fi\fi\fi}%
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\cal}
%
% The macro \verb/\cal/ for outputting calligraphic letters 
% (a macro of declaration type) has been redefined to meet ``boldchem''. 
%
%  \changes{v4.05}{2009/10/25}{Redefined for calligraphic letters}
%  \changes{v4.05}{2009/11/20}{Switch by \cs{if@chemtimes} for chemtimes package}
%
%    \begin{macrocode}
%\if@chemtimes\else%for chemtimes package
\let\oldcal=\cal
\def\cal{%
\ifx\math@version\math@chem
\mathgroup\tw@\usefont{OMS}{cmsy}{m}{n}%
\else\ifx\math@version\math@boldchem
\mathgroup\tw@\usefont{OMS}{cmsy}{b}{n}%
\else\ifx\math@version\math@bold
\ifupgreekrm \oldcal\upgreekrmfalse
\else\oldcal\fi
\else
\oldcal%
\fi\fi\fi}%
%\fi
%    \end{macrocode}
%  \end{macro}
%
% ChemEquation and ChemEqnarray enviroments are defined 
% as chemical counterparts of equation and eqnarray environments. 
% The corresponding asterisked enviroments are also defined. 
% The command \verb/\ChemForm/ is defined as a chemical counterpart 
% of \verb/\(...\)/ or \verb/$...$/. 
% These enviroments and the command do not require the selection of 
% a chem or boldchem mathversion. 
% \changes{v1.00}{2009/11/25}{Deleted. Definitions from the chemist package}
% 
% \begin{macro}{ChemEquation}
% \begin{macro}{ChemEqnarray}
% \begin{macro}{ChemEquation*}
% \begin{macro}{ChemEqnarray*}
% \begin{macro}{\ChemForm}
%    \begin{macrocode}
%\def\ChemEquation{\everymath{\rm}\everydisplay{\rm}\equation}
%\def\endChemEquation{\endequation\everymath{}\everydisplay{}}
%\def\ChemEqnarray{\everymath{\rm}\everydisplay{\rm}\eqnarray}
%\def\endChemEqnarray{\endeqnarray\everymath{}\everydisplay{}}
%\def\ChemForm#1{\everymath{\rm}$#1$\everymath{}}
%\@namedef{ChemEqnarray*}{\def\@eqncr{\nonumber\@seqncr}\ChemEqnarray}
%\@namedef{endChemEqnarray*}{\nonumber\endChemEqnarray}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% The mathversion ``normal'' is declared as the initial default setting.
%    \begin{macrocode}
\mathversion{normal}%default setting
%</chemtimes>
%    \end{macrocode}
%
% \Finale
%
\endinput
