| 1 |
isomath |
| 2 |
******* |
| 3 |
Mathematical style for science and technology |
| 4 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 5 |
|
| 6 |
:Date: 2012-09-10 |
| 7 |
:Copyright: © 2008, 2012 Günter Milde |
| 8 |
:Licence: This work may be distributed and/or modified under the |
| 9 |
conditions of the `LaTeX Project Public License`_, either |
| 10 |
version 1.3 of this license or (at your option) any later version. |
| 11 |
|
| 12 |
:Abstract: The `isomath` package provides tools for a mathematical style |
| 13 |
that conforms to the International Standard ISO 80000-2 and is |
| 14 |
common in science and technology. It changes the default shape of |
| 15 |
capital Greek letters to italic, sets up bold italic and |
| 16 |
sans-serif bold italic math alphabets with Latin and Greek |
| 17 |
characters, and defines macros for markup of vector, matrix and |
| 18 |
tensor symbols. |
| 19 |
|
| 20 |
:Identification: |
| 21 |
:: |
| 22 |
|
| 23 |
\NeedsTeXFormat{LaTeX2e} |
| 24 |
\ProvidesPackage{isomath} |
| 25 |
[2012/09/04 v0.6.1 ISO math style] |
| 26 |
|
| 27 |
.. contents:: |
| 28 |
|
| 29 |
History |
| 30 |
======= |
| 31 |
|
| 32 |
.. class:: borderless |
| 33 |
|
| 34 |
===== =========== ======================================================== |
| 35 |
0.1 2008-09-25 first public version. |
| 36 |
0.2 2008-10-02 bugfix: a usage example was uncommented; |
| 37 |
\ updated documentation; |
| 38 |
\ define \mathsans only if OMLmathsans is true; |
| 39 |
\ option reuseMathalphabets -> reuseMathAlphabets. |
| 40 |
0.3 2009-06-19 documentation update; |
| 41 |
\ fix OMLmathrm and OMLmathsans definitions; |
| 42 |
\ switch license to LPP. |
| 43 |
0.4 2010-08-23 split user documentation from literate source; |
| 44 |
\ option ``scaled``; |
| 45 |
\ documentation update. |
| 46 |
0.5 2011-01-04 math alphabet names matching Unicode; |
| 47 |
\ documentation review and extension; |
| 48 |
\ bold alphabet variants in ``bold`` math version; |
| 49 |
\ upright numbers with ``\vectorsym``. |
| 50 |
0.6 2012-09-10 Scaling for Kepler Sans (``sfdefault=jkpss``); |
| 51 |
\ documentation update, new caption and abstract. |
| 52 |
===== =========== ======================================================== |
| 53 |
|
| 54 |
|
| 55 |
Requirements |
| 56 |
============ |
| 57 |
|
| 58 |
fixmath.sty |
| 59 |
----------- |
| 60 |
The package fixmath_ by Walter Schmidt defines Greek letters as symbols |
| 61 |
of type ``\mathalpha`` and takes them from the ``letters`` symbol font in |
| 62 |
``\mathnormal`` (as opposed to ``operators`` in ``fontmath.ltx``). |
| 63 |
|
| 64 |
`fixmath` also defines the ``\mathbold`` alphabet, setting it to ``cmm``. |
| 65 |
`isomath` overwrites this definition with a configurable value for |
| 66 |
the font family. :: |
| 67 |
|
| 68 |
\RequirePackage{fixmath} |
| 69 |
|
| 70 |
|
| 71 |
kvoptions.sty |
| 72 |
------------- |
| 73 |
The kvoptions_ package in the oberdiek_ bundle facilitates the setup of |
| 74 |
package options and provides a key=value interface (based on keyval_):: |
| 75 |
|
| 76 |
\RequirePackage{kvoptions} |
| 77 |
|
| 78 |
|
| 79 |
Options |
| 80 |
======= |
| 81 |
|
| 82 |
rmdefault |
| 83 |
--------- |
| 84 |
Family for roman math fonts. Must be available in OML |
| 85 |
encoding. The default is to use the corresponding text font family |
| 86 |
(``\rmdefault``). :: |
| 87 |
|
| 88 |
\DeclareStringOption[\rmdefault]{rmdefault} |
| 89 |
|
| 90 |
sfdefault |
| 91 |
--------- |
| 92 |
Family for sans-serif math fonts. The default selects `CM Bright`, as |
| 93 |
most sans serif fonts are not available in OML encoding:: |
| 94 |
|
| 95 |
\DeclareStringOption[cmbr]{sfdefault} |
| 96 |
|
| 97 |
scaled |
| 98 |
------ |
| 99 |
The sans-serif fonts, ``fav`` (Arev), ``llcmss`` (LX Fonts), |
| 100 |
``jkpss`` (Kepler Serif) and ``iwona`` can be scaled |
| 101 |
with the ``scaled`` option. :: |
| 102 |
|
| 103 |
\DeclareStringOption[1.0]{scaled} |
| 104 |
|
| 105 |
reuseMathAlphabets |
| 106 |
------------------ |
| 107 |
The definition of new `math alphabets`_ can lead to a “too many math |
| 108 |
alphabets used in version normal” error. |
| 109 |
|
| 110 |
As a workaround, this option tells `isomath` to re-use the existing |
| 111 |
``\mathbf`` and ``\mathsf`` alphabets for *italic* bold and sans-serif |
| 112 |
bold. :: |
| 113 |
|
| 114 |
\DeclareBoolOption{reuseMathAlphabets} |
| 115 |
|
| 116 |
OMLmath* |
| 117 |
-------- |
| 118 |
The following options cause `isomath` to (re)define the corresponding |
| 119 |
`math alphabets`_ in OML encoding:: |
| 120 |
|
| 121 |
\DeclareBoolOption{OMLmathrm} |
| 122 |
\DeclareBoolOption{OMLmathbf} |
| 123 |
\DeclareBoolOption{OMLmathsf} |
| 124 |
\DeclareBoolOption{OMLmathsfit} |
| 125 |
\DeclareBoolOption{OMLmathtt} |
| 126 |
% backwards compatibility option alias |
| 127 |
\DeclareVoidOption{OMLmathsans}{\isomath@OMLmathsfittrue} |
| 128 |
|
| 129 |
Setting these options enables access to small Greek letters in different |
| 130 |
shapes with e.g. ``\mathrm{\pi}`` but only *if an OML encoded font is |
| 131 |
available*. Currently, only the mathdesign_ fonts support roman in OML |
| 132 |
encoding. |
| 133 |
|
| 134 |
With some packages, these options can result in a “too many math alphabets |
| 135 |
used in version normal” error. |
| 136 |
|
| 137 |
-------------------------------------------------------- |
| 138 |
|
| 139 |
Process the options with ``kvoptions`` extensions:: |
| 140 |
|
| 141 |
\ProcessKeyvalOptions* |
| 142 |
|
| 143 |
|
| 144 |
Declarations |
| 145 |
============ |
| 146 |
|
| 147 |
Math alphabets |
| 148 |
-------------- |
| 149 |
|
| 150 |
In math, LaTeX uses “absolute” fontnames instead of a selection by |
| 151 |
family, shape, and weight because typefaces have a semantic meaning |
| 152 |
[fntguide]_. |
| 153 |
|
| 154 |
`isomath` defines a math alphabet for every required font variant and |
| 155 |
optionally re-defines the standard math alphabets in `OML` font encoding. |
| 156 |
|
| 157 |
Unfortunately, the number of math alphabets in one math version is |
| 158 |
limited to 16, so we have to be careful not to exceed this. The |
| 159 |
``reuseMathAlphabets`` option reduces the number of math alphabet |
| 160 |
definitions by two, with the side effect of italic shape with |
| 161 |
``\mathbf`` and ``\mathsf`` commands:: |
| 162 |
|
| 163 |
\ifisomath@reuseMathAlphabets |
| 164 |
\PackageWarningNoLine{isomath}{% |
| 165 |
Re-using math alphabet `mathsf' for \protect \mathsfbfit |
| 166 |
\MessageBreak and `mathbf' for \protect \mathbfit |
| 167 |
} |
| 168 |
\fi |
| 169 |
|
| 170 |
mathbfit |
| 171 |
~~~~~~~~ |
| 172 |
The *bold italic* math alphabet is named ``\mathbfit`` like in |
| 173 |
unicode-math_ (with an alias ``\mathbold`` like in fixmath_ and |
| 174 |
related packages). With the reuseMathAlphabets_ option, the roman bold |
| 175 |
math alphabet ``\mathbf`` is redefined and ``\mathbfit`` made an |
| 176 |
alias. The series selector ``bx`` (bold extended) is used, because it |
| 177 |
is better supported than ``b``. (Is there any LaTeX math font |
| 178 |
distinguishing between ``b`` and ``bx``?) :: |
| 179 |
|
| 180 |
\ifisomath@reuseMathAlphabets |
| 181 |
\DeclareMathAlphabet{\mathbf}{OML}{\isomath@rmdefault}{bx}{it} |
| 182 |
\def\mathbfit{\mathbf} |
| 183 |
\else |
| 184 |
\DeclareMathAlphabet{\mathbfit}{OML}{\isomath@rmdefault}{bx}{it} |
| 185 |
\fi |
| 186 |
|
| 187 |
alias (overwriting the definition from fixmath):: |
| 188 |
|
| 189 |
\renewcommand*{\mathbold}{\mathbfit} |
| 190 |
|
| 191 |
mathsfit |
| 192 |
~~~~~~~~ |
| 193 |
For *sans-serif italic*, we define a new alphabet ``\mathsfit`` (with |
| 194 |
the alias ``\mathsans`` in analogy to ``\mathbold``). As this typeface |
| 195 |
is not required by ISO 80000-2 and TeX limits the number of math alphabets |
| 196 |
to 16 per math version, it is only defined if the ``OMLmathsfit`` or |
| 197 |
``OMLmathsans`` option is set:: |
| 198 |
|
| 199 |
\ifisomath@OMLmathsfit |
| 200 |
\DeclareMathAlphabet{\mathsfit}{OML}{\isomath@sfdefault}{m}{it} |
| 201 |
\SetMathAlphabet{\mathsfit}{bold}{OML}{\isomath@sfdefault}{bx}{it} |
| 202 |
\def\mathsans{\mathsfit} |
| 203 |
\fi |
| 204 |
|
| 205 |
mathsfbfit |
| 206 |
~~~~~~~~~~~~ |
| 207 |
The *sans serif bold italic* alphabet is used for tensor symbols. |
| 208 |
Following the Unicode naming scheme it is called |
| 209 |
``\mathsfbfit``(with the backwards compatibility alias ``\mathboldsans``). |
| 210 |
With the reuseMathAlphabets_ option, the upright sans serif math |
| 211 |
alphabet ``\mathsf`` is redefined and ``\mathsfbfit`` made an |
| 212 |
alias to it:: |
| 213 |
|
| 214 |
\ifisomath@reuseMathAlphabets |
| 215 |
\DeclareMathAlphabet{\mathsf}{OML}{\isomath@sfdefault}{bx}{it} |
| 216 |
\def\mathsfbfit{\mathsf} |
| 217 |
\else |
| 218 |
\DeclareMathAlphabet{\mathsfbfit}{OML}{\isomath@sfdefault}{bx}{it} |
| 219 |
\fi |
| 220 |
\def\mathboldsans{\mathsfbfit} |
| 221 |
|
| 222 |
Redefine standard alphabets |
| 223 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 224 |
|
| 225 |
Redefine standard alphabets in `OML` font encoding |
| 226 |
if the corresponding `OMLmath*`_ option is true:: |
| 227 |
|
| 228 |
\ifisomath@OMLmathrm |
| 229 |
\SetMathAlphabet{\mathrm}{normal}{OML}{\isomath@rmdefault}{m}{n} |
| 230 |
\SetMathAlphabet{\mathrm}{bold}{OML}{\isomath@rmdefault}{bx}{n} |
| 231 |
\fi |
| 232 |
\ifisomath@OMLmathbf |
| 233 |
\SetMathAlphabet{\mathbf}{normal}{OML}{\isomath@rmdefault}{bx}{n} |
| 234 |
\fi |
| 235 |
\ifisomath@OMLmathsf |
| 236 |
\SetMathAlphabet{\mathsf}{normal}{OML}{\isomath@sfdefault}{m}{n} |
| 237 |
\SetMathAlphabet{\mathsf}{bold}{OML}{\isomath@sfdefault}{bx}{n} |
| 238 |
\fi |
| 239 |
\ifisomath@OMLmathtt |
| 240 |
\SetMathAlphabet{\mathtt}{normal}{OML}{\ttdefault}{m}{n} |
| 241 |
\SetMathAlphabet{\mathtt}{bold}{OML}{\ttdefault}{bx}{n} |
| 242 |
\fi |
| 243 |
|
| 244 |
Command aliases |
| 245 |
--------------- |
| 246 |
|
| 247 |
The following macros allow semantic markup of mathematical symbols. |
| 248 |
The argument is typeset as proposed by ISO 80000-2 and |
| 249 |
`Typefaces for Symbols in Scientific Manuscripts`_. |
| 250 |
|
| 251 |
\\vectorsym |
| 252 |
~~~~~~~~~~~ |
| 253 |
Alphabetic vectors symbols are typeset *boldface italic* while numeric |
| 254 |
ones (e.g. zero vector) are typeset *boldface upright*. The number |
| 255 |
test is a simplified version from the LaTeX FAQ "`Is the argument a number?`__" |
| 256 |
It fails if a number is followed by a non-number, e.g. ``\vectorsym{1a}``, |
| 257 |
but this is no valid vector symbol and would look strange with the |
| 258 |
``\vec`` accent, too. :: |
| 259 |
|
| 260 |
\providecommand*{\vectorsym}[1]{% |
| 261 |
\ifnum9<1#1% |
| 262 |
\mathbf{#1}% |
| 263 |
\else% |
| 264 |
\mathbfit{#1}% |
| 265 |
\fi} |
| 266 |
|
| 267 |
For easier writing or to make existing documents conform to the standard, |
| 268 |
you might want to re-define the standard ``\vec`` command after loading this |
| 269 |
package. |
| 270 |
|
| 271 |
__ http://www.tex.ac.uk/cgi-bin/texfaq2html?label=isitanum |
| 272 |
|
| 273 |
\\matrixsym |
| 274 |
~~~~~~~~~~~ |
| 275 |
Symbols for matrices are typeset *boldface italic*, i. e. in the same face |
| 276 |
as vectors. :: |
| 277 |
|
| 278 |
\providecommand*{\matrixsym}{\vectorsym} |
| 279 |
|
| 280 |
\\tensorsym |
| 281 |
~~~~~~~~~~~ |
| 282 |
Symbols for tensors are *sans-serif bold italic*:: |
| 283 |
|
| 284 |
\providecommand*{\tensorsym}{\mathsfbfit} |
| 285 |
|
| 286 |
|
| 287 |
Font setup fixes |
| 288 |
---------------- |
| 289 |
|
| 290 |
Substitutions needed for the math alphabet definitions and setup for |
| 291 |
scaled fonts. For details about the font definition macros see |
| 292 |
[fntguide]_. |
| 293 |
|
| 294 |
Unknown makro in font definition file |
| 295 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 296 |
The `Kepler Sans` font definition file ``omljkpss.fd`` contains a boolean |
| 297 |
that is defined in ``kpfonts.sty``. This leads to errors if the fonts are |
| 298 |
used from another package. Provide a dummy definition:: |
| 299 |
|
| 300 |
\newif\ifkp@upRm |
| 301 |
|
| 302 |
|
| 303 |
Common family name for text and math fonts |
| 304 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 305 |
Some font packages provide matching text and math font but do not |
| 306 |
define a substitution in their ``*.fd`` files. Ideally, the following |
| 307 |
mappings should be moved there. |
| 308 |
|
| 309 |
Mathpazo (Palatino) ppl ↔ zplm :: |
| 310 |
|
| 311 |
\DeclareFontFamily{OML}{ppl}{\skewchar\font127} |
| 312 |
\DeclareFontShape{OML}{ppl}{m}{it}{<-> ssub * zplm/m/it}{} |
| 313 |
\DeclareFontShape{OML}{ppl}{bx}{it}{<-> ssub * zplm/b/it}{} |
| 314 |
|
| 315 |
|
| 316 |
Scaling |
| 317 |
~~~~~~~ |
| 318 |
Scale the ``fav`` (Arev), ``iwona``, ``jkpss`` (Kepler Sans) and |
| 319 |
``llcmss`` (LX Fonts) sans serif fonts by the value of the scaled_ option. |
| 320 |
|
| 321 |
To get scaled versions of a font, you cannot use the ``ssub`` |
| 322 |
`size function`, but must use the empty function or ``s`` with the font |
| 323 |
file as argument [found by experiment, GM 2010-01-28]. |
| 324 |
|
| 325 |
Arev (see ``omlzavm.fd``) fav ↔ zavm:: |
| 326 |
|
| 327 |
\DeclareFontFamily{OML}{fav}{\skewchar\font127} |
| 328 |
\DeclareFontShape{OML}{fav}{m}{it}{<-> s * [\isomath@scaled] zavmri7m}{} |
| 329 |
\DeclareFontShape{OML}{fav}{bx}{it}{<-> s * [\isomath@scaled] zavmbi7m}{} |
| 330 |
|
| 331 |
Iwona (see ``omliwona.fd``) iwona ↔ mi-iwona:: |
| 332 |
|
| 333 |
\DeclareFontFamily{OML}{iwona}{} |
| 334 |
\DeclareFontShape{OML}{iwona}{m}{it}{<-> s * [\isomath@scaled] mi-iwonari}{} |
| 335 |
\DeclareFontShape{OML}{iwona}{bx}{it}{<-> s * [\isomath@scaled] mi-iwonabi}{} |
| 336 |
|
| 337 |
Kepler Serif (see ``omljkpss.fd``):: |
| 338 |
|
| 339 |
\DeclareFontFamily{OML}{jkpss}{\skewchar\font127 } |
| 340 |
\DeclareFontShape{OML}{jkpss}{m}{it}{<-> s * [\isomath@scaled] jkpssmi}{} |
| 341 |
\DeclareFontShape{OML}{jkpss}{bx}{it}{<-> s * [\isomath@scaled] jkpssbmi}{} |
| 342 |
|
| 343 |
LX Fonts (see ``lxfonts.sty``) llcmss ↔ llcmm:: |
| 344 |
|
| 345 |
\DeclareFontFamily{OML}{llcmss}{\skewchar\font'177} |
| 346 |
\DeclareFontShape{OML}{llcmss}{m}{it}{<-> s * [\isomath@scaled] lcmmi8}{} |
| 347 |
\DeclareFontShape{OML}{llcmss}{bx}{it}{<-> s * [\isomath@scaled] lcmmib8}{} |
| 348 |
|
| 349 |
|
| 350 |
References |
| 351 |
========== |
| 352 |
|
| 353 |
.. [fntguide] `LaTeX 2e font selection`: |
| 354 |
http://mirror.ctan.org/macros/latex/doc/fntguide.pdf. |
| 355 |
|
| 356 |
.. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt |
| 357 |
.. _arev: http://mirror.ctan.org/help/Catalogue/entries/arev.html |
| 358 |
.. _cmbright: http://mirror.ctan.org/help/Catalogue/entries/cmbright.html |
| 359 |
.. _fixmath: http://mirror.ctan.org/help/Catalogue/entries/fixmath.html |
| 360 |
.. _hvmath: http://mirror.ctan.org/help/Catalogue/entries/hvmath.html |
| 361 |
.. _iwona: http://mirror.ctan.org/help/Catalogue/entries/iwona.html |
| 362 |
.. _keyval: http://mirror.ctan.org/help/Catalogue/entries/keyval.html |
| 363 |
.. _kvoptions: http://mirror.ctan.org/help/Catalogue/entries/kvoptions.html |
| 364 |
.. _lxfonts: http://mirror.ctan.org/help/Catalogue/entries/lxfonts.html |
| 365 |
.. _mathdesign: http://mirror.ctan.org/help/Catalogue/entries/mathdesign.html |
| 366 |
.. _mathematical alphanumeric symbols: |
| 367 |
http://www.unicode.org/charts/PDF/U1D400.pdf |
| 368 |
.. _oberdiek: http://mirror.ctan.org/help/Catalogue/entries/oberdiek.html |
| 369 |
.. _`Typefaces for Symbols in Scientific Manuscripts`: |
| 370 |
http://physics.nist.gov/cuu/pdf/typefaces.pdf |
| 371 |
.. _unicode-math: |
| 372 |
http://mirror.ctan.org/help/Catalogue/entries/unicode-math.html |