summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/isomath/isomath.sty.txt
blob: 2c7405d7988e57b057528709763a2fb3182b901f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
isomath.sty: Math for scientists
********************************

:Copyright: © 2008, 2010 Günter Milde
:Licence:   This work may be distributed and/or modified under the
            conditions of the `LaTeX Project Public License`_, either
            version 1.3 of this license or (at your option) any later version.

:Identification:
 ::

  \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.

History
=======

.. class:: borderless

===  ============  ========================================================
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.
===  ============  ========================================================

.. contents::


Requirements
============

fixmath.sty
-----------
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}
  
  
kvoptions.sty
-------------
The kvoptions_ package in the oberdiek_ bundle facilitates the setup of
package options and provides a key=value interface (based on keyval_)::

  \RequirePackage{kvoptions}
  
  
Options
=======

rmdefault
---------
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}
  
sfdefault
---------
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}
  
scaled
------
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]}}
  
  
reuseMathAlphabets
------------------
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}
  
  
OMLmath*
--------
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.

Process Options
---------------
Process the options with ``kvoptions`` extensions::

  \ProcessKeyvalOptions*
  
  
Declarations
============


Math alphabets
--------------

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
  
mathbold
~~~~~~~~
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
  
mathsans
~~~~~~~~
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
  
mathboldsans
~~~~~~~~~~~~
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~

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
  
Command aliases
---------------

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`_.

\\vectorsym
~~~~~~~~~~~
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.

\\matrixsym
~~~~~~~~~~~
Symbols for matrices are typeset *boldface italic*, i. e. in the same face
as vectors. ::

  \newcommand{\matrixsym}{\mathbold}
  
  
\\tensorsym
~~~~~~~~~~~
Symbols for tensors are *sans-serif bold italic*::

  \newcommand{\tensorsym}{\mathboldsans}
  
     
Font mappings
-------------

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}{}
  
  
Scaling
~~~~~~~
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
  
.. Links
.. *****

.. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
.. _arev: http://dante.ctan.org/CTAN/help/Catalogue/entries/arev.html
.. _cmbright: http://dante.ctan.org/CTAN/help/Catalogue/entries/cmbright.html
.. _fixmath: http://dante.ctan.org/CTAN/help/Catalogue/entries/fixmath.html
.. _fntguide: http://dante.ctan.org/CTAN/macros/latex/doc/fntguide.pdf
.. _hvmath: http://dante.ctan.org/CTAN/help/Catalogue/entries/hvmath.html
.. _iwona: http://dante.ctan.org/CTAN/help/Catalogue/entries/iwona.html
.. _keyval: http://dante.ctan.org/CTAN/help/Catalogue/entries/keyval.html
.. _kvoptions: http://dante.ctan.org/CTAN/help/Catalogue/entries/kvoptions.html
.. _lxfonts: http://dante.ctan.org/CTAN/help/Catalogue/entries/lxfonts.html
.. _mathdesign: http://dante.ctan.org/CTAN/help/Catalogue/entries/mathdesign.html
.. _mathematical alphanumeric symbols:
    http://www.unicode.org/charts/PDF/U1D400.pdf
.. _oberdiek: http://dante.ctan.org/CTAN/help/Catalogue/entries/oberdiek.html
.. _`Typefaces for Symbols in Scientific Manuscripts`:
   http://physics.nist.gov/Document/typefaces.pdf