
%  
%  \iffalse  
% 
%    The first part is a comment to the reader(s) of `chemsym.dtx'.
%
%  chemsym.dtx    Version 0.2, April 25, 1995
%  (c) 1995 by Mats Dahlgren  (matsd@physchem.kth.se)
%
%  Please see the information in file `chemsym.ins' on how you 
%  may use and (re-)distribute this file.  Run LaTeX on the file 
%  `chemsym.ins' to get a .sty-file and instructions.  
%
%  This file may NOT be distributed if not accompanied by 'chemsym.ins'.
%
%  \fi
%
%  \def\filename{chemsym.dtx}
%  \def\fileversion{0.2}
%  \def\filedate{1995/04/25}\def\docdate{\filedate}
%  \MakeShortVerb{\|}
%  \date{\docdate}
%  \title{\LaTeX{} Macro for Chemical Symbols}
%  \author{Mats Dahlgren\\ (\texttt{matsd@physchem.kth.se})} 
%  \maketitle
%  \begin{abstract}
%  This document describes the |chemsym| package, which makes 
%  it easier to type chemical symbols correctly, without having 
%  to worry about math mode or text mode.  Furthermore, 
%  |chemsym| makes both the super- and the subscript commands 
%  (|^| and |_|) avaliable in text mode. 
%  \\ This file and the package:\
%  Copyright \copyright\ 1995 by Mats Dahlgren.  All rights
%  reserved. 
%  \end{abstract}
%   
%  \section{Introduction}
%  |chemsym| is a \LaTeX{} package which makes it easier to 
%  type chemical symbols correctly.  It defines a command for 
%  each element of the periodic table (the 109 first), and 
%  Deuterium.  The use of the commands results in a up-right 
%  chemical symbol, regardless of whether it is used in 
%  math mode or text mode.  If not followed by a sub- or 
%  superscript, a |(|, or a |)|, a small space is added (slighly 
%  less than what `|\,|' gives).
%  
%  For elements 104-109 there is a (yet not setteled) 
%  discussion on which names and symbols to use.  I have chosen 
%  to use the names recommended by IUPAC.  These 
%  recommendations were published in ``Names and symbols of 
%  transfermium elements (IUPAC recommendations 1994)'', 
%  \textit{Pure and Applied Chemistry} \textbf{1994}, 
%  \textsl{66}(12), 2419-2421.  The recommended names are 
%  Dubnium, \Db, Joliotium, \Jl, Rutherfordium, \Rf, Bohrium, 
%  \Bh, Hahnium, \Hn, and Meitnerium, \Mt, respectively. 
%   
%  \section{``Userguide''}
%  \subsection{Requirements}     
%  The file |chemsym.sty| must be available in the user's
%  |TEXINPUTS| directories.
%  It requires \LaTeXe{} of 1994/06/01 (or newer).
%   
%  \subsection{Usage}
%  The package is included by stating\\
%  |  \usepackage{|$\ldots$|,chemsym,|$\ldots$|}| \\
%  In the document preamble.
%  No class or package options has any effect on |chemsym|.
%   
%  \subsection{Commands}         
%   
%  The |chemsym| package defines 110 user commands; one for 
%  each of the 109 first elements and Deuterium.  The command 
%  names are all made up of the chemical symbol preceeded by 
%  `|\|'; thus for Nitrogen, N, you type |\N|, and for Mercury, 
%  Hg, |\Hg|, etc.  Since there are six commands in \TeX /\LaTeX{} 
%  already of this kind (|\H|, |\O|, |\P|, |\S|, |\Re|, and 
%  |\Pr|), these old commands have to be renamed.  The names of 
%  choice are shown in the table below.  
%  \MakeShortVerb{\+}
%  \DeleteShortVerb{\|}
%  \begin{center}
%  \begin{tabular}{|l|l|l|}  \hline
%  \TeX{} & With +chemsym+ & Use/Example \\
%  command & you write & \\ \hline 
%  +\H+ & +\h+ & The accent in `\h{o}' \\ \hline 
%  +\O+ & +\OO+ & \OO \\ \hline 
%  +\P+ & +\PP+ & \PP \\ \hline 
%  +\S+ & +\Ss+ & \Ss \\ \hline 
%  +\Re+ & +\re+ & $\re$ (in math mode) \\ \hline 
%  +\Pr+ & +\pr+ & $\pr$ (in math mode) \\ \hline 
%  \end{tabular}
%  \end{center}
%  \DeleteShortVerb{\+}
%  \MakeShortVerb{\|}
%  Also, |\kemtkn|, a command 
%  for defining other chemical symbols and similar functions is 
%  avaliable.  |\kemtkn| takes one mandatory argument (the 
%  string to treat as a chemical symbol).  Two other 
%  internal commands, |\nsrrm| and |\nsrrms| are also 
%  avaliable.  |\nsrrm| simply puts its (mandatory) argument in 
%  |mathrm|.  |\nsrrms| does the same, but also adds a small 
%  space after it.  This space is a secons, optional, argument 
%  to |\nsrrms| which should be given in |em| units (without 
%  `|em|').  The default is |0.1em|.
%  For convenience when typing chemical formulas and units with 
%  exponents, the super- and subscript commands |^| and |_| are 
%  made avaliable also outside of math mode.  Thus, with 
%  |chemsym| you can type |m^2| instead of |m$^2$| for m^2 also 
%  in text mode.  Analogously, you can type |\H_2\O| for \H_2\O{} 
%  in both math and text mode and get the same result.  
%  Notice that text which you may put in the arguments of |^| 
%  and |_| automatically are set in math mode.  So if you want 
%  `M_{\mathrm{q}}' you must type |M_{\mathrm{q}}| and not only 
%  |M_q|, the latter comes out as `M_q'.  (This feature is not 
%  seriously disturbing since this feature with |^| and |_| is 
%  intended to be used mainly with numbers in the arguments.)  
%  
%  \section{Examples}
%  
%  This section gives some simple examples of the use of 
%  |chemsym|.  To write the formula for water in both math 
%  and text mode, 
%  you type |\H_2\O{}|, which gives \H_2\O{} as result.  Notice 
%  that this differs from typing |\H$_2$\O|, which gives 
%  \H$_2$\O{} as result.  In the first example, there is not 
%  any extra space added after the \H .  This addition of space 
%  makes formulas like \H\C\N{} (|\H\C\N|) easier to read than 
%  just typing |HCN|: HCN.
%  
%  \newcommand{\hH}{\kemtkn{{}^2H}}  
%  The use of the commands of |chemsym| is specially useful 
%  when chemical symbols are used as indicies in equations.  
%  The following example illustrates this:
%  \begin{equation}
%  \mathcal{M}_{\Fe(\H_2\O)_6} = 6\mathcal{M}_{\H_2\O} + \mathcal{M}_{\Fe}
%  \end{equation}
%  which was obtained by typing 
%  \begin{verbatim}
%  \begin{equation}
%  \mathcal{M}_{\Fe(\H_2\O)_6} = 6\mathcal{M}_{\H_2\O} + \mathcal{M}_{\Fe}
%  \end{equation}
%  \end{verbatim}
%  It is also easy 
%  to define other chemical symbols commands, such as commands 
%  for specific isotopes.  Suppose you rather want to use the 
%  notation \hH{} than \D{} for Deuterium.  This may be 
%  defined as:\\ \hspace*{2mm} |\newcommand{\hH}{\kemtkn{{}^2H}}|\\ 
%  (which was 
%  used above: \ldots |notation \hH{} than \D{} for|\ldots). 
%  Internally, |chemsym| uses this syntax to define the various 
%  commands for the chemical symbols.  
%   
%  \section{Known Problems and Limitations}
%  
%  At the present, no disturbing problems or limitations are 
%  known. :--)
%  
%  \section{Sending a Bug Report}
%  |chemsym| is likely to contain bugs.
%  Reports of bugs in the package are most welcome.  
%  Before filing a bug report,
%  please take the following actions:
%  \begin{enumerate}
%  \item Ensure your problem is not due to your inputfile;
%  \item Ensure your problem is not due to 
%     your own package(s) or class(es);
%  \item Ensure your problem is not covered in the section 
%     ''Known Problems'' above;
%  \item  Try to locate the problem by writing a minimal 
%     \LaTeX{} input file which reproduces the problem.  
%     Include the command\\ 
%     |  \setcounter{errorcontextlines}{999}|\\ 
%     in your input;
%  \item Run your file through \LaTeX ;
%  \item Send a description of your problem, the input file 
%     and the log file via e-mail to:\\
%     \hspace*{5mm} \texttt{matsd@physchem.kth.se}.
%  \end{enumerate}
%  {\itshape Enjoy your \LaTeX!\raisebox{-\baselineskip}{mats d.}}
%  \newpage 
%  
%  \section{The Code} 
%  For the interested reader(s), here is a short description 
%  of the code. 
% \iffalse
%<*paketkod>
% \fi
%  First, the package is to identify itself:  
%    \begin{macrocode} 
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{chemsym}[1995/04/25 v.0.2 Chemical symbols]
\typeout{chemsym.sty included, version 0.2.  (c) 1995 by Mats Dahlgren}
%    \end{macrocode}
%  First in the real code, we have to rename the old functions 
%  |\H|, |\O|, |\P|, |\S|, |\Re|, and |\Pr|:
%    \begin{macrocode}
\let\h=\H
\let\OO=\O
\let\PP=\P
\let\Ss=\S
\let\re=\Re
\let\pr=\Pr
%    \end{macrocode}
%  Now, we make |^| and |_| work without |$...$| also in text 
%  mode:
%    \begin{macrocode}
\def\sprscrpt#1{\ensuremath{^{#1}}}
\def\sbscrpt#1{\ensuremath{_{#1}}}
\catcode`\^ \active 
\catcode`\_ \active 
\let^=\sprscrpt 
\let_=\sbscrpt 
%    \end{macrocode}
%  Then, some general macros are defined:
%    \begin{macrocode}
\newcommand{\nsrrm}[1]{\ensuremath{\mathrm{#1}}}
\newcommand{\nsrrms}[2][0.1]{\ensuremath{\mathrm{#2}\kern #1em}}
\newcommand{\kemtkn}[1]{\@ifnextchar_{\nsrrm{#1}}{\@ifnextchar^{\nsrrm{#1}}%
  {\@ifnextchar){\nsrrm{#1}}{\@ifnextchar({\nsrrm{#1}}{\nsrrms{#1}}}}}}
%    \end{macrocode}
%  As you can see, you can change the spacing in the chemical 
%  formulas by making changes to |\nsrrms|.  This you can do 
%  with |\renewcommand| 
%  in your document preamble or in another package file.  
%  Then we define the 
%  110 commands for chemical symbols:
%    \begin{macrocode}
\renewcommand{\H}{\kemtkn{H}} 
\newcommand{\D}{\kemtkn{D}} 
\newcommand{\He}{\kemtkn{He}} 
\newcommand{\Li}{\kemtkn{Li}} 
\newcommand{\Be}{\kemtkn{Be}} 
\newcommand{\B}{\kemtkn{B}} 
\newcommand{\C}{\kemtkn{C}} 
\newcommand{\N}{\kemtkn{N}} 
\renewcommand{\O}{\kemtkn{O}} 
\newcommand{\F}{\kemtkn{F}} 
\newcommand{\Ne}{\kemtkn{Ne}} 
\newcommand{\Na}{\kemtkn{Na}} 
\newcommand{\Mg}{\kemtkn{Mg}} 
\newcommand{\Al}{\kemtkn{Al}} 
\newcommand{\Si}{\kemtkn{Si}} 
\renewcommand{\P}{\kemtkn{P}} 
\renewcommand{\S}{\kemtkn{S}} 
\newcommand{\Cl}{\kemtkn{Cl}} 
\newcommand{\Ar}{\kemtkn{Ar}} 
\newcommand{\K}{\kemtkn{K}} 
\newcommand{\Ca}{\kemtkn{Ca}} 
\newcommand{\Sc}{\kemtkn{Sc}} 
\newcommand{\Ti}{\kemtkn{Ti}} 
\newcommand{\V}{\kemtkn{V}} 
\newcommand{\Cr}{\kemtkn{Cr}} 
\newcommand{\Mn}{\kemtkn{Mn}} 
\newcommand{\Fe}{\kemtkn{Fe}} 
\newcommand{\Co}{\kemtkn{Co}} 
\newcommand{\Ni}{\kemtkn{Ni}} 
\newcommand{\Cu}{\kemtkn{Cu}} 
\newcommand{\Zn}{\kemtkn{Zn}} 
\newcommand{\Ga}{\kemtkn{Ga}} 
\newcommand{\Ge}{\kemtkn{Ge}} 
\newcommand{\As}{\kemtkn{As}} 
\newcommand{\Se}{\kemtkn{Se}} 
\newcommand{\Br}{\kemtkn{Br}} 
\newcommand{\Kr}{\kemtkn{Kr}} 
\newcommand{\Rb}{\kemtkn{Rb}} 
\newcommand{\Sr}{\kemtkn{Sr}} 
\newcommand{\Y}{\kemtkn{Y}} 
\newcommand{\Zr}{\kemtkn{Zr}} 
\newcommand{\Nb}{\kemtkn{Nb}} 
\newcommand{\Mo}{\kemtkn{Mo}} 
\newcommand{\Tc}{\kemtkn{Tc}} 
\newcommand{\Ru}{\kemtkn{Ru}} 
\newcommand{\Rh}{\kemtkn{Rh}} 
\newcommand{\Pd}{\kemtkn{Pd}} 
\newcommand{\Ag}{\kemtkn{Ag}} 
\newcommand{\Cd}{\kemtkn{Cd}} 
\newcommand{\In}{\kemtkn{In}} 
\newcommand{\Sn}{\kemtkn{Sn}} 
\newcommand{\Sb}{\kemtkn{Sb}} 
\newcommand{\Te}{\kemtkn{Te}} 
\newcommand{\I}{\kemtkn{I}} 
\newcommand{\Xe}{\kemtkn{Xe}} 
\newcommand{\Cs}{\kemtkn{Cs}} 
\newcommand{\Ba}{\kemtkn{Ba}} 
\newcommand{\La}{\kemtkn{La}} 
\newcommand{\Ce}{\kemtkn{Ce}} 
\renewcommand{\Pr}{\kemtkn{Pr}} 
\newcommand{\Nd}{\kemtkn{Nd}} 
\newcommand{\Pm}{\kemtkn{Pm}} 
\newcommand{\Sm}{\kemtkn{Sm}} 
\newcommand{\Eu}{\kemtkn{Eu}} 
\newcommand{\Gd}{\kemtkn{Gd}} 
\newcommand{\Tb}{\kemtkn{Tb}} 
\newcommand{\Dy}{\kemtkn{Dy}} 
\newcommand{\Ho}{\kemtkn{Ho}} 
\newcommand{\Er}{\kemtkn{Er}} 
\newcommand{\Tm}{\kemtkn{Tm}} 
\newcommand{\Yb}{\kemtkn{Yb}} 
\newcommand{\Lu}{\kemtkn{Lu}} 
\newcommand{\Hf}{\kemtkn{Hf}} 
\newcommand{\Ta}{\kemtkn{Ta}} 
\newcommand{\W}{\kemtkn{W}} 
\renewcommand{\Re}{\kemtkn{Re}} 
\newcommand{\Os}{\kemtkn{Os}} 
\newcommand{\Ir}{\kemtkn{Ir}} 
\newcommand{\Pt}{\kemtkn{Pt}} 
\newcommand{\Au}{\kemtkn{Au}} 
\newcommand{\Hg}{\kemtkn{Hg}} 
\newcommand{\Tl}{\kemtkn{Tl}} 
\newcommand{\Pb}{\kemtkn{Pb}} 
\newcommand{\Bi}{\kemtkn{Bi}} 
\newcommand{\Po}{\kemtkn{Po}} 
\newcommand{\At}{\kemtkn{At}} 
\newcommand{\Rn}{\kemtkn{Rn}} 
\newcommand{\Fr}{\kemtkn{Fr}} 
\newcommand{\Ra}{\kemtkn{Ra}} 
\newcommand{\Ac}{\kemtkn{Ac}} 
\newcommand{\Th}{\kemtkn{Th}} 
\newcommand{\Pa}{\kemtkn{Pa}} 
\newcommand{\U}{\kemtkn{U}} 
\newcommand{\Np}{\kemtkn{Np}} 
\newcommand{\Pu}{\kemtkn{Pu}} 
\newcommand{\Am}{\kemtkn{Am}} 
\newcommand{\Cm}{\kemtkn{Cm}} 
\newcommand{\Bk}{\kemtkn{Bk}} 
\newcommand{\Cf}{\kemtkn{Cf}} 
\newcommand{\Es}{\kemtkn{Es}} 
\newcommand{\Fm}{\kemtkn{Fm}} 
\newcommand{\Md}{\kemtkn{Md}} 
\newcommand{\No}{\kemtkn{No}} 
\newcommand{\Lr}{\kemtkn{Lr}} 
\newcommand{\Db}{\kemtkn{Db}} 
\newcommand{\Jl}{\kemtkn{Jl}} 
\newcommand{\Rf}{\kemtkn{Rf}} 
\newcommand{\Bh}{\kemtkn{Bh}} 
\newcommand{\Hn}{\kemtkn{Hn}} 
\newcommand{\Mt}{\kemtkn{Mt}} 
%    \end{macrocode}
%  This brings us to the end of |chemsym|.  Hope you'll 
%  enjoy it!
% \iffalse
% END of it all!
%</paketkod>
%<*driver>
\documentclass[a4paper]{article}
\usepackage{doc}
\usepackage{chemsym}
\textwidth=150mm
\textheight=210mm
\topmargin=0mm
\oddsidemargin=5mm
\evensidemargin=5mm
\begin{document}
  \DocInput{chemsym.dtx} 
  \PrintChanges
\end{document}
%</driver>
% \fi
%
% \Finale
%
\endinput 
