| 1 |
% \iffalse |
| 2 |
% |
| 3 |
%% File `mathcomp.dtx'. |
| 4 |
%% Copyright (C) 1996-2001 Tilmann B{\"o}{\ss}. |
| 5 |
%% This program can be redistributed and/or modified under the terms |
| 6 |
%% of the LaTeX Project Public License Distributed from CTAN |
| 7 |
%% archives in directory macros/latex/base/lppl.txt; either |
| 8 |
%% version 1 of the License, or any later version. |
| 9 |
% |
| 10 |
%% Please mail suggestions, enhancements ... to the author. |
| 11 |
% |
| 12 |
% \fi |
| 13 |
|
| 14 |
% ^^A don't forget to update \mathcompversion + \mathcompdate below |
| 15 |
\def\fileversion{v0.1f} |
| 16 |
\def\filedate{2001/01/07} |
| 17 |
|
| 18 |
% |
| 19 |
% \changes{0.1a}{1996/10/07}{first usable version} |
| 20 |
% \changes{0.1b}{1996/10/08}{documentation added} |
| 21 |
% \changes{0.1c}{1996/10/09}{better documentation} |
| 22 |
% \changes{0.1d}{1997/06/12}{added style options to change font family} |
| 23 |
% \changes{0.1e}{1998/08/27}{corrected \texttt{\symbol{92}mathalpha} to \texttt{\symbol{92}mathord}} |
| 24 |
% \changes{0.1f}{2001/01/07}{protected against bold mathversion being undefined (WaS)} |
| 25 |
% \changes{0.1f}{2001/01/07}{added \texttt{\symbol{92}tcdegree} and \texttt{\symbol{92}tccelsius} (WaS)} |
| 26 |
% \changes{0.1f}{2001/01/07}{fixed \texttt{\symbol{92}dagger} and \texttt{\symbol{92}ddagger} (WaS)} |
| 27 |
% \CheckSum{64} |
| 28 |
% |
| 29 |
% \iffalse |
| 30 |
%<*driver> |
| 31 |
\def\mathcompversion{v0.1f} % version of this file, not of textcomp! |
| 32 |
\def\mathcompdate{2001/01/07} % date of this file, not of textcomp! |
| 33 |
\def\textcomp{\textsf{textcomp}} |
| 34 |
\def\mathcomp{\textsf{mathcomp}} |
| 35 |
\def\TSone{\textsf{TS1}} |
| 36 |
\documentclass{ltxdoc} |
| 37 |
\usepackage{textcomp, mathcomp} |
| 38 |
\RecordChanges |
| 39 |
\setlength{\parindent}{0pt} |
| 40 |
\setlength{\parskip}{3pt plus1pt minus1pt} |
| 41 |
\begin{document} |
| 42 |
\title{The \mathcomp\ package for using Text Companion fonts in math |
| 43 |
mode |
| 44 |
\thanks{Preliminary version \mathcompversion}} |
| 45 |
\author{Tilmann B{\"o}{\ss}\\ \texttt{[email protected]}} |
| 46 |
\date{\mathcompdate} |
| 47 |
\maketitle |
| 48 |
\DocInput{mathcomp.dtx} \PrintChanges |
| 49 |
\end{document} |
| 50 |
%</driver> |
| 51 |
% \fi |
| 52 |
% |
| 53 |
% \section{Purpose} |
| 54 |
% |
| 55 |
% It always bothered me that I had to write the unit `$\mu$m' with an italic |
| 56 |
% `$\mu$'. |
| 57 |
% There is a `\textmu' in the Text Companion (TC) fonts, and it's |
| 58 |
% available in most of the font families, shapes and series. |
| 59 |
% The \textcomp\ package provides access to the TC fonts from \LaTeXe. |
| 60 |
% But I wanted to use some of these fonts in math mode, so I decided to write a |
| 61 |
% package to achieve this goal. |
| 62 |
% |
| 63 |
% Most of the characters don't make sense in math mode or they are already |
| 64 |
% present in the standard math fonts. |
| 65 |
% The useful ones are: |
| 66 |
% |
| 67 |
% \begin{center} |
| 68 |
% \begin{tabular}{ll@{\qquad}ll} |
| 69 |
% |$\tcohm$| & $\tcohm$ & |$\tcperthousand$| & $\tcperthousand$ \\ |
| 70 |
% |$\tccelsius$| & $\tccelsius$ & |$\tcpertenthousand$| |
| 71 |
% & $\tcpertenthousand$ \\ |
| 72 |
% |$\tcmu$| & $\tcmu$ & |$\tcdegree$| & $\tcdegree$\\ |
| 73 |
% |$\tcdigitoldstyle{0}$| & $\tcdigitoldstyle{0}$ \dots & |
| 74 |
% |$\tcdigitoldstyle{9}$| & $\tcdigitoldstyle{9}$ \\ |
| 75 |
% \end{tabular} |
| 76 |
% \end{center} |
| 77 |
% The names for the symbols are the same as in the \textcomp\ package except |
| 78 |
% that you have to type \texttt{\bslash tc\textit{symbol-name}} instead of |
| 79 |
% \texttt{\bslash text\textit{symbol-name}}. |
| 80 |
% The oldstyle digits are defined in a different way, see section~\ref{s:code}. |
| 81 |
% |\tccelsius| is also available with the name |\tccentigrade|, for the |
| 82 |
% sake of compatibility with earlier versions of the \textcomp\ and |
| 83 |
% \mathcomp\ packages. |
| 84 |
% |
| 85 |
% Additionally, the \mathcomp\ package will redefine the macros |
| 86 |
% |\dagger| and |\ddagger| so as to take their symbols from the |
| 87 |
% text companion fonts, thus also making sure that the symbols |
| 88 |
% produced by |\fnsymbol| will always match the text font family. |
| 89 |
% |
| 90 |
% The extra math symbols are made available for math versions `normal' |
| 91 |
% and `bold', provided that a `bold' math version is actually defined. |
| 92 |
% |
| 93 |
% The default behaviour of the \mathcomp\ package is to use the |
| 94 |
% text companion fonts from the font family CM~Roman. |
| 95 |
% Any other text font family can be specified as a package option; |
| 96 |
% e.g., say |\usepackage[ppl]{mathcomp}| to make \mathcomp\ use |
| 97 |
% the Adobe~Palatino (|ppl|) text companion fonts. The option |
| 98 |
% |rmdefault| is special: It makes the \mathcomp\ package load the |
| 99 |
% particular font family which has been chosen as the default roman |
| 100 |
% font family (|\rmdefault|) for the document, whatever it is. |
| 101 |
% |
| 102 |
% The package is based on the \textcomp\ |
| 103 |
% package\footnote{Ver.~1.4, 1995/12/11} by Sebastian Rahtz. |
| 104 |
% This package is required because I didn't want to declare the font encoding |
| 105 |
% \TSone\ once again. |
| 106 |
% |
| 107 |
% The \mathcomp\ package is preliminary because both the \TSone\ encoding and the |
| 108 |
% \textcomp\ package might change in the future. |
| 109 |
% |
| 110 |
% \StopEventually{} |
| 111 |
% |
| 112 |
% \section{The code}\label{s:code} |
| 113 |
% |
| 114 |
% The code is quite simple, short and obvious so there is not much to say. |
| 115 |
% The package is announced (but not too loudly). |
| 116 |
% \begin{macrocode} |
| 117 |
\NeedsTeXFormat{LaTeX2e}[1995/12/01] |
| 118 |
\ProvidesPackage{mathcomp}[\filedate\space\fileversion\space(TBo)] |
| 119 |
% \end{macrocode} |
| 120 |
% |
| 121 |
% The \textcomp\ package is loaded to define the \TSone\ encoding. |
| 122 |
% \begin{macrocode} |
| 123 |
\RequirePackage{textcomp} |
| 124 |
% \end{macrocode} |
| 125 |
% |
| 126 |
% The new symbol font |TS1/cmr/m/n| is declared under the name \texttt{TC}. |
| 127 |
% It is the default font for all math versions. |
| 128 |
% For the math version `bold' |TS1/cmr/bx/n| is defined if bold math is |
| 129 |
% available\footnote{Thanks to Walter Schmidt for this fix and the other |
| 130 |
% improvements in version 0.1f.}. |
| 131 |
% \begin{macrocode} |
| 132 |
\DeclareSymbolFont{TC}{TS1}{cmr}{m}{n} |
| 133 |
\ifx\mv@bold\@undefined\else |
| 134 |
\SetSymbolFont{TC}{bold}{TS1}{cmr}{bx}{n} |
| 135 |
\fi |
| 136 |
% \end{macrocode} |
| 137 |
% |
| 138 |
% The package option |rmdefault| overwrites these declarations with the |
| 139 |
% document's roman font family. |
| 140 |
% |
| 141 |
% \begin{macrocode} |
| 142 |
\DeclareOption{rmdefault}{ |
| 143 |
\DeclareSymbolFont{TC}{TS1}{\rmdefault}{m}{n} |
| 144 |
\ifx\mv@bold\@undefined\else |
| 145 |
\SetSymbolFont{TC}{bold}{TS1}{\rmdefault}{bx}{n} |
| 146 |
\fi |
| 147 |
} |
| 148 |
% \end{macrocode} |
| 149 |
% |
| 150 |
% Any other package option overwrites the font declarations with the font family |
| 151 |
% given. |
| 152 |
% |
| 153 |
% \begin{macrocode} |
| 154 |
\DeclareOption*{ |
| 155 |
\DeclareSymbolFont{TC}{TS1}{\CurrentOption}{m}{n} |
| 156 |
\ifx\mv@bold\@undefined\else |
| 157 |
\SetSymbolFont{TC}{bold}{TS1}{\CurrentOption}{bx}{n} |
| 158 |
\fi |
| 159 |
} |
| 160 |
% \end{macrocode} |
| 161 |
% |
| 162 |
% The symbol alphabet for the oldstyle digits is declared: |
| 163 |
% \begin{macrocode} |
| 164 |
\DeclareSymbolFontAlphabet{\tcdigitoldstyle}{TC} |
| 165 |
% \end{macrocode} |
| 166 |
% |
| 167 |
% Finally, the extra symbols\footnote{Thanks to D.~Arsenau who found |
| 168 |
% the error that was corrected in version 0.1e.} are defined. |
| 169 |
% \begin{macrocode} |
| 170 |
\DeclareMathSymbol{\tcohm}{\mathord}{TC}{'127} |
| 171 |
\DeclareMathSymbol{\tcperthousand}{\mathord}{TC}{'207} |
| 172 |
\DeclareMathSymbol{\tccelsius}{\mathord}{TC}{'211} |
| 173 |
\let\tccentigrade=\tccelsius |
| 174 |
\DeclareMathSymbol{\tcdegree}{\mathord}{TC}{176} |
| 175 |
\DeclareMathSymbol{\tcpertenthousand}{\mathord}{TC}{'230} |
| 176 |
\DeclareMathSymbol{\tcmu}{\mathord}{TC}{'265} |
| 177 |
\DeclareMathSymbol{\dagger}{\mathbin}{TC}{132} |
| 178 |
\DeclareMathSymbol{\ddagger}{\mathbin}{TC}{133} |
| 179 |
|
| 180 |
% \end{macrocode} |
| 181 |
% |
| 182 |
% And the package options are processed. |
| 183 |
% |
| 184 |
% \begin{macrocode} |
| 185 |
\ProcessOptions |
| 186 |
% \end{macrocode} |
| 187 |
% |
| 188 |
% \Finale |
| 189 |
\endinput |
| 190 |
|