The mathcomp package for using Text Companion fonts in math mode ^{∗}

Tilmann Böß

             tilmann@physik.uni-wuerzburg.de

1997/06/12

1 Purpose

It always bothered me that I had to write the unit ‘μm’ with an italic ‘μ’. There is a ‘µ’ 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 L^{A}TEX 2ε. 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:

         $\tcohm$  �  $\tcperthousand$  ‰
         $\tccentigrade$ �  $\tcpertenthousand$  �
         $\tcmu$  µ  $\tcdigitoldstyle{0}$ 0
         ...  . . .  $\tcdigitoldstyle{9}$ 9

The names for the symbols are the same as in the textcomp package except that you have to type \tcsymbol-name instead of \textsymbol-name . Only the oldstyle digits are defined in another way, see section 2. For the Computer Modern fonts, these are available for math versions ‘normal’ and ‘bold’. The fonts used are TS1/cmr/m/n for ‘normal’ and TS1/cmr/bx/n for ‘bold’. This is the default if no package option is specified. The font family for the TC math fonts can be changed by a package option: Specifying rmdefault chooses the default roman document font as font family for the TC math fonts. This is especially useful together with the ccfonts package by Walter Schmidt. Any other option is taken as a font family name that is chosen for the TC math fonts. This is mostly untested yet. The package is based on the textcomp package^{1} by Sebastian Rahtz. This package is required because I didn’t want to declare the font encoding TS1 again. The mathcomp package is preliminary because both the TS1 encoding and the textcomp package might change in the future.

∗Preliminary version v0.1d

1Ver. 1.4, 1995/12/11

2 The code

The code is quite simple, short and obvious so there is not much to say. The package is announced (but not too loudly).

 1 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 2 \ProvidesPackage{mathcomp}[\filedate\space\fileversion\space(TBo)]

The textcomp package is loaded to define the TS1 encoding.

 3 \RequirePackage{textcomp}

The new symbol font TS1/cmr/m/n is declared under the name TC. It is the default font for all math versions. For the math version ‘bold’ TS1/cmr/bx/n is defined.

 4 \DeclareSymbolFont{TC}{TS1}{cmr}{m}{n}
 5 \SetSymbolFont{TC}{bold}{TS1}{cmr}{bx}{n}

The package option rmdefault overwrites these declarations with the document’s roman font family.

 6 \DeclareOption{rmdefault}{
 7 \DeclareSymbolFont{TC}{TS1}{\rmdefault}{m}{n}
 8 \SetSymbolFont{TC}{bold}{TS1}{\rmdefault}{bx}{n}
 9 }

Any other package option overwrites the font declarations with the font family given.

10 \DeclareOption*{
11 \DeclareSymbolFont{TC}{TS1}{\CurrentOption}{m}{n}
12 \SetSymbolFont{TC}{bold}{TS1}{\CurrentOption}{bx}{n}

13 }

The symbol alphabet for the oldstyle digits is declared:

14 \DeclareSymbolFontAlphabet{\tcdigitoldstyle}{TC}

Finally, the extra symbols are defined.

15 \DeclareMathSymbol{\tcohm}{\mathalpha}{TC}{'127}
16 \DeclareMathSymbol{\tcperthousand}{\mathalpha}{TC}{'207}
17 \DeclareMathSymbol{\tccentigrade}{\mathalpha}{TC}{'211}
18 \DeclareMathSymbol{\tcpertenthousand}{\mathalpha}{TC}{'230}
19 \DeclareMathSymbol{\tcmu}{\mathalpha}{TC}{'265}

And the package options are processed.

20 \ProcessOptions