\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{isomath} [2010/08/23 v0.4 math according to ISO 31]
Abstract
The isomath package enables formatting Greek and Latin letters as symbols for vectors, matrices, and tensors in the typefaces recommended for scientific papers by the International Standard ISO 31.
0.1 | 2008-09-25 | first public version. |
0.2 | 2008-10-02 | bugfix: a usage example was uncommented; |
updated documentation; | ||
define mathsans only if OMLmathsans is true; | ||
option reuseMathalphabets -> reuseMathAlphabets. | ||
0.3 | 2009-06-19 | documentation update; |
fix OMLmathrm and OMLmathsans definitions; | ||
switch license to LPP. | ||
0.4 | 2010-08-23 | split user documentation from literate source; |
option scaled; | ||
documentation update. |
The package fixmath by Walter Schmidt defines Greek letters as symbols of type \mathalpha and takes them from the letters SymbolFont in \mathnormal (as opposed to operators in fontmath.ltx).
fixmath also defines the \mathbold alphabet, setting it to cmm. This definition will be overwritten with a configurable value for the font family below.
\RequirePackage{fixmath}
The kvoptions package in the oberdiek bundle facilitates the setup of package options and provides a key=value interface (based on keyval):
\RequirePackage{kvoptions}
Family for roman math fonts. Must be available in OML encoding. The default is to use the corresponding text font family (\rmdefault).
\DeclareStringOption[\rmdefault]{rmdefault}
Family for sans-serif math fonts. The default selects CM Bright, as most sans serif fonts are not available in OML encoding:
\DeclareStringOption[cmbr]{sfdefault}
The sans-serif fonts, fav (Arev), llcmss (LX Fonts), and iwona can be scaled with the scaled option.
\DeclareStringOption[1.0]{scaled} % Use a key definition like in inconsolata.sty (cf. also helvet.sty)? % \define@key{isomath}{scaled}[1.0]{\def\isomath@scaled{s*[#1]}}
The definition of new math alphabets can lead to a “too many math alphabets used in version normal” error.
As a workaround, this option tells isomath to re-use the existing \mathbf and \mathsf alphabets for italic bold and sans-serif bold.
\DeclareBoolOption{reuseMathAlphabets}
The following options cause isomath to (re)define the corresponding math alphabets in OML encoding:
\DeclareBoolOption{OMLmathrm} \DeclareBoolOption{OMLmathbf} \DeclareBoolOption{OMLmathsf} \DeclareBoolOption{OMLmathsans} \DeclareBoolOption{OMLmathtt}
Setting these options enables access to small Greek letters in different shapes with e.g. \mathrm{\pi} if an OML encoded font is available. Currently, only the mathdesign fonts support roman in OML encoding.
With some packages, these options can result in a “too many math alphabets used in version normal” error.
In math, LaTeX uses “absolute” fontnames instead of a selection by family, shape, and weight because typefaces have a semantic meaning (see fntguide).
isomath defines a math alphabet for every required font variant and optionally re-defines the standard math alphabets in OML font encoding.
Unfortunately, the number of math alphabets in one math version is limited to 16, so we have to be carefull not to exceed this. The reuseMathAlphabets option reduces this number by two, with the side effect of italic shape with \mathbf and \mathsf commands:
\ifisomath@reuseMathAlphabets \PackageWarningNoLine{isomath}{% Re-using math alphabet `mathsf' for \protect \mathboldsans \MessageBreak and `mathbf' for \protect \mathbold } \fi
The italic bold math alphabet is named \mathbold like in fixmath and related packages. With the reuseMathAlphabets option, the roman bold math alphabet \mathbf is redefined and \mathbold made an alias (overwriting existing definitions):
\ifisomath@reuseMathAlphabets \DeclareMathAlphabet{\mathbf}{OML}{\isomath@rmdefault}{bx}{it} \def\mathbold{\mathbf} \else \DeclareMathAlphabet{\mathbold}{OML}{\isomath@rmdefault}{bx}{it} \fi
For italic sans-serif, we define a new alphabet named \mathsans (in analogy to \mathbold). As this typeface is not required by ISO 31, it is only defined if the OMLmathsans option is set:
\ifisomath@OMLmathsans \DeclareMathAlphabet{\mathsans}{OML}{\isomath@sfdefault}{m}{it} \fi
A sans serif slanted bold alphabet is needed for tensor symbols. With the reuseMathAlphabets option, the upright sans serif math alphabet \mathsf is redefined and \mathboldsans made an alias:
\ifisomath@reuseMathAlphabets \DeclareMathAlphabet{\mathsf}{OML}{\isomath@sfdefault}{bx}{it} \def\mathboldsans{\mathsf} \else \DeclareMathAlphabet{\mathboldsans}{OML}{\isomath@sfdefault}{bx}{it} \fi
Redefine standard alphabets in OML font encoding if the corresponding OMLmath* option is true:
\ifisomath@OMLmathrm \SetMathAlphabet{\mathrm}{normal}{OML}{\isomath@rmdefault}{m}{n} \fi \ifisomath@OMLmathbf \SetMathAlphabet{\mathbf}{normal}{OML}{\isomath@rmdefault}{b}{n} \fi \ifisomath@OMLmathsf \SetMathAlphabet{\mathsf}{normal}{OML}{\isomath@sfdefault}{m}{n} \fi \ifisomath@OMLmathtt \SetMathAlphabet{\mathtt}{normal}{OML}{\ttdefault}{m}{n} \fi
The following macros allow semantic markup of mathematical symbols. The argument is typeset as proposed by ISO 31 and Typefaces for Symbols in Scientific Manuscripts.
Symbols for vectors are typeset boldface italic:
\newcommand{\vectorsym}{\mathbold}
For easier writing or to make existing documents conform to the standard, you might want to re-define the standard \vec command after loading this package (cf. the Examples section of the documentation).
Attention: Some fonts (CM, Latin Modern, ...) have old-style figures in their math italic version. The Null vector must not be written \vec{0} in this case. Use e.g. \mathbf{0}, \boldsymbol{0} (with AMS math) or \bm{0} (with boldmath). The latter two variants provide also a failsafe alias for a bold vector.
Symbols for matrices are typeset boldface italic, i. e. in the same face as vectors.
\newcommand{\matrixsym}{\mathbold}
Some font packages provide matching text and math font but do not define a substitution in their *.fd files.
We define the substitutions needed for the math alphabet definitions in this package. Ideally, these should become part of the package's *.fd files.
For details about the font definition macros see the fntguide.
Mathpazo (Palatino) ppl <-> zplm
\DeclareFontFamily{OML}{ppl}{\skewchar\font127} \DeclareFontShape{OML}{ppl}{m}{it}{<-> ssub * zplm/m/it}{} \DeclareFontShape{OML}{ppl}{bx}{it}{<-> ssub * zplm/b/it}{}
Scale the fav (Arev), llcmss (LX Fonts), and iwona fonts by the value of the scaled option.
To get scaled versions of a font, you cannot use the ssub size function, but must use the empty function or s with the font file as argument [found by experiment, GM 2010-01-28].
Arev (see omlzavm.fd): fav <-> zavm
\DeclareFontFamily{OML}{fav}{\skewchar\font127} \DeclareFontShape{OML}{fav}{m}{it}{<-> s * [\isomath@scaled] zavmri7m}{} \DeclareFontShape{OML}{fav}{bx}{it}{<-> s * [\isomath@scaled] zavmbi7m}{}
LX Fonts (see lxfonts.sty): llcmss -> llcmm
\DeclareFontFamily{OML}{llcmss}{\skewchar\font'177} \DeclareFontShape{OML}{llcmss}{m}{it}{<-> s * [\isomath@scaled] lcmmi8}{} \DeclareFontShape{OML}{llcmss}{bx}{it}{<-> s * [\isomath@scaled] lcmmib8}{}
Ivona (see omliwona.fd):
\DeclareFontFamily{OML}{iwona}{} \DeclareFontShape{OML}{iwona}{m}{it}{<-> s * [\isomath@scaled] mi-iwonari}{} \DeclareFontShape{OML}{iwona}{bx}{it}{<-> s * [\isomath@scaled] mi-iwonabi}{}
No declarations below this point:
\endinput