-
Notifications
You must be signed in to change notification settings - Fork 29
/
um-doc-nfsssummary.tex
87 lines (69 loc) · 3.44 KB
/
um-doc-nfsssummary.tex
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
%%^^A%% um-doc-nfsssummary.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
\section{Documenting maths support in the NFSS}
In the following, \meta{NFSS decl.} stands for something like |{T1}{lmr}{m}{n}|.
\begin{description}
\item[Maths symbol fonts]
Fonts for symbols: $\propto$, $\leq$, $\rightarrow$
\cmd\DeclareSymbolFont\marg{name}\meta{NFSS decl.}\\
Declares a named maths font such as |operators| from which symbols are defined with \cmd\DeclareMathSymbol.
\item[Maths alphabet fonts]
Fonts for $\symit{ABC}$\,–\,$\symit{xyz}$,
$\symfrak{ABC}$\,–\,$\symscr{XYZ}$, etc.
\cmd\DeclareMathAlphabet\marg{cmd}\meta{NFSS decl.}
For commands such as \cmd\mathbf, accessed
through maths mode that are unaffected by the current text font, and which are used for
alphabetic symbols in the \ascii\ range.
\cmd\DeclareSymbolFontAlphabet\marg{cmd}\marg{name}
Alternative (and optimisation) for \cmd\DeclareMathAlphabet\ if a single font is being used
for both alphabetic characters (as above) and symbols.
\item[Maths `versions'] Different maths weights can be defined with the following, switched
in text with the \cmd\mathversion\marg{maths version} command.
\cmd\SetSymbolFont\marg{name}\marg{maths version}\meta{NFSS decl.}\\
\cmd\SetMathAlphabet\marg{cmd}\marg{maths version}\meta{NFSS decl.}
\item[Maths symbols] Symbol definitions in maths for both characters (=) and macros (\cmd\eqdef):
\cmd\DeclareMathSymbol\marg{symbol}\marg{type}\marg{named font}\marg{slot}
This is the macro that actually defines which font each symbol comes from and how they behave.
\end{description}
Delimiters and radicals use wrappers around \TeX's \cmd\delimiter/\cmd\radical\ primitives,
which are re-designed in \XeTeX. The syntax used in \LaTeX's NFSS is therefore not so relevant here.
\begin{description}
\item[Delimiters] A special class of maths symbol which enlarge themselves in certain contexts.
\cmd\DeclareMathDelimiter\marg{symbol}\marg{type}\marg{sym.\ font}\marg{slot}\marg{sym.\ font}\marg{slot}
\item[Radicals] Similar to delimiters (\cmd\DeclareMathRadical\ takes the same syntax) but
behave `weirdly'.
\end{description}
In those cases, glyph slots in \emph{two} symbol fonts are required; one for the small (`regular') case,
the other for situations when the glyph is larger. This is not the case in \XeTeX.
Accents are not included yet.
\paragraph{Summary}
For symbols, something like:
\begin{Verbatim}
\def\DeclareMathSymbol#1#2#3#4{
\global\mathchardef#1"\mathchar@type#2
\expandafter\hexnumber@\csname sym#2\endcsname
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}
\end{Verbatim}
For characters, something like:
\begin{Verbatim}
\def\DeclareMathSymbol#1#2#3#4{
\global\mathcode`#1"\mathchar@type#2
\expandafter\hexnumber@\csname sym#2\endcsname
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}
\end{Verbatim}
\endinput
% /©
%
% ------------------------------------------------
% The UNICODE-MATH package <wspr.io/unicode-math>
% ------------------------------------------------
% This package is free software and may be redistributed and/or modified under
% the conditions of the LaTeX Project Public License, version 1.3c or higher
% (your choice): <http://www.latex-project.org/lppl/>.
% ------------------------------------------------
% Copyright 2006-2019 Will Robertson, LPPL "maintainer"
% Copyright 2010-2017 Philipp Stephani
% Copyright 2011-2017 Joseph Wright
% Copyright 2012-2015 Khaled Hosny
% ------------------------------------------------
%
% ©/