next up previous contents index
Next: Theorems and related Up: Using math fonts Previous: Introduction

Recommended use of math font commands

If you find yourself employing math font commands frequently in your document, you might wish that they had shorter names, such as mb instead of mathbf. Of course, there is nothing to keep you from providing such abbreviations for yourself by suitable newcommand statements. But for / to provide shorter names would actually be a disservice to authors, as that would obscure a much better alternative: defining custom command names derived from the names of the underlying mathematical objects, rather than from the names of the fonts used to distinguish the objects. For example, if you are using bold to indicate vectors, then you will be better served in the long run if you define a `vector' command instead of a `math-bold' command:

  \newcommand{\vec}[1]{\mathbf{#1}}
whereupon gif you can write |a + b| to produce . If you decide several months down the road that you want to use the bold font for some other purpose, and mark vectors by a small over-arrow instead, then you can put the change into effect merely by changing the definition of vec; otherwise you would have to replace all occurrences of mathbf throughout your document, perhaps even needing to inspect each one to see whether it is indeed an instance of a vector.

It can also be useful to assign distinct command names for different letters of a particular font:

\DeclareSymbolFont{AMSb}{U}{msb}{m}{n}% or use amsfonts package
\DeclareMathSymbol{\C}{\mathalpha}{AMSb}{"43}
\DeclareMathSymbol{\R}{\mathalpha}{AMSb}{"52}
These statements would define the commands C and R to produce blackboard-bold letters from the `AMSb' math symbols font. If you refer often to the complex numbers or real numbers in your document, you might find this method more convenient than (let's say) defining a field command and writing |C|, |R|. But for maximum flexibility and control, define such a field command and then define C and R in terms of that command:
\usepackage{amsfonts}% to get the \mathbb alphabet
\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\C}{\field{C}}
\newcommand{\R}{\field{R}}



next up previous contents index
Next: Theorems and related Up: Using math fonts Previous: Introduction



Carsten Braeutigam
Sun Jun 25 14:57:10 MET DST 1995