| 1 |
%%^^A%% um-doc-nfsssummary.tex -- part of UNICODE-MATH <wspr.io/unicode-math> |
| 2 |
|
| 3 |
\section{Documenting maths support in the NFSS} |
| 4 |
|
| 5 |
In the following, \meta{NFSS decl.} stands for something like |{T1}{lmr}{m}{n}|. |
| 6 |
|
| 7 |
\begin{description} |
| 8 |
\item[Maths symbol fonts] |
| 9 |
Fonts for symbols: $\propto$, $\leq$, $\rightarrow$ |
| 10 |
|
| 11 |
\cmd\DeclareSymbolFont\marg{name}\meta{NFSS decl.}\\ |
| 12 |
Declares a named maths font such as |operators| from which symbols are defined with \cmd\DeclareMathSymbol. |
| 13 |
|
| 14 |
\item[Maths alphabet fonts] |
| 15 |
Fonts for $\symit{ABC}$\,–\,$\symit{xyz}$, |
| 16 |
$\symfrak{ABC}$\,–\,$\symscr{XYZ}$, etc. |
| 17 |
|
| 18 |
\cmd\DeclareMathAlphabet\marg{cmd}\meta{NFSS decl.} |
| 19 |
|
| 20 |
For commands such as \cmd\mathbf, accessed |
| 21 |
through maths mode that are unaffected by the current text font, and which are used for |
| 22 |
alphabetic symbols in the \ascii\ range. |
| 23 |
|
| 24 |
\cmd\DeclareSymbolFontAlphabet\marg{cmd}\marg{name} |
| 25 |
|
| 26 |
Alternative (and optimisation) for \cmd\DeclareMathAlphabet\ if a single font is being used |
| 27 |
for both alphabetic characters (as above) and symbols. |
| 28 |
|
| 29 |
\item[Maths `versions'] Different maths weights can be defined with the following, switched |
| 30 |
in text with the \cmd\mathversion\marg{maths version} command. |
| 31 |
|
| 32 |
\cmd\SetSymbolFont\marg{name}\marg{maths version}\meta{NFSS decl.}\\ |
| 33 |
\cmd\SetMathAlphabet\marg{cmd}\marg{maths version}\meta{NFSS decl.} |
| 34 |
|
| 35 |
\item[Maths symbols] Symbol definitions in maths for both characters (=) and macros (\cmd\eqdef): |
| 36 |
\cmd\DeclareMathSymbol\marg{symbol}\marg{type}\marg{named font}\marg{slot} |
| 37 |
This is the macro that actually defines which font each symbol comes from and how they behave. |
| 38 |
\end{description} |
| 39 |
Delimiters and radicals use wrappers around \TeX's \cmd\delimiter/\cmd\radical\ primitives, |
| 40 |
which are re-designed in \XeTeX. The syntax used in \LaTeX's NFSS is therefore not so relevant here. |
| 41 |
\begin{description} |
| 42 |
\item[Delimiters] A special class of maths symbol which enlarge themselves in certain contexts. |
| 43 |
|
| 44 |
\cmd\DeclareMathDelimiter\marg{symbol}\marg{type}\marg{sym.\ font}\marg{slot}\marg{sym.\ font}\marg{slot} |
| 45 |
|
| 46 |
\item[Radicals] Similar to delimiters (\cmd\DeclareMathRadical\ takes the same syntax) but |
| 47 |
behave `weirdly'. |
| 48 |
\end{description} |
| 49 |
In those cases, glyph slots in \emph{two} symbol fonts are required; one for the small (`regular') case, |
| 50 |
the other for situations when the glyph is larger. This is not the case in \XeTeX. |
| 51 |
|
| 52 |
Accents are not included yet. |
| 53 |
|
| 54 |
\paragraph{Summary} |
| 55 |
|
| 56 |
For symbols, something like: |
| 57 |
\begin{Verbatim} |
| 58 |
\def\DeclareMathSymbol#1#2#3#4{ |
| 59 |
\global\mathchardef#1"\mathchar@type#2 |
| 60 |
\expandafter\hexnumber@\csname sym#2\endcsname |
| 61 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}} |
| 62 |
\end{Verbatim} |
| 63 |
For characters, something like: |
| 64 |
\begin{Verbatim} |
| 65 |
\def\DeclareMathSymbol#1#2#3#4{ |
| 66 |
\global\mathcode`#1"\mathchar@type#2 |
| 67 |
\expandafter\hexnumber@\csname sym#2\endcsname |
| 68 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}} |
| 69 |
\end{Verbatim} |
| 70 |
\endinput |
| 71 |
|
| 72 |
% /© |
| 73 |
% |
| 74 |
% ------------------------------------------------ |
| 75 |
% The UNICODE-MATH package <wspr.io/unicode-math> |
| 76 |
% ------------------------------------------------ |
| 77 |
% This package is free software and may be redistributed and/or modified under |
| 78 |
% the conditions of the LaTeX Project Public License, version 1.3c or higher |
| 79 |
% (your choice): <http://www.latex-project.org/lppl/>. |
| 80 |
% ------------------------------------------------ |
| 81 |
% Copyright 2006-2019 Will Robertson, LPPL "maintainer" |
| 82 |
% Copyright 2010-2017 Philipp Stephani |
| 83 |
% Copyright 2011-2017 Joseph Wright |
| 84 |
% Copyright 2012-2015 Khaled Hosny |
| 85 |
% ------------------------------------------------ |
| 86 |
% |
| 87 |
% ©/ |