Chris asked me in a recent email why unimath
contains the following code:
\um@FOR @tempcnta = [0:25] {%
\um@mathcode@offset{#1}{65}{119860}%
\um@mathcode@offset{#1}{97}{119886}%
}%
% \end{macrocode}
% Filling a hole for `h', which maps to \unichar{210E}{PLANCK CONSTANT}
% instead of the expected \unichar{1D455}{MATHEMATICAL ITALIC SMALL H}
(which is not assigned):
% \begin{macrocode}
\DeclareUnicodeMathCode{104}{\mathalpha}{#1}{8462}%
(The macro um@mathcode@offset{#1}{65}{119860}
defines in the symbol font #1 the math chars
A (character 65) -> character 119860
B (character 66) -> character 119861
...
so you can type in ascii but receive maths italics.
Anyone think of a better looping paradigm for this
task than the matlab-inspired for-loop I invented?)
However, "h" doesn't follow this pattern, hence the
explicit definition in the last line of the snippet
above. Why? The reason for this is encapsulated in a
quote from the unicode book, v.4, p. 355:
"The plain letters have been unified with the existing characters in
the Basic Latin and Greek
blocks. There are 25 double-struck, italic, Fraktur, and script
characters that already exist in
the Letterlike Symbols block (U+2100..U+214F). These are explicitly
unified with the char-
acters in this block and corresponding holes have been left in the
mathematical alphabets."
So the base plane in unicode already defines some
letters such as an italic h for planck constant, and when
they got around to providing for the entire alphabet,
they left 25 letters out of where they should be, because
earlier characters in unicode already contained those
shapes.
This strikes me as completely backwards, and it should
be the BMP originals (such as "planck constant") that
are deprecated. It certainly makes things annoying for
people like me who want to map characters from ascii
to unicode!
Anyway, the full list (I think!) of troublesome characters
is appended to this email. Be especially wary of U+2118
"script capital p" and U+2113 "script small l"; they DON'T
stand in for their look-alikes; quoth the unicode book, p. 354:
"Despite its name, U+2118 'script capital p' is neither script nor
capital -- it is uniquely the
Weierstrass elliptic function symbol derived from a calligraphic
*lowercase* p."
Whereas "planck constant" is not just that, but also just
an italic h. Right... Give the generic symbol the specific name
and the specific symbol the generic name. Good one, guys.
It goes on to say that "script small l" is actually the maths
symbol "ell" and not the same as U+1D4C1 "mathematical script small l".
Although in Cambria Math, the two glyphs are identical. Argh!
***
Well, Chris, you asked for it :)
This serves as my first complaint against unicode maths.
I hope it's shed some light on the matter. Or not.
I'm off to do the dishes and cook dinner. Ciao,
Will
***
List of troublesome symbols.
***
The first of each pair is the character you'd expect to exist.
The second is the actual unicode character that must be used.
Sorry, code points are too hard for me right now.
mathematical_italic_small_h
planck_constant
mathematical_script_small_e
script_small_e
script_small_g
mathematical_script_small_g
mathematical_script_small_o
script_small_o
mathematical_script_capital_b
script_capital_b
mathematical_script_capital_e
script_capital_e
mathematical_script_capital_f
script_capital_f
mathematical_script_capital_h
script_capital_h
mathematical_script_capital_i
script_capital_i
mathematical_script_capital_l
script_capital_l
mathematical_script_capital_m
script_capital_m
mathematical_script_capital_r
script_capital_r
mathematical_double_struck_capital_c
double_struck_capital_c
mathematical_double_struck_capital_h
double_struck_capital_h
mathematical_double_struck_capital_n
double_struck_capital_n
mathematical_double_struck_capital_p
double_struck_capital_p
mathematical_double_struck_capital_q
double_struck_capital_q
mathematical_double_struck_capital_r
double_struck_capital_r
mathematical_double_struck_capital_z
double_struck_capital_z
mathematical_fraktur_capital_c
black_letter_capital_c
mathematical_fraktur_capital_h
mathematical_fraktur_capital_i
black_letter_capital_h
black_letter_capital_i
mathematical_fraktur_capital_r
black_letter_capital_r
mathematical_fraktur_capital_z
black_letter_capital_z
> This serves as my first complaint against unicode maths.
In hindsight, I realise I've been particularly unkind to unicode on
this matter, and I hope no-one reading has the wrong idea.
"Infuriations" was much too strong a word to use -- let's just say I
was surprised by the standard here and thought that a better way
forward would have been to recommend to font designers to keep the
pairs of glyphs, e.g., mathematical_italic_small_h & planck_constant,
identical, and to deprecate the originals in the lower plane...much
in the same way that the "Angstrom" character isn't recommended
except to support backwards compatibility with older encodings.
Will