% \iffalse
%
%% File `mathcomp.dtx'.
%% Copyright (C) 1996-2001 Tilmann B{\"o}{\ss}.
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%
%% Please mail suggestions, enhancements ... to the author.
%
% \fi

% ^^A  don't forget to update \mathcompversion + \mathcompdate below
\def\fileversion{v0.1f}
\def\filedate{2001/01/07}

%
% \changes{0.1a}{1996/10/07}{first usable version}
% \changes{0.1b}{1996/10/08}{documentation added}
% \changes{0.1c}{1996/10/09}{better documentation}
% \changes{0.1d}{1997/06/12}{added style options to change font family}
% \changes{0.1e}{1998/08/27}{corrected \texttt{\symbol{92}mathalpha} to \texttt{\symbol{92}mathord}}
% \changes{0.1f}{2001/01/07}{protected against bold mathversion being undefined (WaS)}
% \changes{0.1f}{2001/01/07}{added \texttt{\symbol{92}tcdegree} and \texttt{\symbol{92}tccelsius} (WaS)}
% \changes{0.1f}{2001/01/07}{fixed \texttt{\symbol{92}dagger} and \texttt{\symbol{92}ddagger} (WaS)}
% \CheckSum{64}
%
% \iffalse
%<*driver>
\def\mathcompversion{v0.1f}	 %  version of this file, not of textcomp!
\def\mathcompdate{2001/01/07}	 %  date of this file, not of textcomp!
\def\textcomp{\textsf{textcomp}}
\def\mathcomp{\textsf{mathcomp}}
\def\TSone{\textsf{TS1}}
\documentclass{ltxdoc}
\usepackage{textcomp, mathcomp}
\RecordChanges
\setlength{\parindent}{0pt}
\setlength{\parskip}{3pt plus1pt minus1pt}
\begin{document}
 \title{The \mathcomp\ package for using Text Companion fonts in math
	mode
	\thanks{Preliminary version \mathcompversion}}
 \author{Tilmann B{\"o}{\ss}\\ \texttt{tboess@t-online.de}}
 \date{\mathcompdate}
 \maketitle
 \DocInput{mathcomp.dtx} \PrintChanges
\end{document}
%</driver>
% \fi
%
% \section{Purpose}
%
% It always bothered me that I had to write the unit `$\mu$m' with an italic
% `$\mu$'.
% There is a `\textmu' in the Text Companion (TC) fonts, and it's
% available in most of the font families, shapes and series.
% The \textcomp\ package provides access to the TC fonts from \LaTeXe.
% But I wanted to use some of these fonts in math mode, so I decided to write a
% package to achieve this goal.
%
% Most of the characters don't make sense in math mode or they are already
% present in the standard math fonts.
% The useful ones are:
%
% \begin{center}
% \begin{tabular}{ll@{\qquad}ll}
% |$\tcohm$| & $\tcohm$ & |$\tcperthousand$| & $\tcperthousand$ \\
% |$\tccelsius$| & $\tccelsius$ & |$\tcpertenthousand$|
% & $\tcpertenthousand$ \\
% |$\tcmu$| & $\tcmu$ & |$\tcdegree$| & $\tcdegree$\\
% |$\tcdigitoldstyle{0}$| & $\tcdigitoldstyle{0}$ \dots & 
% |$\tcdigitoldstyle{9}$| & $\tcdigitoldstyle{9}$ \\
% \end{tabular}
% \end{center}
% The names for the symbols are the same as in the \textcomp\ package except
% that you have to type \texttt{\bslash tc\textit{symbol-name}} instead of
% \texttt{\bslash text\textit{symbol-name}}.
% The oldstyle digits are defined in a different way, see section~\ref{s:code}.
% |\tccelsius| is also available with the name |\tccentigrade|, for the
% sake of compatibility with earlier versions of the \textcomp\ and 
% \mathcomp\ packages.
%
% Additionally, the \mathcomp\ package will redefine the macros
% |\dagger| and |\ddagger| so as to take their symbols from the
% text companion fonts, thus also making sure that the symbols 
% produced by |\fnsymbol| will always match the text font family.  
%
% The extra math symbols are made available for math versions `normal'
% and `bold', provided that a `bold' math version is actually defined.
%
% The default behaviour of the \mathcomp\ package is to use the
% text companion fonts from the font family CM~Roman.
% Any other text font family can be specified as a package option;
% e.g., say |\usepackage[ppl]{mathcomp}| to make \mathcomp\ use
% the Adobe~Palatino (|ppl|) text companion fonts.  The option 
% |rmdefault| is special:  It makes the \mathcomp\ package load the
% particular font family which has been chosen as the default roman 
% font family (|\rmdefault|) for the document, whatever it is.
%
% The package is based on the \textcomp\
% package\footnote{Ver.~1.4, 1995/12/11} by Sebastian Rahtz.
% This package is required because I didn't want to declare the font encoding
% \TSone\ once again.
%
% The \mathcomp\ package is preliminary because both the \TSone\ encoding and the
% \textcomp\ package might change in the future.
%
% \StopEventually{}
%
% \section{The code}\label{s:code}
%
% The code is quite simple, short and obvious so there is not much to say.
% The package is announced (but not too loudly).
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{mathcomp}[\filedate\space\fileversion\space(TBo)]
%    \end{macrocode}
%
% The \textcomp\ package is loaded to define the \TSone\ encoding.
%    \begin{macrocode}
\RequirePackage{textcomp}
%    \end{macrocode}
%
% The new symbol font |TS1/cmr/m/n| is declared under the name \texttt{TC}.
% It is the default font for all math versions.
% For the math version `bold' |TS1/cmr/bx/n| is defined if bold math is
% available\footnote{Thanks to Walter Schmidt for this fix and the other
% improvements in version 0.1f.}.
%    \begin{macrocode}
\DeclareSymbolFont{TC}{TS1}{cmr}{m}{n}
\ifx\mv@bold\@undefined\else
  \SetSymbolFont{TC}{bold}{TS1}{cmr}{bx}{n}
\fi  
%    \end{macrocode}
%
% The package option |rmdefault| overwrites these declarations with the
% document's roman font family.
%
%    \begin{macrocode}
\DeclareOption{rmdefault}{
\DeclareSymbolFont{TC}{TS1}{\rmdefault}{m}{n}
\ifx\mv@bold\@undefined\else
  \SetSymbolFont{TC}{bold}{TS1}{\rmdefault}{bx}{n}
\fi
}
%    \end{macrocode}
%
% Any other package option overwrites the font declarations with the font family
% given.
%
%    \begin{macrocode}
\DeclareOption*{
\DeclareSymbolFont{TC}{TS1}{\CurrentOption}{m}{n}
\ifx\mv@bold\@undefined\else
  \SetSymbolFont{TC}{bold}{TS1}{\CurrentOption}{bx}{n}
\fi  
}
%    \end{macrocode}
%
% The symbol alphabet for the oldstyle digits is declared:
%    \begin{macrocode}
\DeclareSymbolFontAlphabet{\tcdigitoldstyle}{TC}
%    \end{macrocode}
%
% Finally, the extra symbols\footnote{Thanks to D.~Arsenau who found
% the error that was corrected in version 0.1e.} are defined.
%    \begin{macrocode}
\DeclareMathSymbol{\tcohm}{\mathord}{TC}{'127}
\DeclareMathSymbol{\tcperthousand}{\mathord}{TC}{'207}
\DeclareMathSymbol{\tccelsius}{\mathord}{TC}{'211}
\let\tccentigrade=\tccelsius
\DeclareMathSymbol{\tcdegree}{\mathord}{TC}{176}
\DeclareMathSymbol{\tcpertenthousand}{\mathord}{TC}{'230}
\DeclareMathSymbol{\tcmu}{\mathord}{TC}{'265}
\DeclareMathSymbol{\dagger}{\mathbin}{TC}{132}
\DeclareMathSymbol{\ddagger}{\mathbin}{TC}{133}

%    \end{macrocode}
%
% And the package options are processed.
%
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
%
% \Finale
\endinput