diff options
author | Karl Berry <karl@freefriends.org> | 2017-11-18 21:45:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-11-18 21:45:46 +0000 |
commit | 9746eec6f52784c17ea0fdd0c1d47e8deb9ca0f8 (patch) | |
tree | 093bb019d314b4b6e27f3f9dca5f69308ac68fb8 /Master/texmf-dist/source/latex/unicode-math | |
parent | ff1a4fd0b6a85c7280ae498ad531d5397bedea87 (diff) |
unicode-math (18nov17)
git-svn-id: svn://tug.org/texlive/trunk@45845 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/unicode-math')
33 files changed, 3926 insertions, 1148 deletions
diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-alphabets.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx index c309019dbc5..348a5a22eb1 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-alphabets.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx @@ -1,12 +1,14 @@ -% \section{\DTXCURR --- Setting up alphabets} +%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{Setting up alphabets} % \label{sec:setupalphabets} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % -% \subsubsection{Upright: up} +% \subsection{Upright: up} % % \begin{macrocode} \@@_new_alphabet_config:nnn {up} {num} @@ -97,7 +99,7 @@ } % \end{macrocode} % -% \subsubsection{Italic: it} +% \subsection{Italic: it} % % \begin{macrocode} \@@_new_alphabet_config:nnn {it} {Latin} @@ -181,7 +183,7 @@ } % \end{macrocode} % -% \subsubsection{Blackboard or double-struck: bb and bbit} +% \subsection{Blackboard or double-struck: bb and bbit} % % \begin{macrocode} \@@_new_alphabet_config:nnn {bb} {latin} @@ -225,7 +227,7 @@ } % \end{macrocode} % -% \subsubsection{Script and caligraphic: scr and cal} +% \subsection{Script and caligraphic: scr and cal} % % \begin{macrocode} \@@_new_alphabet_config:nnn {scr} {Latin} @@ -266,7 +268,7 @@ } % \end{macrocode} % -% \subsubsection{Fractur or fraktur or blackletter: frak} +% \subsection{Fractur or fraktur or blackletter: frak} % % \begin{macrocode} \@@_new_alphabet_config:nnn {frak} {Latin} @@ -284,7 +286,7 @@ } % \end{macrocode} % -% \subsubsection{Sans serif upright: sfup} +% \subsection{Sans serif upright: sfup} % \begin{macrocode} \@@_new_alphabet_config:nnn {sfup} {num} { @@ -325,7 +327,7 @@ } % \end{macrocode} % -% \subsubsection{Sans serif italic: sfit} +% \subsection{Sans serif italic: sfit} % % \begin{macrocode} \@@_new_alphabet_config:nnn {sfit} {Latin} @@ -362,7 +364,7 @@ } % \end{macrocode} % -% \subsubsection{Typewriter or monospaced: tt} +% \subsection{Typewriter or monospaced: tt} % \begin{macrocode} \@@_new_alphabet_config:nnn {tt} {num} { @@ -379,7 +381,7 @@ % \end{macrocode} % % -% \subsubsection{Bold Italic: bfit} +% \subsection{Bold Italic: bfit} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfit} {Latin} { @@ -497,7 +499,7 @@ % \end{macrocode} % % -% \subsubsection{Bold Upright: bfup} +% \subsection{Bold Upright: bfup} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfup} {num} { @@ -631,7 +633,7 @@ } % \end{macrocode} % -% \subsubsection{Bold fractur or fraktur or blackletter: bffrak} +% \subsection{Bold fractur or fraktur or blackletter: bffrak} % \begin{macrocode} \@@_new_alphabet_config:nnn {bffrak} {Latin} { @@ -644,7 +646,7 @@ } % \end{macrocode} % -% \subsubsection{Bold script or calligraphic: bfscr} +% \subsection{Bold script or calligraphic: bfscr} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfscr} {Latin} { @@ -660,7 +662,7 @@ } % \end{macrocode} % -% \subsubsection{Bold upright sans serif: bfsfup} +% \subsection{Bold upright sans serif: bfsfup} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfsfup} {num} { @@ -782,7 +784,7 @@ % \end{macrocode} % % -% \subsubsection{Bold italic sans serif: bfsfit} +% \subsection{Bold italic sans serif: bfsfit} % \begin{macrocode} \@@_new_alphabet_config:nnn {bfsfit} {Latin} { @@ -900,5 +902,24 @@ % \end{macrocode} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx new file mode 100644 index 00000000000..434625df65b --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx @@ -0,0 +1,42 @@ +%%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{Programmers' interface} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% +% \begin{macro}{\unimath_get_mathstyle:} +% This command expands to the currently math style. +% \begin{macrocode} +\cs_new:Nn \unimath_get_mathstyle: + { + \tl_use:N \l_@@_mathstyle_tl + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx new file mode 100644 index 00000000000..0fbdc55c1ee --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx @@ -0,0 +1,73 @@ +%%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{The \texttt{unicode-math.sty} loading file} +% +% The \texttt{unicode-math.sty} file is a stub which loads necessary packages +% and then bifurcates into a XeTeX- or LuaTeX-specific version of the package. +% +% \begin{macrocode} +%<*base> +% \end{macrocode} +% Bail early if necessary. +% \begin{macrocode} +\ifdefined\XeTeXversion + \ifdim\number\XeTeXversion\XeTeXrevision in<0.9998in% + \PackageError{unicode-math}{% + Cannot run with this version of XeTeX!\MessageBreak + You need XeTeX 0.9998 or newer.% + }\@ehd + \fi +\else\ifdefined\luatexversion + \ifnum\luatexversion<64% + \PackageError{unicode-math}{% + Cannot run with this version of LuaTeX!\MessageBreak + You need LuaTeX 0.64 or newer.% + }\@ehd + \fi +\else + \PackageError{unicode-math}{% + Cannot be run with pdfLaTeX!\MessageBreak + Use XeLaTeX or LuaLaTeX instead.% + }\@ehd +\fi\fi +% \end{macrocode} +% +% \paragraph{Packages} +% Assuming people are running up-to-date packages. +% \begin{macrocode} +\RequirePackage{expl3,xparse,l3keys2e} +\RequirePackage{fontspec} +\RequirePackage{ucharcat} +\RequirePackage{fix-cm} % avoid some warnings (still necessary? check...) +\RequirePackage{filehook} +% \end{macrocode} +% \paragraph{Bifurcate} +% \begin{macrocode} +\ExplSyntaxOn +\sys_if_engine_luatex:T { \RequirePackageWithOptions{unicode-math-luatex} } +\sys_if_engine_xetex:T { \RequirePackageWithOptions{unicode-math-xetex} } +\ExplSyntaxOff +% \end{macrocode} +% +% \begin{macrocode} +%</base> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx index 884d20242b4..84f6f600e62 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx @@ -1,7 +1,9 @@ -% \section{\DTXCURR --- Compatibility} +%%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{Compatibility} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % \begin{macro}{\@@_check_and_fix:NNnnnn} @@ -505,5 +507,24 @@ % \end{macro} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-epilogue.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx index 53e4d244e09..0a7f386eda6 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-epilogue.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx @@ -1,8 +1,9 @@ +%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Epilogue} +% \section{Epilogue} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % Lots of little things to tidy up. @@ -328,9 +329,24 @@ % % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% -\endinput +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-fontopt.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx index e60df7604a6..59805971ee7 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-fontopt.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx @@ -1,8 +1,9 @@ +%%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Font loading options} +% \section{Font loading options} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % \subsection{Math version} @@ -43,7 +44,7 @@ % for the individual definitions % \begin{macrocode} \int_incr:N \g_@@_fam_int - \tl_set:Nx \@@_symfont_tl {@@_fam\int_use:N\g_@@_fam_int} + \tl_set:Nx \l_@@_symfont_label_tl {@@_fam\int_use:N\g_@@_fam_int} \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_parse:nnn \cs_set_eq:NN \@@_set_mathalphabet_char:Nnn \@@_mathmap_parse:Nnn \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_parse:nnn @@ -241,7 +242,24 @@ % \end{macro} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% + \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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-fontparam.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx index 894e720824e..54021c48f36 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-fontparam.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx @@ -1,8 +1,9 @@ +%%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Common interface for font parameters} +% \section{Common interface for font parameters} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % \XeTeX\ and \LuaTeX\ have different interfaces for math font parameters. @@ -321,7 +322,24 @@ % \end{macro} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% + \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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx new file mode 100644 index 00000000000..942ea4771fa --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx @@ -0,0 +1,562 @@ +%%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{The main \cs{setmathfont} macro} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% Using a |range| including large character sets such as \cmd\mathrel, +% \cmd\mathalpha, \etc, is \emph{very slow}! +% I hope to improve the performance somehow. +% +% \begin{macro}{\@@_setmathfont:nn} +% \begin{macrocode} +\cs_set:Nn \@@_setmathfont:nn + { + \tl_set:Nn \l_@@_fontname_tl {#2} +% \end{macrocode} +% Erase any conception \LaTeX\ has of previously defined math symbol fonts; +% this allows \cmd\DeclareSymbolFont\ at any point in the document. +% \begin{macrocode} + \cs_set_eq:NN \glb@currsize \scan_stop: +% \end{macrocode} +% Initialise all local variabes: +% \begin{macrocode} + \@@_init: +% \end{macrocode} +% Grab the current size information: +% (is this robust enough? Maybe it should be preceded by \cmd\normalsize). +% The macro \cmd\S@\meta{size} +% contains the definitions of the sizes used for maths letters, subscripts and subsubscripts in +% \cmd\tf@size, \cmd\sf@size, and \cmd\ssf@size, respectively. +% \begin{macrocode} + \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } + \csname S@\f@size\endcsname +% \end{macrocode} +% Parse options and tell people what's going on: +% \begin{macrocode} + \keys_set_known:nnN {unicode-math} {#1} \l_@@_unknown_keys_clist + \bool_if:NT \l_@@_init_bool { \@@_log:n {default-math-font} } +% \end{macrocode} +% Use \pkg{fontspec} to select a font to use. +% After loading the font, we detect what sizes it recommends for scriptsize and scriptscriptsize, so after setting those values appropriately, we reload the font to take these into account. +% \begin{macrocode} +%<debug> \csname TIC\endcsname + \@@_fontspec_select_font: +%<debug> \csname TOC\endcsname + \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool } + { + \@@_declare_math_sizes: + \@@_fontspec_select_font: + } +% \end{macrocode} +% Now define |\l_@@_symfont_label_tl| as the \LaTeX\ math font to access everything: +% \begin{macrocode} + \cs_if_exist:cF { sym \l_@@_symfont_label_tl } + { + \DeclareSymbolFont{\l_@@_symfont_label_tl} + {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} + } + \SetSymbolFont{\l_@@_symfont_label_tl}{\l_@@_mversion_tl} + {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} +% \end{macrocode} +% Set the bold math version. +% \begin{macrocode} + \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} + { + \SetSymbolFont{\l_@@_symfont_label_tl}{bold} + {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} + } +% \end{macrocode} +% Declare the math sizes (i.e., scaling of superscripts) for the specific +% values for this font, +% and set defaults for math fams two and three for legacy compatibility: +% \begin{macrocode} + \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool } + { + \bool_set_true:N \g_@@_mainfont_already_set_bool + \@@_setup_legacy_fam_two: + \@@_setup_legacy_fam_three: + } +% \end{macrocode} +% And now we input every single maths char. +% \begin{macrocode} +%<debug> \csname TIC\endcsname + \@@_input_math_symbol_table: +%<debug> \csname TOC\endcsname +% \end{macrocode} +% Finally, +% \begin{itemize} +% \item remap symbols that don't take their natural mathcode; +% \item activate any symbols that need to be math-active; +% \item assign delimiter codes for symbols that need to grow; +% \item setup the maths alphabets (\cs{symbf} etc.) --- +% this is an extensive part of the code; see Section~\ref{sec:mathmap}; +% \item setup negations, which are handled on an ad hoc basis; see Section~\ref{sec:negations}. +% \end{itemize} +% \begin{macrocode} + \@@_remap_symbols: + \@@_setup_mathactives: + \@@_setup_delcodes: +%<debug> \csname TIC\endcsname + \@@_setup_alphabets: +%<debug> \csname TOC\endcsname + \@@_setup_negations: + } +% \end{macrocode} +% \end{macro} +% +% \paragraph{Fall-back font} +% +% Want to load Latin Modern Math if nothing else. +% This needs to happen early so that all of the font-loading machinery executes before +% the other `AtBeginDocument' code. +% \begin{macrocode} +\AtBeginDocument { \@@_load_lm_if_necessary: } +\cs_new:Nn \@@_load_lm_if_necessary: + { + \cs_if_exist:NF \l_@@_fontname_tl + { + % TODO: update this when lmmath-bold.otf is released + \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}] + \bool_set_false:N \g_@@_mainfont_already_set_bool + } + } +% \end{macrocode} +% Note that here we reset the `font already loaded' boolean so that a new font being set +% will do the right thing in terms of setting up defaults. +% +% TODO: need a better way to do this for the general case. (Maybe a `reset' command option?) +% +% \begin{macro}{\@@_init:} +% \begin{macrocode} +\cs_new:Nn \@@_init: + { + \bool_set_true:N \l_@@_ot_math_bool + \tl_set:Nn \l_@@_mversion_tl {normal} + \tl_set:Nn \l_@@_symfont_label_tl {operators} +% \end{macrocode} +% Defaults for the script and scriptscript font. +% \begin{macrocode} + \tl_set:Nn \l_@@_script_features_tl {Style=MathScript} + \tl_set:Nn \l_@@_sscript_features_tl {Style=MathScriptScript} + \tl_set_eq:NN \l_@@_script_font_tl \l_@@_fontname_tl + \tl_set_eq:NN \l_@@_sscript_font_tl \l_@@_fontname_tl +% \end{macrocode} +% Default to defining the font for every math symbol character. +% \begin{macrocode} + \bool_set_true:N \l_@@_init_bool + \seq_clear:N \l_@@_char_range_seq + \clist_clear:N \l_@@_char_nrange_clist + \seq_clear:N \l_@@_mathalph_seq + \seq_clear:N \l_@@_missing_alph_seq +% \end{macrocode} +% Other range initialisations. +% \begin{macrocode} + \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_noparse:nnn + \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn + \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_noparse:nnn + \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n + \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn + \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_noparse:nn + \cs_set_eq:NN \@@_make_mathactive:nNN \@@_make_mathactive_noparse:nNN + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_declare_math_sizes:} +% Set the math sizes according to the recommended font parameters. +% TODO: this shouldn't need to be per-engine; check out why the wrappers aren't used. +% \begin{macrocode} +\cs_new:Nn \@@_declare_math_sizes: + { +%<*LU> + \fp_compare:nF { \@@_script_style_size:n {ScriptPercentScaleDown} == 0 } + { + \DeclareMathSizes { \f@size } { \f@size } + { \@@_script_style_size:n {ScriptPercentScaleDown} } + { \@@_script_style_size:n {ScriptScriptPercentScaleDown} } + } +%</LU> +%<*XE> + \dim_compare:nF { \fontdimen 10 \l_@@_font == 0pt } + { + \DeclareMathSizes { \f@size } { \f@size } + { \@@_fontdimen_to_scale:nn {10} {\l_@@_font} } + { \@@_fontdimen_to_scale:nn {11} {\l_@@_font} } + } +%</XE> + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_script_style_size:n} +% Determine script- and scriptscriptstyle sizes using luaotfload: +% \begin{macrocode} +%<*LU> +\cs_new:Nn \@@_script_style_size:n + { + \fp_eval:n {\directlua{tex.sprint(luaotfload.aux.get_math_dimension("l_@@_font","#1"))} * \f@size / 100 } + } +%</LU> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_setup_legacy_fam_two:} +% \TeX\ won't load the same font twice at the same scale, so we need to magnify this one by an imperceptable amount. +% \begin{macrocode} +\cs_new:Nn \@@_setup_legacy_fam_two: + { + \fontspec_set_family:Nxn \l_@@_family_tl + { + \l_@@_font_keyval_tl, + Scale=1.00001, + FontAdjustment = + { + \@@_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax + \@@_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax + \@@_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax + \@@_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax + \@@_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax + \@@_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax + \@@_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax + \@@_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax + \@@_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax + \@@_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax + \@@_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax + \@@_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax + \@@_zero_fontparam:n {20} % delim1 = FractionDelimiterDisplaySize + \@@_zero_fontparam:n {21} % delim2 = FractionDelimiterSize + \@@_copy_fontparam:nnn {22} {15} {AxisHeight}\relax + } + } {\l_@@_fontname_tl} + + \SetSymbolFont{symbols}{\l_@@_mversion_tl} + {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} + + \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} + { + \SetSymbolFont{symbols}{bold} + {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_setup_legacy_fam_three:} +% Similarly, this font is shrunk by an imperceptable amount for \TeX\ to load it again. +% \begin{macrocode} +\cs_new:Nn \@@_setup_legacy_fam_three: + { + \fontspec_set_family:Nxn \l_@@_family_tl + { + \l_@@_font_keyval_tl, + Scale=0.99999, + FontAdjustment = { + \@@_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax + \@@_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax + \@@_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax + \@@_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax + \@@_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax + \@@_zero_fontparam:n {13} + } + } {\l_@@_fontname_tl} + + \SetSymbolFont{largesymbols}{\l_@@_mversion_tl} + {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} + + \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} + { + \SetSymbolFont{largesymbols}{bold} + {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} + } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_fontspec_select_font:} +% Select the font with \cs{fontspec} and define \cs{l_@@_font} from it. +% \begin{macrocode} +\cs_new:Nn \@@_fontspec_select_font: + { + \tl_set:Nx \l_@@_font_keyval_tl { +%<LU> Renderer = Basic, + BoldItalicFont = {}, ItalicFont = {}, + Script = Math, + SizeFeatures = + { + { + Size = \tf@size- + } , + { + Size = \sf@size-\tf@size , + Font = \l_@@_script_font_tl , + \l_@@_script_features_tl + } , + { + Size = -\sf@size , + Font = \l_@@_sscript_font_tl , + \l_@@_sscript_features_tl + } + } , + \l_@@_unknown_keys_clist + } + + \fontspec_set_fontface:NNxn \l_@@_font \l_@@_family_tl + {\l_@@_font_keyval_tl} {\l_@@_fontname_tl} +% \end{macrocode} +% Check whether we're using a real maths font: +% \begin{macrocode} + \group_begin: + \fontfamily{\l_@@_family_tl}\selectfont + \fontspec_if_script:nF {math} {\bool_gset_false:N \l_@@_ot_math_bool} + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Functions for setting up symbols with mathcodes} +% \seclabel{mathsymbol} +% +% \begin{macro}{\@@_process_symbol_noparse:nnn} +% \begin{macro}{\@@_process_symbol_parse:nnn} +% If the \feat{range} font feature has been used, then only +% a subset of the Unicode glyphs are to be defined. +% See \secref{rangeproc} for the code that enables this. +% \begin{macrocode} +\cs_set:Nn \@@_process_symbol_noparse:nnn + { + \@@_set_mathsymbol:nNNn {\l_@@_symfont_label_tl} #2 #3 {#1} + } +% \end{macrocode} +% \begin{macrocode} +\cs_set:Nn \@@_process_symbol_parse:nnn + { + \@@_if_char_spec:nNNT {#1} {#2} {#3} + { + \@@_process_symbol_noparse:nnn {#1} {#2} {#3} + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_remap_symbols:} +% \begin{macro}{\@@_remap_symbol_noparse:nnn} +% \begin{macro}{\@@_remap_symbol_parse:nnn} +% This function is used to define the mathcodes for those chars which should +% be mapped to a different glyph than themselves. +% \begin{macrocode} +\cs_new:Npn \@@_remap_symbols: + { + \@@_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus + \@@_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" + \bool_if:NF \g_@@_literal_colon_bool + { + \@@_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel) + } + } +% \end{macrocode} +% \end{macro} +% Where |\@@_remap_symbol:nnn| is defined to be one of these two, depending +% on the range setup: +% \begin{macrocode} +\cs_new:Nn \@@_remap_symbol_parse:nnn + { + \@@_if_char_spec:nNNT {#3} {\@nil} {#2} + { \@@_remap_symbol_noparse:nnn {#1} {#2} {#3} } + } +\cs_new:Nn \@@_remap_symbol_noparse:nnn + { + \clist_map_inline:nn {#1} + { \@@_set_mathcode:nnnn {##1} {#2} {\l_@@_symfont_label_tl} {#3} } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Active math characters} +% +% There are more math active chars later in the subscript/superscript section. +% But they don't need to be able to be typeset directly. +% +% \begin{macro}{\@@_setup_mathactives:} +% \begin{macrocode} +\cs_new:Npn \@@_setup_mathactives: + { + \@@_make_mathactive:nNN {"2032} \@@_prime_single_mchar \mathord + \@@_make_mathactive:nNN {"2033} \@@_prime_double_mchar \mathord + \@@_make_mathactive:nNN {"2034} \@@_prime_triple_mchar \mathord + \@@_make_mathactive:nNN {"2057} \@@_prime_quad_mchar \mathord + \@@_make_mathactive:nNN {"2035} \@@_backprime_single_mchar \mathord + \@@_make_mathactive:nNN {"2036} \@@_backprime_double_mchar \mathord + \@@_make_mathactive:nNN {"2037} \@@_backprime_triple_mchar \mathord + \@@_make_mathactive:nNN {`\'} \mathstraightquote \mathord + \@@_make_mathactive:nNN {`\`} \mathbacktick \mathord + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_make_mathactive:nNN} +% Makes |#1| a mathactive char, and gives cs |#2| the meaning of mathchar |#1| +% with class |#3|. +% You are responsible for giving active |#1| a particular meaning! +% \begin{macrocode} +\cs_new:Nn \@@_make_mathactive_parse:nNN + { + \@@_if_char_spec:nNNT {#1} #2 #3 + { \@@_make_mathactive_noparse:nNN {#1} #2 #3 } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Nn \@@_make_mathactive_noparse:nNN + { + \@@_set_mathchar:NNnn #2 #3 {\l_@@_symfont_label_tl} {#1} + \@@_char_gmake_mathactive:n {#1} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Delimiter codes} +% +% \begin{macro}{\@@_assign_delcode:nn} +% \begin{macrocode} +\cs_new:Nn \@@_assign_delcode_noparse:nn + { + \@@_set_delcode:nnn \l_@@_symfont_label_tl {#1} {#2} + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Nn \@@_assign_delcode_parse:nn + { + \@@_if_char_spec:nNNT {#2} {\@nil} {\@nil} + { + \@@_assign_delcode_noparse:nn {#1} {#2} + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_assign_delcode:n} +% Shorthand. +% \begin{macrocode} +\cs_new:Nn \@@_assign_delcode:n { \@@_assign_delcode:nn {#1} {#1} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_setup_delcodes:} +% Some symbols that aren't mathopen/mathclose still need to have delimiter codes assigned. +% The list of vertical arrows may be incomplete. +% On the other hand, many fonts won't support them all being stretchy. +% And some of them are probably not meant to stretch, either. But adding them here doesn't hurt. +% \begin{macrocode} +\cs_new:Npn \@@_setup_delcodes: + { + % ensure \left. and \right. work: + \@@_set_delcode:nnn \l_@@_symfont_label_tl {`\.} {\c_zero} + % this is forcefully done to fix a bug -- indicates a larger problem! + + \@@_assign_delcode:nn {`\/} {\g_@@_slash_delimiter_usv} + \@@_assign_delcode:nn {"2044} {\g_@@_slash_delimiter_usv} % fracslash + \@@_assign_delcode:nn {"2215} {\g_@@_slash_delimiter_usv} % divslash + \@@_assign_delcode:n {"005C} % backslash + \@@_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation + \@@_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation + \@@_assign_delcode:n {"2191} % up arrow + \@@_assign_delcode:n {"2193} % down arrow + \@@_assign_delcode:n {"2195} % updown arrow + \@@_assign_delcode:n {"219F} % up arrow twohead + \@@_assign_delcode:n {"21A1} % down arrow twohead + \@@_assign_delcode:n {"21A5} % up arrow from bar + \@@_assign_delcode:n {"21A7} % down arrow from bar + \@@_assign_delcode:n {"21A8} % updown arrow from bar + \@@_assign_delcode:n {"21BE} % up harpoon right + \@@_assign_delcode:n {"21BF} % up harpoon left + \@@_assign_delcode:n {"21C2} % down harpoon right + \@@_assign_delcode:n {"21C3} % down harpoon left + \@@_assign_delcode:n {"21C5} % arrows up down + \@@_assign_delcode:n {"21F5} % arrows down up + \@@_assign_delcode:n {"21C8} % arrows up up + \@@_assign_delcode:n {"21CA} % arrows down down + \@@_assign_delcode:n {"21D1} % double up arrow + \@@_assign_delcode:n {"21D3} % double down arrow + \@@_assign_delcode:n {"21D5} % double updown arrow + \@@_assign_delcode:n {"21DE} % up arrow double stroke + \@@_assign_delcode:n {"21DF} % down arrow double stroke + \@@_assign_delcode:n {"21E1} % up arrow dashed + \@@_assign_delcode:n {"21E3} % down arrow dashed + \@@_assign_delcode:n {"21E7} % up white arrow + \@@_assign_delcode:n {"21E9} % down white arrow + \@@_assign_delcode:n {"21EA} % up white arrow from bar + \@@_assign_delcode:n {"21F3} % updown white arrow + } +% \end{macrocode} +% \end{macro} +% +% \subsection{(Big) operators} +% +% The engine does what is necessary to deal with big operators for us +% automatically with \cmd\Umathchardef. +% However, the limits aren't set automatically; that is, we want to define, +% a la Plain \TeX\ \etc, |\def\int{\intop\nolimits}|, so there needs to be a +% transformation from \cmd\int\ to \cmd\intop\ during the expansion of +% \cmd\_@@_sym:nnn\ in the appropriate contexts. +% +% \begin{macro}{\l_@@_nolimits_tl} +% This macro is a sequence containing those maths operators that require a +% \cmd\nolimits\ suffix. +% This list is used when processing |unicode-math-table.tex| to define such +% commands automatically (see the macro \cs{@@_set_mathsymbol:nNNn}). +% I've chosen essentially just the operators that look like integrals; +% hopefully a better mathematician can help me out here. +% I've a feeling that it's more useful \emph{not} to include the multiple +% integrals such as $\iiiint$, but that might be a matter of preference. +% \begin{macrocode} +\tl_set:Nn \l_@@_nolimits_tl + { + \int\iint\iiint\iiiint\oint\oiint\oiiint + \intclockwise\varointclockwise\ointctrclockwise\sumint + \intbar\intBar\fint\cirfnint\awint\rppolint + \scpolint\npolint\pointint\sqint\intlarhk\intx + \intcap\intcup\upint\lowint + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Radicals} +% +% \begin{macro}{\l_@@_radicals_tl} +% The radicals are organised in \cs{@@_set_mathsymbol:nNNn}. +% We organise radicals in the same way as nolimits-operators. +% (\cs{cuberoot} and \cs{fourthroot}, don't seem to behave as proper radicals.) +% \begin{macrocode} +\tl_set:Nn \l_@@_radicals_tl {\sqrt \longdivision} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-mathmap.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx index f9ae41c69e1..2b843fb29a4 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-mathmap.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx @@ -1,9 +1,10 @@ +%%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Mapping in maths alphabets} +% \section{Mapping in maths alphabets} % \label{sec:mathmap} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % Switching to a different style of alphabetic symbols was traditionally performed with @@ -357,7 +358,7 @@ \clist_map_break: } { - \@@_glyph_if_exist:nT { \@@_to_usv:nn {\l_@@_style_tl} {\l_@@_alphabet_tl} } + \@@_glyph_if_exist:NnT \l_@@_font { \@@_to_usv:nn {\l_@@_style_tl} {\l_@@_alphabet_tl} } { \@@_maybe_init_alphabet:n \l_@@_style_tl \clist_map_break: @@ -382,7 +383,7 @@ \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl} } { - \@@_glyph_if_exist:nTF { \@@_to_usv:nn {\l_@@_remap_style_tl} {\l_@@_alphabet_tl} } + \@@_glyph_if_exist:NnTF \l_@@_font { \@@_to_usv:nn {\l_@@_remap_style_tl} {\l_@@_alphabet_tl} } { \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)} \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl} @@ -425,7 +426,7 @@ % \begin{macro}{\@@_map_char_parse:nn} % \begin{macrocode} \cs_new:Nn \@@_map_char_noparse:nn - { \@@_set_mathcode:nnnn {#1}{\mathalpha}{\@@_symfont_tl}{#2} } + { \@@_set_mathcode:nnnn {#1}{\mathalpha}{\l_@@_symfont_label_tl}{#2} } % \end{macrocode} % % \begin{macrocode} @@ -583,7 +584,7 @@ { \tl_put_right:cx {@@_switchto_#1:} { - \@@_set_mathcode:nnnn {##1} {\mathalpha} {\@@_symfont_tl} {#3} + \@@_set_mathcode:nnnn {##1} {\mathalpha} {\l_@@_symfont_label_tl} {#3} } } } @@ -714,7 +715,24 @@ % \end{macrocode} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% + \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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-mathtext.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx index 94761625578..9cdbb3b6add 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-mathtext.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx @@ -1,13 +1,14 @@ +%%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Maths text commands} +% \section{Maths text commands} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % \subsection{\cs{setmathfontface}} % -% \begin{macro}{\setmathfontface} +% \begin{macro}{\@@_setmathfontface:Nnn} % \begin{macrocode} \keys_define:nn {@@_mathface} { @@ -15,13 +16,14 @@ { \tl_set:Nn \l_@@_mversion_tl {#1} } } % \end{macrocode} -% +% % \begin{macrocode} -\DeclareDocumentCommand \setmathfontface { m O{} m O{} } +\cs_set:Nn \@@_setmathfontface:Nnn { \tl_clear:N \l_@@_mversion_tl - \keys_set_known:nnN {@@_mathface} {#2,#4} \l_@@_keyval_clist + \keys_set_known:nnN {@@_mathface} {#2} \l_@@_keyval_clist + \exp_args:Nnx \fontspec_set_family:Nxn \l_@@_tmpa_tl { ItalicFont={}, BoldFont={}, \exp_not:V \l_@@_keyval_clist } {#3} @@ -30,6 +32,7 @@ \tl_set:Nn \l_@@_mversion_tl {normal} \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} } + \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} % integrate with fontspec's \setmathrm etc: @@ -41,21 +44,8 @@ } } % \end{macrocode} -% -% \begin{macrocode} -\@onlypreamble \setmathfontface -% \end{macrocode} -% Note that \LaTeX's SetMathAlphabet simply doesn't work to "reset" a maths alphabet font after \verb"\begin{document}", so unlike most of the other maths commands around we still restrict this one to the preamble. % \end{macro} % -% \begin{macro}{\setoperatorfont} -% TODO: add check? -% \begin{macrocode} -\DeclareDocumentCommand \setoperatorfont {m} - { \tl_set:Nn \g_@@_operator_mathfont_tl {#1} } -\setoperatorfont{\mathrm} -% \end{macrocode} -% \end{macro} % % \subsection{Hooks into \pkg{fontspec}} % @@ -129,5 +119,24 @@ % \end{macrocode} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-msg.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx index 1b4a2f9fece..d797e09b57d 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-msg.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx @@ -1,9 +1,10 @@ +%%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Error messages} +% \section{Error messages} % \seclabel{codemsg} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % Wrapper functions: @@ -105,5 +106,24 @@ % \end{macrocode} % % \begin{macrocode} -%</package&(XE|LU)> -% \end{macrocode}
\ No newline at end of file +%</package> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx new file mode 100644 index 00000000000..0f681f52dee --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx @@ -0,0 +1,249 @@ +%%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{Start of the package code} +% +% The prefix for \pkg{unicode-math} is \texttt{um}: +% \begin{macrocode} +%<@@=um> +% \end{macrocode} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macrocode} +%<*LU> +\RequirePackage{lualatex-math} +%</LU> +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOn +% \end{macrocode} +% +% \subsection{\pkg{expl3} variants} +% +% Variants needed from \pkg{expl3}: +% \begin{macrocode} +\cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: } +% \end{macrocode} +% +% For \pkg{fontspec}: +% \begin{macrocode} +\cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} +\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} +% \end{macrocode} +% +% +% \subsection{Primitive font commands} +% +% What might end up being provided by the kernel. +% +% \begin{macro}{\@@_glyph_if_exist:NnTF} +% \begin{macrocode} +\prg_new_conditional:Nnn \@@_glyph_if_exist:Nn {p,TF,T,F} + { + \etex_iffontchar:D #1 #2 \scan_stop: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Mathcode and friends} +% +% \begin{macro}{\@@_set_mathcode:nnnn} +% \begin{macro}{\@@_set_mathcode:nnn} +% These are all wrappers for the primitive commands that take numerical +% input only. +% \begin{macrocode} +\cs_set:Npn \@@_set_mathcode:nnnn #1#2#3#4 + { + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Npn \@@_set_mathcode:nnn #1#2#3 + { + \Umathcode \int_eval:n {#1} = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_set_mathchar:NNnn} +% \begin{macro}{\@@_set_mathchar:cNnn} +% \begin{macrocode} +\cs_set:Npn \@@_set_mathchar:NNnn #1#2#3#4 + { + \Umathchardef #1 = + \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\cs_generate_variant:Nn \@@_set_mathchar:NNnn {c} +% \end{macrocode} +% +% \begin{macro}{\@@_set_delcode:nnn} +% \begin{macrocode} +\cs_new:Nn \@@_set_delcode:nnn + { + \Udelcode#2 = \csname sym#1\endcsname #3 \scan_stop: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_radical:nn} +% \begin{macrocode} +\cs_new:Nn \@@_radical:nn + { + \Uradical \csname sym#1\endcsname #2 \scan_stop: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_delimiter:Nnn} +% \begin{macrocode} +\cs_new:Nn \@@_delimiter:Nnn + { + \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_accent:nnn} +% \begin{macrocode} +\cs_new:Nn \@@_accent:nnn + { + \Umathaccent #1~ \mathchar@type\mathaccent \use:c { sym #2 } #3 \scan_stop: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_char_gmake_mathactive:N} +% \begin{macro}{\@@_char_gmake_mathactive:n} +% \begin{macrocode} +\cs_new:Nn \@@_char_gmake_mathactive:N + { + \global\mathcode `#1 = "8000 \scan_stop: + } +\cs_new:Nn \@@_char_gmake_mathactive:n + { + \global\mathcode #1 = "8000 \scan_stop: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Font parameters} +% +% \begin{macro}{\@@_copy_fontparam:nnn} +% \begin{macrocode} +\cs_new:Nn \@@_copy_fontparam:nnn + { + \fontdimen #1 \font = \@@_get_fontparam:nn {#2} {#3} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_zero_fontparam:n} +% \begin{macrocode} +\cs_new:Nn \@@_zero_fontparam:n + { + \fontdimen #1 \font = 0pt\relax + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_get_fontparam:nn} +% \begin{macrocode} +\cs_new:Nn \@@_get_fontparam:nn + { +%<XE> \the\fontdimen#1\l_@@_font\relax +%<LU> \directlua{fontspec.mathfontdimen("l_@@_font","#2")} + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Alphabet Unicode positions (USVs)} +% +% Before we begin, let's define the positions of the various Unicode +% alphabets so that our code is a little more readable.\footnote{`\textsc{u.s.v.}' stands +% for `Unicode scalar value'.} +% +% \begin{macro}{\usv_set:nnn,\@@_to_usv:nn} +% Rather than `readable', in the end, this makes the code more extensible. +% \begin{macrocode} +\cs_new:Nn \usv_set:nnn { \tl_const:cn { c_@@_#1_#2_usv } {#3} } +\cs_new:Nn \@@_to_usv:nn { \use:c { c_@@_#1_#2_usv } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[TF]{\@@_usv_if_exist:nn} +% \begin{macrocode} +\prg_new_conditional:Nnn \@@_usv_if_exist:nn {T,F,TF} + { + \cs_if_exist:cTF { c_@@_#1_#2_usv } + \prg_return_true: \prg_return_false: + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Overcoming \texorpdfstring{\cmd\@onlypreamble}{\textbackslash @onlypreamble}} +% +% The requirement of only setting up the maths fonts in the preamble is lifted. +% (Perhaps unwisely.) +% \begin{macrocode} +\tl_map_inline:nn + { + \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes + \@DeclareMathSizes\newmathalphabet\newmathalphabet@@\newmathalphabet@@@ + \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion + \version@list\version@elt\alpha@list\alpha@elt + \restore@mathversion\init@restore@version\dorestore@version\process@table + \new@mathversion\DeclareSymbolFont\group@list\group@elt + \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp + \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@ + \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar + \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter + \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter + \set@@mathdelimiter\DeclareMathRadical\mathchar@type + \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@ + } + { + \tl_remove_once:Nn \@preamblecmds {\do#1} + } +% \end{macrocode} +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-pkgopt.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx index 9af437d79e5..625770edbdc 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-pkgopt.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx @@ -1,18 +1,11 @@ +%%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- setup and package options} +% \section{setup and package options} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % -% \begin{macro}{\unimathsetup} -% This macro can be used in lieu of or later to override -% options declared when the package is loaded. -% \begin{macrocode} -\DeclareDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_keys_choices:nn} % To simplify the creation of option keys, let's iterate in pairs rather than worry about equals signs and commas. % \begin{macrocode} @@ -30,14 +23,14 @@ } \cs_new:Nn \@@_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , } % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Nn \@@_tl_map_dbl:nN { \__@@_tl_map_dbl:Nnn #2 #1 \q_recursion_tail {}{} \q_recursion_stop } % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Nn \__@@_tl_map_dbl:Nnn { @@ -297,5 +290,24 @@ % \end{macrocode} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-primes.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx index bbd35807c5b..510ecc5f2ff 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-primes.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx @@ -1,8 +1,9 @@ +%%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Primes} +% \section{Primes} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % We need a new `prime' algorithm. Unicode math has four pre-drawn prime glyphs. @@ -71,7 +72,7 @@ } } % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Nn \@@_nprimes_select:nn { @@ -79,17 +80,17 @@ { {1} { \@@_superscript:n {#1} } {2} { - \@@_glyph_if_exist:nTF {"2033} + \@@_glyph_if_exist:NnTF \l_@@_font {"2033} { \@@_superscript:n {\@@_prime_double_mchar} } { \@@_nprimes:Nn #1 {#2} } } {3} { - \@@_glyph_if_exist:nTF {"2034} + \@@_glyph_if_exist:NnTF \l_@@_font {"2034} { \@@_superscript:n {\@@_prime_triple_mchar} } { \@@_nprimes:Nn #1 {#2} } } {4} { - \@@_glyph_if_exist:nTF {"2057} + \@@_glyph_if_exist:NnTF \l_@@_font {"2057} { \@@_superscript:n {\@@_prime_quad_mchar} } { \@@_nprimes:Nn #1 {#2} } } @@ -99,7 +100,7 @@ } } % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Nn \@@_nbackprimes_select:nn { @@ -107,12 +108,12 @@ { {1} { \@@_superscript:n {#1} } {2} { - \@@_glyph_if_exist:nTF {"2036} + \@@_glyph_if_exist:NnTF \l_@@_font {"2036} { \@@_superscript:n {\@@_backprime_double_mchar} } { \@@_nprimes:Nn #1 {#2} } } {3} { - \@@_glyph_if_exist:nTF {"2037} + \@@_glyph_if_exist:NnTF \l_@@_font {"2037} { \@@_superscript:n {\@@_backprime_triple_mchar} } { \@@_nprimes:Nn #1 {#2} } } @@ -230,7 +231,7 @@ } } % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Npn \@@_scan_backprime: { @@ -331,7 +332,7 @@ \cs_set_eq:NN \backtrprime \@@_backprime_triple_mchar } % \end{macrocode} -% +% % \begin{macrocode} \group_begin: \char_set_catcode_active:N \' @@ -360,9 +361,24 @@ % % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% -\endinput +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-setchar.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx index 49911514805..12928baf240 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-setchar.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx @@ -1,8 +1,9 @@ +%%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Setting up maths chars} +% \section{Setting up maths chars} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % \subsection{A token list to contain the data of the math table} @@ -263,7 +264,24 @@ % % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% + \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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-sscript.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx index ceaa2c7f8b1..ed94037f2af 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-sscript.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx @@ -1,8 +1,9 @@ +%%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Unicode sub- and super-scripts} +% \section{Unicode sub- and super-scripts} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % The idea here is to enter a scanning state after a superscript or subscript @@ -179,9 +180,24 @@ % % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} -% -\endinput +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx new file mode 100644 index 00000000000..8dd1272a9d9 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx @@ -0,0 +1,100 @@ +%%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{The user interface commands} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macro}{\unimathsetup} +% This macro can be used in lieu of or later to override +% options declared when the package is loaded. +% \begin{macrocode} +\NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmathfont} +% \doarg{font features (first optional argument retained for backwards compatibility)} +% \darg{font name} +% \doarg{font features} +% \begin{macrocode} +\NewDocumentCommand \setmathfont { O{} m O{} } + { + \@@_setmathfont:nn {#1,#3} {#2} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmathfontface} +% \begin{macrocode} +\NewDocumentCommand \setmathfontface { m O{} m O{} } + { + \@@_setmathfontface:Nnn #1 {#2,#4} {#3} + } +% \end{macrocode} +% +% Note that \LaTeX’s \cs{SetMathAlphabet} simply doesn’t work to “reset” a maths alphabet font after \verb”\begin{document}”, so unlike most of the other maths commands around we still restrict this one to the preamble. +% \begin{macrocode} +\@onlypreamble \setmathfontface +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\setoperatorfont} +% TODO: add check? +% \begin{macrocode} +\NewDocumentCommand \setoperatorfont {m} + { + \tl_set:Nn \g_@@_operator_mathfont_tl {#1} + } +\setoperatorfont{\mathrm} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addnolimits} +% This macro appends material to the macro containing the list of operators +% that don’t take limits. +% \begin{macrocode} +\NewDocumentCommand \addnolimits {m} + { + \tl_put_right:Nn \l_@@_nolimits_tl {#1} + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\removenolimits} +% Can this macro be given a better name? +% It removes an item from the nolimits list. +% \begin{macrocode} +\NewDocumentCommand \removenolimits {m} + { + \tl_remove_all:Nn \l_@@_nolimits_tl {#1} + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-usv.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx index 01fa9a08eb4..694e6b4eae7 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-usv.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx @@ -1,12 +1,13 @@ +%%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -% \section{\DTXCURR --- Alphabet Unicode positions} +% \section{Alphabet Unicode positions} % % Before we begin, let's define the positions of the various Unicode % alphabets so that our code is a little more readable.\footnote{`\textsc{u.s.v.}' stands % for `Unicode scalar value'.} % % \begin{macrocode} -%<*package&(XE|LU)> +%<*package> % \end{macrocode} % % \paragraph{Alphabets} @@ -324,7 +325,7 @@ % \end{macrocode} % % \begin{macrocode} -%</package&(XE|LU)> +%</package> % \end{macrocode} % % \subsection{STIX fonts} @@ -565,3 +566,22 @@ % \begin{macrocode} %</stix> % \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx b/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx new file mode 100644 index 00000000000..1f4a5c70fb4 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx @@ -0,0 +1,185 @@ +%%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> + +% \section{Variable initialisation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% +% \paragraph{Conditionals} +% +% True if using a proper OpenType font with unicode maths +% \begin{macrocode} +\bool_new:N \l_@@_ot_math_bool +% \end{macrocode} +% +% \begin{macrocode} +\bool_new:N \l_@@_init_bool +\bool_new:N \l_@@_implicit_alph_bool +\bool_new:N \g_@@_mainfont_already_set_bool +% \end{macrocode} +% For \opt{math-style}: +% \begin{macrocode} +\bool_new:N \g_@@_literal_bool +\bool_new:N \g_@@_upLatin_bool +\bool_new:N \g_@@_uplatin_bool +\bool_new:N \g_@@_upGreek_bool +\bool_new:N \g_@@_upgreek_bool +% \end{macrocode} +% For \opt{bold-style}: +% \begin{macrocode} +\bool_new:N \g_@@_bfliteral_bool +\bool_new:N \g_@@_bfupLatin_bool +\bool_new:N \g_@@_bfuplatin_bool +\bool_new:N \g_@@_bfupGreek_bool +\bool_new:N \g_@@_bfupgreek_bool +% \end{macrocode} +% For \opt{sans-style}: +% \begin{macrocode} +\bool_new:N \g_@@_upsans_bool +\bool_new:N \g_@@_sfliteral_bool +% \end{macrocode} +% For assorted package options: +% \begin{macrocode} +\bool_new:N \g_@@_upNabla_bool +\bool_new:N \g_@@_uppartial_bool +\bool_new:N \g_@@_literal_Nabla_bool +\bool_new:N \g_@@_literal_partial_bool +\bool_new:N \l_@@_smallfrac_bool +\bool_new:N \g_@@_literal_colon_bool +\bool_new:N \g_@@_mathrm_text_bool +\bool_new:N \g_@@_mathit_text_bool +\bool_new:N \g_@@_mathbf_text_bool +\bool_new:N \g_@@_mathsf_text_bool +\bool_new:N \g_@@_mathtt_text_bool +% \end{macrocode} +% +% \paragraph{Variables} +% \begin{macrocode} +\int_new:N \g_@@_fam_int +% \end{macrocode} +% +% For displaying in warning messages, etc.: +% \begin{macrocode} +\tl_const:Nn \c_@@_math_alphabet_name_latin_tl {Latin,~lowercase} +\tl_const:Nn \c_@@_math_alphabet_name_Latin_tl {Latin,~uppercase} +\tl_const:Nn \c_@@_math_alphabet_name_greek_tl {Greek,~lowercase} +\tl_const:Nn \c_@@_math_alphabet_name_Greek_tl {Greek,~uppercase} +\tl_const:Nn \c_@@_math_alphabet_name_num_tl {Numerals} +\tl_const:Nn \c_@@_math_alphabet_name_misc_tl {Misc.} +% \end{macrocode} +% +% \begin{macrocode} +\tl_new:N \l_@@_mathstyle_tl +\tl_new:N \l_@@_radicals_tl +\tl_new:N \l_@@_nolimits_tl +% \end{macrocode} +% +% Used to store the font switch for the \cs{operator@font}. +% \begin{macrocode} +\tl_new:N \g_@@_operator_mathfont_tl +% \end{macrocode} +% +% \begin{macrocode} +\seq_new:N \l_@@_missing_alph_seq +\seq_new:N \l_@@_mathalph_seq +\seq_new:N \l_@@_char_range_seq +\seq_new:N \l_@@_mclass_range_seq +\seq_new:N \l_@@_cmd_range_seq +% \end{macrocode} +% +% \begin{macro}{\g_@@_alphabets_seq} +% Each of math `style' (bfup, sfit, etc.) usually contains one or more `alphabets', which are currently |latin|, |Latin|, |greek|, |Greek|, |num|, and |misc|, although there's an implicit potential for more. +% |misc| is not included in the official list to avoid checking code. +% \begin{macrocode} +\clist_new:N \g_@@_alphabets_seq +\clist_set:Nn \g_@@_alphabets_seq { latin, Latin, greek, Greek, num } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\clist_new:N \g_@@_named_ranges_clist +\clist_new:N \g_@@_char_nrange_clist +\clist_new:N \g_@@_unknown_keys_clist +\clist_new:N \g_@@_alphabet_clist +% \end{macrocode} +% +% \begin{macro}{\g_@@_mathclasses_seq} +% Every math class. +% \begin{macrocode} +\seq_new:N \g_@@_mathclasses_seq +\seq_set_from_clist:Nn \g_@@_mathclasses_seq + { + \mathord,\mathalpha,\mathbin,\mathrel,\mathpunct, + \mathop, + \mathopen,\mathclose, + \mathfence,\mathover,\mathunder, + \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide + } +% \end{macrocode} +% \end{macro} +% + +% \begin{macro}{\g_@@_default_mathalph_seq} +% This sequence stores the alphabets in each math style. +% \begin{macrocode} +\seq_new:N \g_@@_default_mathalph_seq +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\g_@@_mathstyles_seq} +% This is every `named range' and every `math style' known to \pkg{unicode-math}. +% A named range is such as "bfit" and "sfit", which are also math styles (with \cs{symbfit} and \cs{symsfit}). +% `Mathstyles' are a superset of named ranges and also include commands such as \cs{symbf} and \cs{symsf}. +% +% N.B. for parsing purposes `named ranges' are defined as strings! +% \begin{macrocode} +\seq_new:N \g_@@_named_ranges_seq +\seq_new:N \g_@@_mathstyles_seq +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\muskip_new:N \g_@@_primekern_muskip +\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }% arbitrary +\int_new:N \l_@@_primecount_int +\prop_new:N \g_@@_supers_prop +\prop_new:N \g_@@_subs_prop +\tl_new:N \l_not_token_name_tl +% \end{macrocode} +% +% \begin{macrocode} +\tl_new:N \g_@@_slash_delimiter_usv +\tl_new:N \g_@@_mathtable_tl +\tl_new:N \g_@@_fontname_tl +\tl_new:N \g_@@_mversion_tl +\tl_new:N \g_@@_symfont_tl +\tl_new:N \g_@@_font_keyval_tl +\tl_new:N \g_@@_family_tl +\tl_new:N \g_@@_style_tl +\tl_new:N \g_@@_remap_style_tl +% \end{macrocode} +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex b/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex new file mode 100644 index 00000000000..0dbac058d60 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex @@ -0,0 +1,76 @@ +%%^^A%% um-doc-legacyfontdimen.tex -- part of UNICODE-MATH <wspr.io/unicode-math> + +\section{Legacy \TeX\ font dimensions} + +\centerline{% +\begin{tabular}[t]{@{}lp{4cm}@{}} +\toprule +\multicolumn{2}{@{}c@{}}{Text fonts} \\ +\midrule +$\phi_1$ & slant per pt \\ +$\phi_2$ & interword space \\ +$\phi_3$ & interword stretch \\ +$\phi_4$ & interword shrink \\ +$\phi_5$ & x-height \\ +$\phi_6$ & quad width \\ +$\phi_7$ & extra space \\ +$\phi_8$ & cap height (\XeTeX\ only) \\ +\bottomrule +\end{tabular} +\quad +\begin{tabular}[t]{@{}lp{4cm}@{}} +\toprule +\multicolumn{2}{@{}c@{}}{Maths font, \cs{fam}2} \\ +\midrule +$\sigma_5$ & x height \\ +$\sigma_6$ & quad \\ +$\sigma_8$ & num1 \\ +$\sigma_9$ & num2 \\ +$\sigma_{10}$ & num3 \\ +$\sigma_{11}$ & denom1 \\ +$\sigma_{12}$ & denom2 \\ +$\sigma_{13}$ & sup1 \\ +$\sigma_{14}$ & sup2 \\ +$\sigma_{15}$ & sup3 \\ +$\sigma_{16}$ & sub1 \\ +$\sigma_{17}$ & sub2 \\ +$\sigma_{18}$ & sup drop \\ +$\sigma_{19}$ & sub drop \\ +$\sigma_{20}$ & delim1 \\ +$\sigma_{21}$ & delim2 \\ +$\sigma_{22}$ & axis height \\ +\bottomrule +\end{tabular} +\quad +\begin{tabular}[t]{@{}lp{4cm}@{}} +\toprule +\multicolumn{2}{@{}c@{}}{Maths font, \cs{fam}3} \\ +\midrule +$\xi_8$ & default rule thickness \\ +$\xi_9$ & big op spacing1 \\ +$\xi_{10}$ & big op spacing2 \\ +$\xi_{11}$ & big op spacing3 \\ +$\xi_{12}$ & big op spacing4 \\ +$\xi_{13}$ & big op spacing5 \\ +\bottomrule +\end{tabular} +} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex b/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex new file mode 100644 index 00000000000..4ef1df29728 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex @@ -0,0 +1,151 @@ +%%^^A%% um-doc-mathfontdimen.tex -- part of UNICODE-MATH <wspr.io/unicode-math> + +\section{\Hologo{XeTeX} math font dimensions} + +These are the extended \cmd\fontdimen s available for suitable fonts +in \XeTeX. Note that Lua\TeX\ takes an alternative route, and this package +will eventually provide a wrapper interface to the two (I hope). + +\newcounter{mfdimen} +\setcounter{mfdimen}{9} +\newcommand\mathfontdimen[2]{^^A + \stepcounter{mfdimen}^^A + \themfdimen & {\scshape\small #1} & #2\vspace{0.5ex} \tabularnewline} + +\begin{longtable}{ + @{}c>{\raggedright\parfillskip=0pt}p{4cm}>{\raggedright}p{7cm}@{}} +\toprule \cmd\fontdimen & Dimension name & Description\tabularnewline\midrule \endhead +\bottomrule\endfoot +\mathfontdimen{Script\-Percent\-Scale\-Down} +{Percentage of scaling down for script level 1. Suggested value: 80\%.} +\mathfontdimen{Script\-Script\-Percent\-Scale\-Down} +{Percentage of scaling down for script level 2 (Script\-Script). Suggested value: 60\%.} +\mathfontdimen{Delimited\-Sub\-Formula\-Min\-Height} +{Minimum height required for a delimited expression to be treated as a subformula. Suggested value: normal line height\,×\,1.5.} +\mathfontdimen{Display\-Operator\-Min\-Height} +{Minimum height of n-ary operators (such as integral and summation) for formulas in display mode.} +\mathfontdimen{Math\-Leading} +{White space to be left between math formulas to ensure proper line spacing. For example, for applications that treat line gap as a part of line ascender, formulas with ink going above (os2.sTypoAscender + os2.sTypoLineGap – MathLeading) or with ink going below os2.sTypoDescender will result in increasing line height.} +\mathfontdimen{Axis\-Height} +{Axis height of the font. } +\mathfontdimen{Accent\-Base\-Height} +{Maximum (ink) height of accent base that does not require raising the accents. Suggested: x-height of the font (os2.sxHeight) plus any possible overshots. } +\mathfontdimen{Flattened\-Accent\-Base\-Height} +{Maximum (ink) height of accent base that does not require flattening the accents. Suggested: cap height of the font (os2.sCapHeight).} +\mathfontdimen{Subscript\-Shift\-Down} +{The standard shift down applied to subscript elements. Positive for moving in the downward direction. Suggested: os2.ySubscriptYOffset.} +\mathfontdimen{Subscript\-Top\-Max} +{Maximum allowed height of the (ink) top of subscripts that does not require moving subscripts further down. Suggested: /5 x-height.} +\mathfontdimen{Subscript\-Baseline\-Drop\-Min} +{Minimum allowed drop of the baseline of subscripts relative to the (ink) bottom of the base. Checked for bases that are treated as a box or extended shape. Positive for subscript baseline dropped below the base bottom.} +\mathfontdimen{Superscript\-Shift\-Up} +{Standard shift up applied to superscript elements. Suggested: os2.ySuperscriptYOffset.} +\mathfontdimen{Superscript\-Shift\-Up\-Cramped} +{Standard shift of superscripts relative to the base, in cramped style.} +\mathfontdimen{Superscript\-Bottom\-Min} +{Minimum allowed height of the (ink) bottom of superscripts that does not require moving subscripts further up. Suggested: ¼ x-height.} +\mathfontdimen{Superscript\-Baseline\-Drop\-Max} +{Maximum allowed drop of the baseline of superscripts relative to the (ink) top of the base. Checked for bases that are treated as a box or extended shape. Positive for superscript baseline below the base top.} +\mathfontdimen{Sub\-Superscript\-Gap\-Min} +{Minimum gap between the superscript and subscript ink. Suggested: 4×default rule thickness.} +\mathfontdimen{Superscript\-Bottom\-Max\-With\-Subscript} +{The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down. +Suggested: /5 x-height.} +\mathfontdimen{Space\-After\-Script} +{Extra white space to be added after each subscript and superscript. Suggested: 0.5pt for a 12 pt font.} +\mathfontdimen{Upper\-Limit\-Gap\-Min} +{Minimum gap between the (ink) bottom of the upper limit, and the (ink) top of the base operator. } +\mathfontdimen{Upper\-Limit\-Baseline\-Rise\-Min} +{Minimum distance between baseline of upper limit and (ink) top of the base operator.} +\mathfontdimen{Lower\-Limit\-Gap\-Min} +{Minimum gap between (ink) top of the lower limit, and (ink) bottom of the base operator.} +\mathfontdimen{Lower\-Limit\-Baseline\-Drop\-Min} +{Minimum distance between baseline of the lower limit and (ink) bottom of the base operator.} +\mathfontdimen{Stack\-Top\-Shift\-Up} +{Standard shift up applied to the top element of a stack.} +\mathfontdimen{Stack\-Top\-Display\-Style\-Shift\-Up} +{Standard shift up applied to the top element of a stack in display style.} +\mathfontdimen{Stack\-Bottom\-Shift\-Down} +{Standard shift down applied to the bottom element of a stack. Positive for moving in the downward direction.} +\mathfontdimen{Stack\-Bottom\-Display\-Style\-Shift\-Down} +{Standard shift down applied to the bottom element of a stack in display style. Positive for moving in the downward direction.} +\mathfontdimen{Stack\-Gap\-Min} +{Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element. Suggested: 3×default rule thickness.} +\mathfontdimen{Stack\-Display\-Style\-Gap\-Min} +{Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element in display style. Suggested: 7×default rule thickness.} +\mathfontdimen{Stretch\-Stack\-Top\-Shift\-Up} +{Standard shift up applied to the top element of the stretch stack.} +\mathfontdimen{Stretch\-Stack\-Bottom\-Shift\-Down} +{Standard shift down applied to the bottom element of the stretch stack. Positive for moving in the downward direction.} +\mathfontdimen{Stretch\-Stack\-Gap\-Above\-Min} +{Minimum gap between the ink of the stretched element, and the (ink) bottom of the element above. Suggested: Upper\-Limit\-Gap\-Min} +\mathfontdimen{Stretch\-Stack\-Gap\-Below\-Min} +{Minimum gap between the ink of the stretched element, and the (ink) top of the element below. Suggested: Lower\-Limit\-Gap\-Min.} +\mathfontdimen{Fraction\-Numerator\-Shift\-Up} +{Standard shift up applied to the numerator. } +\mathfontdimen{Fraction\-Numerator\-Display\-Style\-Shift\-Up} +{Standard shift up applied to the numerator in display style. Suggested: Stack\-Top\-Display\-Style\-Shift\-Up.} +\mathfontdimen{Fraction\-Denominator\-Shift\-Down} +{Standard shift down applied to the denominator. Positive for moving in the downward direction.} +\mathfontdimen{Fraction\-Denominator\-Display\-Style\-Shift\-Down} +{Standard shift down applied to the denominator in display style. Positive for moving in the downward direction. Suggested: Stack\-Bottom\-Display\-Style\-Shift\-Down.} +\mathfontdimen{Fraction\-Numerator\-Gap\-Min} +{Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar. Suggested: default rule thickness} +\mathfontdimen{Fraction\-Num\-Display\-Style\-Gap\-Min} +{Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar in display style. Suggested: 3×default rule thickness.} +\mathfontdimen{Fraction\-Rule\-Thickness} +{Thickness of the fraction bar. Suggested: default rule thickness.} +\mathfontdimen{Fraction\-Denominator\-Gap\-Min} +{Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar. Suggested: default rule thickness} +\mathfontdimen{Fraction\-Denom\-Display\-Style\-Gap\-Min} +{Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar in display style. Suggested: 3×default rule thickness.} +\mathfontdimen{Skewed\-Fraction\-Horizontal\-Gap} +{Horizontal distance between the top and bottom elements of a skewed fraction.} +\mathfontdimen{Skewed\-Fraction\-Vertical\-Gap} +{Vertical distance between the ink of the top and bottom elements of a skewed fraction.} +\mathfontdimen{Overbar\-Vertical\-Gap} +{Distance between the overbar and the (ink) top of he base. Suggested: 3×default rule thickness.} +\mathfontdimen{Overbar\-Rule\-Thickness} +{Thickness of overbar. Suggested: default rule thickness.} +\mathfontdimen{Overbar\-Extra\-Ascender} +{Extra white space reserved above the overbar. Suggested: default rule thickness.} +\mathfontdimen{Underbar\-Vertical\-Gap} +{Distance between underbar and (ink) bottom of the base. Suggested: 3×default rule thickness.} +\mathfontdimen{Underbar\-Rule\-Thickness} +{Thickness of underbar. Suggested: default rule thickness.} +\mathfontdimen{Underbar\-Extra\-Descender} +{Extra white space reserved below the underbar. Always positive. Suggested: default rule thickness.} +\mathfontdimen{Radical\-Vertical\-Gap} +{Space between the (ink) top of the expression and the bar over it. Suggested: 1¼ default rule thickness.} +\mathfontdimen{Radical\-Display\-Style\-Vertical\-Gap} +{Space between the (ink) top of the expression and the bar over it. Suggested: default rule thickness + ¼ x-height. } +\mathfontdimen{Radical\-Rule\-Thickness} +{Thickness of the radical rule. This is the thickness of the rule in designed or constructed radical signs. Suggested: default rule thickness.} +\mathfontdimen{Radical\-Extra\-Ascender} +{Extra white space reserved above the radical. Suggested: Radical\-Rule\-Thickness.} +\mathfontdimen{Radical\-Kern\-Before\-Degree} +{Extra horizontal kern before the degree of a radical, if such is present. Suggested: 5/18 of em.} +\mathfontdimen{Radical\-Kern\-After\-Degree} +{Negative kern after the degree of a radical, if such is present. Suggested: −10/18 of em.} +\mathfontdimen{Radical\-Degree\-Bottom\-Raise\-Percent} +{Height of the bottom of the radical degree, if such is present, in proportion to the ascender of the radical sign. Suggested: 60\%.} +\end{longtable} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex b/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex new file mode 100644 index 00000000000..645664b4bde --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex @@ -0,0 +1,84 @@ +%%^^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 {\font\1=cmmi10 at 10pt\1 ABC}\,–\,{\font\1=cmmi10 at 10pt\1 xyz}, {\font\1=eufm10 at 10pt\1 ABC}\,–\,{\font\1=cmsy10 at 10pt\1 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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex b/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex new file mode 100644 index 00000000000..b86ae1e33fd --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex @@ -0,0 +1,38 @@ +%%^^A%% um-doc-stixextract.tex -- part of UNICODE-MATH <wspr.io/unicode-math> + +\section{\STIX\ table data extraction}\label{part:awk} + +The source for the \TeX\ names for the very large number of mathematical +glyphs are provided via Barbara Beeton's table file for the \STIX\ project +(|ams.org/STIX|). A version is located at +|http://www.ams.org/STIX/bnb/stix-tbl.asc| +but check |http://www.ams.org/STIX/| for more up-to-date info. + +This table is converted into a form suitable for reading by \TeX. +A single file is produced containing all (more than 3298) symbols. +Future optimisations might include generating various (possibly overlapping) subsets +so not all definitions must be read just to redefine a small range of symbols. +Performance for now seems to be acceptable without such measures. + +This file is currently developed outside this DTX file. It will be +incorporated when the final version is ready. (I know this is not how +things are supposed to work!) + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex b/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex new file mode 100644 index 00000000000..31a01bd7927 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex @@ -0,0 +1,129 @@ +%%^^A%% um-doc-style.tex -- part of UNICODE-MATH <wspr.io/unicode-math> + +\makeatletter +\input{unicode-math.dtx} +\GetFileInfo{unicode-math.dtx} +\let\umfiledate\filedate +\let\umfileversion\fileversion + +\CheckSum{0} +\EnableCrossrefs +\CodelineIndex +\setcounter{IndexColumns}{2} + +\usepackage[svgnames]{xcolor} +\usepackage[inline]{enumitem} +\usepackage{array,booktabs,calc,enumitem,fancyvrb,graphicx,ifthen,longtable,refstyle,subfig,topcapt,url,varioref,underscore} +\setcounter{LTchunksize}{100} +\usepackage[slash-delimiter=frac,nabla=literal]{unicode-math} +\usepackage{metalogo,hologo} + +\fvset{fontsize=\small,xleftmargin=2em} +\usepackage[it]{titlesec} + +\setmainfont{texgyrepagella}% + [ + Extension = .otf , + UprightFont = *-regular , + ItalicFont = *-italic , + BoldFont = *-bold , + BoldItalicFont = *-bolditalic , + ] +\setsansfont{Iwona}% + [ + Scale=MatchLowercase, + Extension = .otf, + UprightFont = *-Regular, + ItalicFont = *-Italic, + BoldFont = *-Bold, + BoldItalicFont = *-BoldItalic, + ] +\setmonofont{Inconsolatazi4-Regular.otf}% + [ + Scale=MatchLowercase, + BoldFont=Inconsolatazi4-Bold.otf + ] + +\setmathfont{texgyrepagella-math.otf} +\setmathfont[version=xits]{xits-math.otf} +\newfontface\umfont{xits-math.otf} + +\usepackage{hypdoc} +\hypersetup{linktocpage} + +% work around some issue turning | into "j" inside mathsf in the definition of \Module: +% (also prettify) +\def\Module#1{{\footnotesize\color{red}$\langle$\texttt{#1}$\rangle$}} + +\linespread{1.1} +\frenchspacing + +\definecolor{niceblue}{rgb}{0.2,0.4,0.8} + +\def\theCodelineNo{\textcolor{niceblue}{\sffamily\tiny\arabic{CodelineNo}}} + +\newcommand*\name[1]{{#1}} +\newcommand*\pkg[1]{\textsf{#1}} +\newcommand*\feat[1]{\texttt{#1}} +\newcommand*\opt[1]{\texttt{#1}} + +\newcommand*\note[1]{\unskip\footnote{#1}} + +\let\latin\textit +\def\eg{\latin{e.g.}} +\def\Eg{\latin{E.g.}} +\def\ie{\latin{i.e.}} +\def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}} + +\def\STIX{\textsc{stix}} +\def\MacOSX{Mac~OS~X} +\def\ascii{\textsc{ascii}} +\def\OMEGA{Omega} + +\newcounter{argument} + +\makeatletter +\g@addto@macro\endmacro{\setcounter{argument}{0}} +\makeatother + +\newcommand*\darg[1]{% + \stepcounter{argument}% + {\ttfamily\char`\#\theargument~:~}#1\par\noindent\ignorespaces +} +\newcommand*\doarg[1]{% + \stepcounter{argument}% + {\ttfamily\makebox[0pt][r]{[}\char`\#\theargument]:~}#1\par\noindent\ignorespaces +} + +\newcommand\codeline[1]{\par{\centering#1\par\noindent}\ignorespaces} + +\newcommand\unichar[1]{\textsc{u}+\texttt{\small#1}} + +\setlength\parindent{2em} + +\def \MakePrivateLetters {% + \catcode`\@=11\relax + \catcode`\_=11\relax + \catcode`\:=11\relax +} + +\makeatother + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/um-doc.tex b/Master/texmf-dist/source/latex/unicode-math/um-doc.tex new file mode 100644 index 00000000000..7e28f17c9f4 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/um-doc.tex @@ -0,0 +1,1137 @@ +%%^^A%% um-doc.tex -- part of UNICODE-MATH <wspr.io/unicode-math> + +\begin{abstract} +\noindent +This document describes the \pkg{unicode-math} package, which is +intended as an implementation of Unicode +maths for \LaTeX\ using the \XeTeX\ and Lua\TeX\ typesetting engines. +With this package, changing maths fonts is as easy as changing +text fonts --- and there are more and more maths fonts appearing now. +Maths input can also be simplified with Unicode since literal glyphs may be +entered instead of control sequences in your document source. + +The package provides support for both \XeTeX\ and Lua\TeX. The different +engines provide differing levels of support for Unicode maths. +Please let us know of any troubles. + +Alongside this documentation file, you should be able to find a minimal +example demonstrating the use of the package, +`\texttt{unimath-example.ltx}'. It also comes with a separate document, +`\texttt{unimath-symbols.pdf}', +containing a complete listing of mathematical symbols defined by +\pkg{unicode-math}, including comparisons between different fonts. + +Finally, while the STIX fonts may be used with this package, accessing +their alphabets in their `private user area' is not yet supported. +(Of these additional alphabets there is a separate caligraphic design +distinct to the script design already included.) +Better support for the STIX fonts is planned for an upcoming revision of the +package after any problems have been ironed out with the initial version. + +\end{abstract} + +\newpage +\tableofcontents + +\clearpage +\section{Introduction} + +This document describes the \pkg{unicode-math} package, which is an +\emph{experimental} implementation of a macro to Unicode glyph encoding for +mathematical characters. + +Users who desire to specify maths alphabets only (Greek and Latin letters, +and Arabic numerals) +may wish to use Andrew Moschou's \pkg{mathspec} package instead. +(\XeTeX-only at time of writing.) + +\section{Acknowledgements} + +Many thanks to: +Microsoft for developing the mathematics extension to OpenType as part of +Microsoft Office~2007; +Jonathan Kew for implementing Unicode math support in \XeTeX; +Taco Hoekwater for implementing Unicode math support in \LuaTeX; +Barbara Beeton for her prodigious effort compiling the definitive list of Unicode math +glyphs and their \LaTeX\ names (inventing them where necessary), and also +for her thoughtful replies to my sometimes incessant questions; +Philipp Stephani for extending the package to support \LuaTeX. +Ross Moore and Chris Rowley have provided moral and technical support +from the very early days with great insight into the issues we face trying +to extend and use \TeX\ in the future. +Apostolos Syropoulos, Joel Salomon, Khaled Hosny, and Mariusz Wodzicki +have been fantastic beta testers. + +\section{Getting started} + +Load \pkg{unicode-math} as a regular \LaTeX\ package. It should be loaded +after any other maths or font-related package in case it needs to overwrite +their definitions. Here's an example using the filename syntax to load the \TeX\ Gyre Pagella Math font: (this works for both \XeLaTeX\ and \LuaLaTeX) +\begin{Verbatim} +\usepackage{amsmath} % if desired +\usepackage{unicode-math} +\setmathfont{texgyrepagella-math.otf} +\end{Verbatim} + +Once the package is loaded, traditional TFM-based maths fonts are no longer supported; +you can only switch to a different OpenType maths font using the \cs{setmathfont} command. +If you do not load an OpenType maths font before |\begin{document}|, Latin Modern Math (see above) will be loaded automatically. + +\subsection{New commands} +\LaTeX, since the first version of \LaTeXe, changed the math group +selection from, say, |{\bf x}| to |\mathbf{x}|. It introduced commands +such as |\mathbf|, |\mathit|, |\mathsf|, |\mathtt| and |\mathcal|, +besides |\mathnormal|. This was not only done to maintain the analogy +with |\textbf|, |\textit| and so on, but with the precise purpose of +loading the needed math groups (or math families) on demand and not +allocating them if not required by the document. + +The introduction of \pkg{unicode-math} posed new problems. For +instance, there is a big difference between say |fit| as an operator +name in boldface type and the product of three boldface variables. +With legacy \TeX{} engines, |\mathbf{fit}| would use a ligature and +the same would happen with the input |\mathbf{f}\mathbf{i}\mathbf{t}|. +For the latter case, the user should probably use |\mathbf{f\/}|. + +However, there is another important point from a \emph{conceptual} +point of view. A boldface variable name should be printed using the +\emph{math font}, whereas a boldface operator name should be printed +using the \emph{text font}. OpenType math fonts make this distinction +feasible, because they contain several math alphabets. Of course a +boldface text~`x' will not differ much (or at all) from a boldface +math~`x', but this is not the point: they \emph{should} be considered +different, because the former is |U+0078| in Unicode, the latter is +|U+1D431|. + +When discussing the matter, it soon appeared clear that \emph{two} +different commands are needed: one for using text boldface in math, +one for using math boldface. Only the document's author can know +whether one or the other is needed. The decision was to split off +the two meanings by using either |\mathbf| (for the boldface text font +in math) or |\symbf| (for the bold math font). + +To be more detailed, most alphabet commands are provided with the +\cs{math...} prefix synonyms, but there are five `legacy' font alphabets +that intentionally behave somewhat different. These are \cs{mathup}, +\cs{mathit}, \cs{mathbf}, \cs{mathsf}, and \cs{mathtt}. (N.B.: +\cs{mathrm} is defined as a synonym for \cs{mathup}, but the latter is +prefered as it is a script-agnostic term.) + +The \cs{symbf} command switches to single-letter mathematical symbols +(generally within the same OpenType font). The \cs{mathbf} command +switches to a text font that is set up to behave correctly in +mathematics, and should be used for multi-letter identifiers. These +could be denoted `text math alphabets'; further details are discussed +in \secref{mathselect}. Additional similar `text math alphabet' +commands can be defined using the \cs{setmathfontface} command +discussed in \secref{mathselect}. To control the behaviour of the +default text math alphabet commands to behave in a +backwards-compatible mode, see the package options described in +\secref{textmathlegacy}. + +\begin{table}\centering + \topcaption{New \pkg{unicode-math} commands.} + \tablabel{symvsmath} + \begin{tabular}{lll} + \toprule + \pkg{unicode-math} command & Synonym \\ + \midrule + |\symup| & \\ + |\symit| & \\ + |\symbf| & \\ + |\symsf| & \\ + |\symtt| & \\ + \midrule + |\symnormal| & |\mathnormal| \\ + |\symliteral| & \\ + |\symbfup| & |\mathbfup| \\ + |\symbfit| & |\mathbfit| \\ + |\symsfup| & |\mathsfup| \\ + |\symsfit| & |\mathsfit| \\ + |\symbfsfup| & |\mathbfsfup| \\ + |\symbfsfit| & |\mathbfsfit| \\ + |\symbfsf| & |\mathbfsf| \\ + |\symbb| & |\mathbb| \\ + |\symbbit| & |\mathbbit| \\ + |\symscr| & |\mathscr| \\ + |\symbfscr| & |\mathbfscr| \\ + |\symcal| & |\mathcal| \\ + |\symbfcal| & |\mathbfcal| \\ + |\symfrak| & |\mathfrak| \\ + |\symbffrak| & |\mathbffrak| \\ + \bottomrule + \end{tabular} +\end{table} + +Thus \pkg{unicode-math} provides a number of commands (such as +|\symbfsf|) to select specific `symbol alphabets' within the unicode +maths font, with usage, e.g., |$\symbfsf{g}$|${}\to\symbfsf{g}$. The +full listing is shown in \Tabref{symvsmath}. For backwards +compatibility, many of these are also defined with `familiar' synonyms +such as |\mathbfsf|. However, where possible the `sym' prefix +commands should be preferred, as certain synonyms may become +deprecated in time. The |\symliteral| command is described in +\secref{math-style}. + + + +\subsection{Package options} +Package options may be set when the package as loaded or at any later +stage with the \cs{unimathsetup} command. Therefore, the following two +examples are equivalent: +\begin{Verbatim} +\usepackage[math-style=TeX]{unicode-math} +% OR +\usepackage{unicode-math} +\unimathsetup{math-style=TeX} +\end{Verbatim} +Note, however, that some package options affects how maths is initialised +and changing an option such as |math-style| will not take effect until a +new maths font is set up. + +Package options may \emph{also} be used when declaring new maths fonts, +passed via options to the \cs{setmathfont} command. +Therefore, the following two examples are equivalent: +\begin{Verbatim} +\unimathsetup{math-style=TeX} +\setmathfont{Cambria Math} +% OR +\setmathfont{Cambria Math}[math-style=TeX] +\end{Verbatim} + +A summary list of package options is shown in \tabref{pkgopt}. +See following sections for more information. + +\begin{table}\centering + \topcaption{Package options.} + \tablabel{pkgopt} + \begin{tabular}{lll} + \toprule + Option & Description & See\dots \\ + \midrule + |math-style| & Style of letters & \secref{math-style} \\ + |bold-style| & Style of bold letters & \secref{bold-style} \\ + |sans-style| & Style of sans serif letters & \secref{sans-style} \\ + |nabla| & Style of the nabla symbol & \secref{nabla} \\ + |partial| & Style of the partial symbol & \secref{partial} \\ + |colon| & Behaviour of \cs{colon} & \secref{colon} \\ + |slash-delimiter| & Glyph to use for `stretchy' slash & \secref{slash-delimiter} \\ + \bottomrule + \end{tabular} +\end{table} + + +\section{Unicode maths font setup} + +In the ideal case, a single Unicode font will contain all maths glyphs we +need. The file |unicode-math-table.tex| (based on Barbara Beeton's \STIX\ table) +provides the mapping between Unicode +maths glyphs and macro names (all 3298 — or however many — of them!). A +single command +\codeline{\cmd\setmathfont\marg{font name}\oarg{font features}} +implements this for every every symbol and alphabetic variant. +That means |x| to $x$, |\xi| to $\xi$, |\leq| to $\leq$, etc., |\symscr{H}| +to $\symscr{H}$ and so on, all for Unicode glyphs within a single font. + +This package deals well with Unicode characters for maths +input. This includes using literal Greek letters in formulae, +resolving to upright or italic depending on preference. + +Font features specific to \pkg{unicode-math} are shown in \tabref{mathfontfeatures}. +Package options (see \tabref{pkgopt}) may also be used. +Other \pkg{fontspec} features are also valid. + +\begin{table}\centering + \topcaption{Maths font options.} + \tablabel{mathfontfeatures} + \begin{tabular}{lll} + \toprule + Option & Description & See\dots \\ + \midrule + |range| & Style of letters & \secref{range} \\ + |script-font| & Font to use for sub- and super-scripts & \secref{sscript} \\ + |script-features| & Font features for sub- and super-scripts & \secref{sscript} \\ + |sscript-font| & Font to use for nested sub- and super-scripts & \secref{sscript} \\ + |sscript-features| & Font features for nested sub- and super-scripts & \secref{sscript} \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{Using multiple fonts} +\seclabel{range} + +There will probably be few cases where a single Unicode maths font suffices +(simply due to glyph coverage). The \STIX\ font comes to mind as a +possible exception. It will therefore be necessary to delegate specific +Unicode ranges of glyphs to separate fonts: + \codeline{\cmd\setmathfont\marg{font name}|[range=|\meta{unicode range}|,|\meta{font features}|]|} +where \meta{unicode range} is a comma-separated list of Unicode slot numbers and ranges such as |{"27D0-"27EB,"27FF,"295B-"297F}|. +Note that \TeX's syntax for accessing the slot number of a character, such as |`\+|, will also work here. + +You may also use the macro for accessing the glyph, such as \cs{int}, or whole collection of symbols with the same math type, such as \cs{mathopen}, or complete math styles such as \cs{symbb}. +(Only numerical slots, however, can be used in ranged declarations.) + +\subsubsection{Control over alphabet ranges} + +As discussed earlier, Unicode mathematics consists of a number of `alphabet styles' within a single font. In \pkg{unicode-math}, these ranges are indicated with the following (hopefully self-explanatory) labels: +\begin{quote}\ttfamily +\ExplSyntaxOn +\clist_use:Nn \g__um_named_ranges_clist {\,,\,~} +\ExplSyntaxOff +\end{quote} +Fonts can be selected for specified ranges only using the following syntax, in which case all other maths font setup remains untouched: +\begin{itemize} +\item |[range=bb]| to use the font for `|bb|' letters only. +\item |[range=bfsfit/{greek,Greek}]| for Greek lowercase and uppercase only (also with |latin|, |Latin|, |num| as possible options for Latin lower-/upper-case and numbers, resp.). +\item |[range=up->sfup]| to map to different output styles. +\end{itemize} + +Note that `meta-styles' such as `|bf|' and `|sf|' are not included here since they are context dependent. Use |[range=bfup]| and |[range=bfit]| to effect changes to the particular ranges selected by `|bf|' (and similarly for `|sf|'). + +If a particular math style is not defined in the font, we fall back onto the lower-base plane (i.e., `upright') glyphs. +Therefore, to use an \ascii-encoded fractur font, for example, write +\begin{Verbatim} + \setmathfont{SomeFracturFont}[range=frak] +\end{Verbatim} +and because the math plane fractur glyphs will be missing, \pkg{unicode-math} will know to use the \ascii\ ones instead. +If necessary this behaviour can be forced with |[range=frak->up]|, since the `|up|' range corresponds to \ascii\ letters. + +%If you wanted to swap the maths symbols with sans serif forms, it would be possible to write |[range={up->sfup,it->sfit}]|. +%Note, however, that at present Unicode does not encode glyphs for sans serif Greek (\tabref{mathalphabets}). + +Users of the impressive Minion Math fonts (commercial) may use remapping to access the bold glyphs using: +\begin{Verbatim} + \setmathfont{MinionMath-Regular.otf} + \setmathfont{MinionMath-Bold.otf}[range={bfup->up,bfit->it}] +\end{Verbatim} +To set up the complete range of optical sizes for these fonts, a font declaration such as the following may be used: (adjust may be desired according to the font size of the document) +\begin{Verbatim} +\setmathfont{Minion Math}[ + SizeFeatures = { + {Size = -6.01, Font = MinionMath-Tiny}, + {Size = 6.01-8.41, Font = MinionMath-Capt}, + {Size = 8.41-13.01, Font = MinionMath-Regular}, + {Size = 13.01-19.91, Font = MinionMath-Subh}, + {Size = 19.91-, Font = MinionMath-Disp} + }] + +\setmathfont{Minion Math}[range = {bfup->up,bfit->it}, + SizeFeatures = { + {Size = -6.01, Font = MinionMath-BoldTiny}, + {Size = 6.01-8.41, Font = MinionMath-BoldCapt}, + {Size = 8.41-13.01, Font = MinionMath-Bold}, + {Size = 13.01-19.91, Font = MinionMath-BoldSubh}, + {Size = 19.91-, Font = MinionMath-BoldDisp} + }] +\end{Verbatim} +\textbf{v0.8:} Note that in previous versions of \pkg{unicode-math}, these features were labelled |[range=\mathbb]| and so on. This old syntax is still supported for backwards compatibility, but is now discouraged. + + +\subsection{Script and scriptscript fonts/features} +\seclabel{sscript} + +Cambria Math uses OpenType font features to activate smaller optical sizes +for scriptsize and scriptscriptsize symbols (the $B$ and $C$, respectively, +in $A_{B_C}$). +Other typefaces (such as Minion Math) may use entirely separate font files. + +The features |script-font| and |sscript-font| allow alternate fonts to be +selected for the script and scriptscript sizes, and |script-features| and +|sscript-features| to apply different OpenType features to them. + +By default |script-features| is defined as |Style=MathScript| and |sscript-features| is |Style=MathScriptScript|. +These correspond to the two levels of OpenType's |ssty| feature tag. +If the |(s)script-features| options are specified manually, you must +additionally specify the |Style| options as above. + + +\subsection{Maths `versions'} + +\LaTeX\ uses a concept known as `maths versions' to switch math fonts +mid-document. +This is useful because it is more efficient than loading a complete maths +font from scratch every time---especially with thousands of glyphs in the case of Unicode maths! +The canonical example for maths versions is to select a `bold' maths font +which might be suitable for section headings, say. +(Not everyone agrees with this typesetting choice, though; be careful.) + +To select a new maths font in a particular version, use the syntax + \codeline{\cmd\setmathfont\marg{font name}|[version=|\meta{version name}|,|\meta{font features}|]|} +and to switch between maths versions mid-document use the standard \LaTeX\ command +\cmd\mathversion\marg{version name}. + + +\subsection{Legacy maths `alphabet' commands} +\seclabel{mathselect} + +\LaTeX\ traditionally uses \cs{DeclareMathAlphabet} and \cs{SetMathAlphabet} to define document commands such as \cs{mathit}, \cs{mathbf}, and so on. +While these commands can still be used, \pkg{unicode-math} defines a wrapper command to assist with the creation of new such maths alphabet commands. +This command is known as \cs{setmathface} in symmetry with \pkg{fontspec}'s \cs{newfontface} command; it takes syntax: +\begin{quote} + \cmd\setmathfontface\meta{command}\marg{font name}|[|\meta{font features}|]| + + \makebox[0pt][l]{\cmd\setmathfontface\meta{command}\marg{font name}|[||version=|\meta{version name}|,|\meta{font features}|]|} +\end{quote} +For example, if you want to define a new legacy maths alphabet font \cs{mathittt}: +\begin{verbatim} + \setmathfontface\mathittt{texgyrecursor-italic.otf} + ... + $\mathittt{foo} = \mathittt{a} + \mathittt{b}$ +\end{verbatim} + + +\subsubsection{Default `text math' fonts} + +The five `text math' fonts, discussed above, are: \cs{mathrm}, \cs{mathbf}, \cs{mathit}, \cs{mathsf}, and \cs{mathtt}. +These commands are also defined with their original definition under synonyms \cs{mathtextrm}, \cs{mathtextbf}, and so on. + +When selecting document fonts using \pkg{fontspec} commands such as \cs{setmainfont}, \pkg{unicode-math} inserts some additional code into \pkg{fontspec} that keeps the current default fonts `in sync' with their corresponding \cs{mathrm} commands, etc. + +For example, in standard \LaTeX, \cs{mathsf} doesn't change even if the main document font is changed using |\renewcommand\sfdefault{...}|. With \pkg{unicode-math} loaded, after writing |\setsansfont{Helvetica}|, \cs{mathsf} will now be set in Helvetica. + +If the \cs{mathsf} font is set explicitly at any time in the preamble, this `auto-following' does not occur. The legacy math font switches can be defined either with commands defined by \pkg{fontspec} (|\setmathrm|, |\setmathsf|, etc.) or using the more general |\setmathfontface\mathsf| interface defined by \pkg{unicode-math}. + + +\subsubsection{Replacing `text math' fonts by symbols} +\seclabel{textmathlegacy} + +For certain types of documents that use legacy input syntax, it may be preferable to have |\mathbf| behave as if it were |\symbf| en masse (et cetera respectively). +A series of package options (\tabref{legacyfontswitch}) are provided to facilitate switching the definition of \cs{mathXYZ} for the five legacy text math font definitions. + +For example, if in a particular document |\mathbf| is used only for choosing symbols of vectors and matrices, a dedicated symbol font (|\symbf|) will produce better spacing and will better match the main math font. +In that case loading |unicode-math| with the |mathbf=sym| will achieve the desired result. + +\begin{table} + \centering + \topcaption{Maths text font configuration options. Note that \cs{mathup} and \cs{mathrm} are aliases of each other and cannot be configured separately.} + \tablabel{legacyfontswitch} + \begin{tabular}{lll} + \toprule + Defaults (from `text' font) & From `maths symbols' \\ + \midrule + |mathrm=text| & |mathrm=sym | \\ + |mathup=text|\rlap{$^\ast$} & |mathup=sym|{}\rlap{$^\ast$} \\ + |mathit=text| & |mathit=sym | \\ + |mathsf=text| & |mathsf=sym | \\ + |mathbf=text| & |mathbf=sym | \\ + |mathtt=text| & |mathtt=sym | \\ + \bottomrule + \end{tabular} +\end{table} + + +\subsubsection{Operator font} + +\LaTeX\ defines an internal command \cs{operator@font} for typesetting elements such as |\sin| and |\cos|. +This font is selected from the legacy |operators| NFSS `MathAlphabet', which is no longer relevant in the context of \pkg{unicode-math}. +By default, the \cs{operator@font} command is defined to switch to the \cs{mathrm} font. +You may now change these using the command: +\begin{Verbatim} +\setoperatorfont\mathit +\end{Verbatim} +Or, to select a \pkg{unicode-math} range: +\begin{Verbatim} +\setoperatorfont\symscr +\end{Verbatim} +\setoperatorfont\symscr +For example, after the latter above, |$\sin x$| will produce `$\sin x$'. + +\mathversion{normal} +\setoperatorfont\mathrm + + +\section{Maths input} + +\XeTeX's Unicode support allows maths input through two methods. Like +classical \TeX, macros such as \cmd\alpha, \cmd\sum, \cmd\pm, \cmd\leq, and +so on, provide verbose access to the entire repertoire of characters defined +by Unicode. The literal characters themselves may be used instead, for more +readable input files. + +\subsection{Math `style'} +\seclabel{math-style} + +Classically, \TeX\ uses italic lowercase Greek letters and \emph{upright} +uppercase Greek letters for variables in mathematics. This is contrary to +the \textsc{iso} standards of using italic forms for both upper- and lowercase. +Furthermore, in various historical contexts, often associated with French typesetting, it was common to use upright uppercase \emph{Latin} letters as well as upright +upper- and lowercase Greek, but italic lowercase latin. Finally, it is not unknown to use upright letters +for all characters, as seen in the Euler fonts. + +The \pkg{unicode-math} package accommodates these possibilities with the +option \opt{math-style} that takes one of four (case sensitive) arguments: +\opt{TeX}, \opt{ISO}, \opt{french}, or \opt{upright}.\footnote{Interface inspired by Walter Schmidt's \pkg{lucimatx} package.} +The \opt{math-style} options' effects are shown in brief in \tabref{math-style}. + +The philosophy behind the interface to the mathematical symbols +lies in \LaTeX's attempt of separating content and formatting. Because input +source text may come from a variety of places, the upright and +`mathematical' italic Latin and Greek alphabets are \emph{unified} from the +point of view of having a specified meaning in the source text. That is, to +get a mathematical ‘$x$’, either the \ascii\ (`keyboard') letter |x| may +be typed, or the actual Unicode character may be used. Similarly for Greek +letters. The upright or italic forms are then chosen based on the +|math-style| package option. + +If glyphs are desired that do not map as per the package option (for +example, an upright `g' is desired but typing |$g$| yields `$g$'), +\emph{markup} is required to specify this; to follow from the example: +|\symup{g}|. +Maths style commands such as \cmd\symup\ are detailed later. + +\paragraph{`Literal' interface} +Some may not like this convention of normalising their input. +For them, an upright |x| is an upright `x' and that's that. +(This will be the case when obtaining source text from copy/pasting PDF or +Microsoft Word documents, for example.) +For these users, the |literal| option to |math-style| will effect this behaviour. +The \cs{symliteral}\marg{syms} command can also be used, regardless of package setting, to force the style to match the literal input characters. +This is a `mirror' to \cs{symnormal}\marg{syms} (also alias \cs{mathnormal}) which `resets' the character mapping in its argument to that originally set up through package options. + +\begin{table} + \centering + \topcaption{Effects of the \opt{math-style} package option.} + \tablabel{math-style} + \begin{tabular}{@{}>{\ttfamily}lcc@{}} + \toprule + & \multicolumn{2}{c}{Example} \\ + \cmidrule(l){2-3} + \rmfamily Package option & Latin & Greek \\ + \midrule + math-style=ISO & $(a,z,B,X)$ & $\symit{(\alpha,\beta,\Gamma,\Xi)}$ \\ + math-style=TeX & $(a,z,B,X)$ & $(\symit\alpha,\symit\beta,\symup\Gamma,\symup\Xi)$ \\ + math-style=french & $(a,z,\symup B,\symup X)$ & $(\symup\alpha,\symup\beta,\symup\Gamma,\symup\Xi)$ \\ + math-style=upright & $(\symup a,\symup z,\symup B,\symup X)$ & $(\symup\alpha,\symup\beta,\symup\Gamma,\symup\Xi)$ \\ + \bottomrule + \end{tabular} +\end{table} + + +\subsection{Bold style} +\seclabel{bold-style} + +Similar as in the previous section, ISO standards differ somewhat to \TeX's +conventions (and classical typesetting) for `boldness' in mathematics. In +the past, it has been customary to use bold \emph{upright} letters to denote +things like vectors and matrices. For example, \( \symbfup{M} = +(\mitM_x,\mitM_y,\mitM_z) \). Presumably, this was due to the relatively +scarcity of bold italic fonts in the pre-digital typesetting era. +It has been suggested by some that \emph{italic} bold symbols should be used nowadays instead, but this practise is certainly not widespread. + +Bold Greek letters have simply been bold variant glyphs of their regular +weight, as in \( \mbfitxi = (\mitxi_\mitr,\mitxi_\mitphi,\mitxi_\mittheta) +\). +Confusingly, the syntax in \LaTeX\ traditionally has been different for obtaining `normal' bold symbols in Latin and Greek: \cmd\mathbf\ in the former (`$\symbfup{M}$'), and \cmd\bm\ (or +\cmd\boldsymbol, deprecated) in the latter (`$\mbfitxi$'). + +In \pkg{unicode-math}, the \cmd\symbf\ command works directly with both +Greek and Latin maths characters and depending on package option +either switches to upright for Latin letters (|bold-style=TeX|) as well or +keeps them italic (|bold-style=ISO|). +To match the package options for non-bold characters, with option +|bold-style=upright| all bold characters are upright, and +|bold-style=literal| does not change the upright/italic shape of the letter. +The \opt{bold-style} options' effects are shown in brief in \tabref{bold-style}. + +Upright and italic bold mathematical letters input as direct Unicode +characters are normalised with the same rules. For example, with +|bold-style=TeX|, a literal bold italic latin character will be typeset +upright. + +Note that \opt{bold-style} is independent of \opt{math-style}, although if +the former is not specified then matching defaults are chosen based on the +latter. + +\begin{table} + \centering + \topcaption{Effects of the \opt{bold-style} package option.} + \tablabel{bold-style} + \begin{tabular}{@{}>{\ttfamily}lcc@{}} + \toprule + & \multicolumn{2}{c}{Example} \\ + \cmidrule(l){2-3} + \rmfamily Package option & Latin & Greek \\ + \midrule + bold-style=ISO & $(\symbfit a, \symbfit z, \symbfit B, \symbfit X)$ & $(\symbfit\alpha, \symbfit\beta, \symbfit\Gamma, \symbfit\Xi)$ \\ + bold-style=TeX & $(\symbfup a,\symbfup z,\symbfup B,\symbfup X)$ & $(\symbfit\alpha, \symbfit\beta,\symbfup \Gamma,\symbfup \Xi)$ \\ + bold-style=upright & $(\symbfup a,\symbfup z,\symbfup B,\symbfup X)$ & $(\symbfup \alpha,\symbfup \beta,\symbfup \Gamma,\symbfup \Xi)$ \\ + \bottomrule + \end{tabular} +\end{table} + + +\subsection{Sans serif style} +\seclabel{sans-style} + +Unicode contains upright and italic, medium and bold mathematical style characters. +These may be explicitly selected with the \cs{mathsfup}, \cs{mathsfit}, \cs{mathbfsfup}, and \cs{mathbfsfit} +commands discussed in \secref{all-math-alphabets}. + +How should the generic \cs{mathsf} behave? Unlike bold, sans serif is used much more sparingly +in mathematics. I've seen recommendations to typeset tensors in sans serif italic +or sans serif italic bold (e.g., examples in the \pkg{isomath} and \pkg{mattens} packages). +But \LaTeX's \cs{mathsf} is \textsl{upright} sans serif. + +Therefore I reluctantly add the package options |[sans-style=upright]| and |[sans-style=italic]| to control the behaviour of \cs{mathsf}. +The |upright| style sets up the command to use upright sans serif, including Greek; +the |italic| style switches to using italic in both Latin and Greek. +In other words, this option simply changes the meaning of \cs{mathsf} to either \cs{mathsfup} or \cs{mathsfit}, respectively. +Please let me know if more granular control is necessary here. + +There is also a |[sans-style=literal]| setting, set automatically with |[math-style=literal]|, which retains the uprightness of the input characters used when selecting the sans serif output. + +\subsubsection{What about bold sans serif?} + +While you might want your bold upright and your sans serif italic, I don't believe you'd also want +your bold sans serif upright (or all vice versa, if that's even conceivable). Therefore, bold sans +serif follows from the setting for sans serif; it is completely independent of the setting for bold. + +In other words, \cs{mathbfsf} is either \cs{mathbfsfup} or \cs{mathbfsfit} based on |[sans-style=upright]| or |[sans-style=italic]|, respectively. And \texttt{[sans-style = literal]} causes \cs{mathbfsf} to retain the same italic or upright shape as the input, and turns it bold sans serif. + +N.B.: there is no medium-weight sans serif Greek range in Unicode. +Therefore, |\symsf{\alpha}| does not make sense (it produces `$\symsf{\alpha}$'), while |\symbfsf{\alpha}| gives `$\symbfsfup{\alpha}$' or `$\symbfsfit{\alpha}$' according to the |sans-style|. + +\subsection{All (the rest) of the mathematical styles} +\seclabel{all-math-alphabets} + +Unicode contains separate codepoints for most if not all variations of style +shape one may wish to use in mathematical notation. The complete list is shown +in \tabref{mathalphabets}. Some of these have been covered in the previous sections. + +The math font switching commands do not nest; therefore if you want +sans serif bold, you must write |\symbfsf{...}| rather than |\symbf{\symsf{...}}|. +This may change in the future. + +\begin{table} +\caption{Mathematical styles defined in Unicode. Black dots indicate an style exists in the font specified; blue dots indicate shapes that should always be taken from the upright font even in the italic style. See main text for description of \cs{mathbbit}.} +\tablabel{mathalphabets} +\centering +\def\Y{\textbullet} +\def\M{\textcolor[rgb]{0.5,0.5,1}{\textbullet}} +\begin{tabular}{@{} lll l ccc @{}} +\toprule +\multicolumn{3}{c}{Font} & & \multicolumn{3}{c}{Alphabet} \\ +\cmidrule(r){1-3} +\cmidrule(l){5-7} +Style & Shape & Series & Switch & Latin & Greek & Numerals \\ +\midrule +Serif & Upright & Normal & \cs{mathup} & \Y & \Y & \Y \\ + & & Bold & \cs{mathbfup} & \Y & \Y & \Y \\ + & Italic & Normal & \cs{mathit} & \Y & \Y & \M \\ + & & Bold & \cs{mathbfit} & \Y & \Y & \M \\ +Sans serif & Upright & Normal & \cs{mathsfup} & \Y & & \Y \\ + & Italic & Normal & \cs{mathsfit} & \Y & & \M \\ + & Upright & Bold & \cs{mathbfsfup} & \Y & \Y & \Y \\ + & Italic & Bold & \cs{mathbfsfit} & \Y & \Y & \M \\ +Typewriter & Upright & Normal & \cs{mathtt} & \Y & & \Y \\ +Double-struck & Upright & Normal & \cs{mathbb} & \Y & & \Y \\ + & Italic & Normal & \cs{mathbbit} & \Y & & \\ +Script & Upright & Normal & \cs{mathscr} & \Y & & \\ + & & Bold & \cs{mathbfscr} & \Y & & \\ +Fraktur & Upright & Normal & \cs{mathfrak} & \Y & & \\ + & & Bold & \cs{mathbffrac} & \Y & & \\ +\bottomrule +\end{tabular} +\end{table} + +\subsubsection{Double-struck} + +The double-struck style (also known as `blackboard bold') consists of +upright Latin letters $\{\symbb{a}$--$\symbb{z}$,$\symbb{A}$$\symbb{Z}\}$, +numerals $\symbb{0}$--$\symbb{9}$, summation symbol $\symbb\sum$, and four +Greek letters only: $\{\symbb{\gamma\pi\Gamma\Pi}\}$. + +While |\symbb{\sum}| does produce a double-struck summation symbol, +its limits aren't properly aligned. Therefore, +either the literal character or the control sequence \cs{Bbbsum} are +recommended instead. + +There are also five Latin \emph{italic} double-struck letters: $\symbbit{Ddeij}$. +These can be accessed (if not with their literal characters or control sequences) +with the \cs{mathbbit} style switch, but note that only those five letters +will give the expected output. + +\subsubsection{Caligraphic vs.\ Script variants} + +The Unicode maths encoding contains a style for `Script' letters, +and while by default \cs{mathcal} and \cs{mathscr} +are synonyms, there are some situations when a +separate `Caligraphic' style is needed as well. + +If a font contains alternate glyphs for a separat caligraphic style, +they can be selected explicitly as shown below. +This feature is currently only supported by the XITS~Math font, where +the caligraphic letters are accessed with the same glyph slots as the +script letters but with the first stylistic set feature (|ss01|) applied. +\begin{verbatim} + \setmathfont{xits-math.otf}[range={cal,bfcal},StylisticSet=1] +\end{verbatim} +An example is shown below. +\begin{quote} +\setmathfont{xits-math.otf}[range=scr] +\setmathfont{xits-math.otf}[range=cal,StylisticSet=1] +The Script style (\cs{mathscr}) in XITS Math is: $\symscr{ABCXYZ}$\par +The Caligraphic style (\cs{mathcal}) in XITS Math is: $\symcal{ABCXYZ}$ +\end{quote} + + +\subsection{Miscellanea} + +\subsubsection{Nabla} +\seclabel{nabla} + + The symbol $\nabla$ comes in the six forms shown in \tabref{nabla}. + We want an individual option to specify whether we want upright or italic + nabla by default (when either upright or italic nabla is used in the + source). \TeX\ classically uses an upright nabla, and \textsc{iso} + standards agree with this convention. + The package options |nabla=upright| and + |nabla=italic| switch between the two choices, and |nabla=literal| respects + the shape of the input character. This is then inherited + through \cmd\symbf; \cmd\symit\ and \cmd\symup\ can be used to force one + way or the other. + +|nabla=italic| is the default. |nabla=literal| is +activated automatically after |math-style=literal|. + +\begin{table} + \begin{minipage}[b]{0.49\textwidth} + \centering + \topcaption{The various forms of nabla.} + \tablabel{nabla} + \let \tmpshow\empty + \begin{tabular}{@{}llc@{}} + \toprule + \multicolumn{2}{@{}l}{Description} & Glyph + \\ \cmidrule(r){1-2}\cmidrule(l){3-3} + Upright & Serif & $\symup\nabla$ \\ + & Bold serif & $\symbfup\nabla$ \\ + & Bold sans & $\symbfsfup\nabla$ \\ + \cmidrule(lr){1-2}\cmidrule(lr){3-3} + Italic & Serif & $\symit\nabla$ \\ + & Bold serif & $\symbfit\nabla$ \\ + & Bold sans & $\symbfsfit\nabla$ \\ + \bottomrule + \end{tabular} + \end{minipage}\hfill + \begin{minipage}[b]{0.49\textwidth} + \centering + \topcaption{The partial differential.} + \tablabel{partial} + \begin{tabular}{@{}llc@{}} + \toprule + \multicolumn{2}{@{}l}{Description} & Glyph + \\ \cmidrule(r){1-2}\cmidrule(l){3-3} + Regular & Upright & $\symup\partial$ \\ + & Italic & $\symit\partial$ \\ + Bold & Upright & $\symbfup\partial$ \\ + & Italic & $\symbfit\partial$ \\ + Sans bold & Upright & $\symbfsfup\partial$ \\ + & Italic & $\symbfsfit\partial$ \\ + \bottomrule + \end{tabular} + \end{minipage} +\end{table} + + +\subsubsection{Partial} +\seclabel{partial} + +The same applies to the symbols \unichar{2202} partial differential and +\unichar{1D715} math italic partial differential. + +At time of writing, both the Cambria Math and STIX fonts display these +two glyphs in the same italic style, but this is hopefully a bug that will +be corrected in the future~--- the `plain' partial differential should +really have an upright shape. + +Use the |partial=upright| or |partial=italic| package options to specify +which one you would like, or |partial=literal| to have the same character +used in the output as was used for the input. +The default is (always, unless someone requests and +argues otherwise) |partial=italic|.\footnote{A good argument would revolve +around some international standards body recommending upright over italic. +I just don't have the time right now to look it up.} |partial=literal| +is activated following |math-style=literal|. + +See \tabref{partial} for the variations on the partial differential symbol. + + +\subsubsection{Primes} + +Primes ($x'$) may be input in several ways. You may use any combination +the \ascii\ straight quote (\texttt{\char`\'}) or the Unicode prime \unichar{2032} +($'$); when multiple primes occur next to each other, they chain +together to form double, triple, or quadruple primes if the font contains +pre-drawn glyphs. The individual prime glyphs are accessed, as usual, +with the \cs{prime} command, and the double-, triple-, and quadruple-prime +glyphs are available with \cs{dprime}, \cs{trprime}, and \cs{qprime}, +respectively. + +If the font does not contain the pre-drawn glyphs or more than four primes +are used, the single prime glyph is used multiple times with a negative +kern to get the spacing right. There is no user interface to adjust this +negative kern yet (because I haven't decided what it should look like); +if you need to, write something like this: +\begin{Verbatim} +\ExplSyntaxOn +\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 } +\ExplySyntaxOff +\end{Verbatim} +Backwards or reverse primes behave in exactly the same way; use the \ascii\ +back tick (\texttt{\char`\`}) or the Unicode reverse prime \unichar{2035} +({\umfont\char"2035}). +The command to access the backprime is \cs{backprime}, and +multiple backwards primes can accessed with \cs{backdprime}, +\cs{backtrprime}, and \cs{backqprime}. + +In all cases above, no error checking is performed if you attempt to +access a multi-prime glyph in a font that doesn't contain one. For this +reason, it may be safer to write |x''''| instead of |x\qprime| +in general. + +If you ever need to enter the straight quote |'| or the backtick |`| in +maths mode, these glyphs can be accessed with \cs{mathstraightquote} and +\cs{mathbacktick}. + +\subsubsection{Unicode subscripts and superscripts} + +You may, if you wish, use Unicode subscripts and superscripts in your +source document. For basic expressions, the use of these characters +can make the input more readable. +Adjacent sub- or super-scripts will be concatenated into a single +expression. + +The range of subscripts and superscripts supported by this package +are shown in \figref{superscripts,subscripts}. Please request more if +you think it is appropriate. + +\begin{figure}\centering +\fbox{\fontspec{CharisSILR.ttf}\Large +A +^^^^2070 ^^^^00b9 ^^^^00b2 ^^^^00b3 ^^^^2074 ^^^^2075 ^^^^2076 ^^^^2077 +^^^^2078 ^^^^2079 ^^^^207a ^^^^207b ^^^^207c ^^^^207d ^^^^207e ^^^^2071 +^^^^207f ^^^^207f ^^^^02b0 ^^^^02b2 ^^^^02b3 ^^^^02b7 ^^^^02b8 +Z} +\caption{ + The Unicode superscripts supported as input characters. + These are the literal glyphs from Charis SIL, + not the output seen when used for maths input. + The `A' and `Z' are to provide context for the size and + location of the superscript glyphs. +} +\figlabel{superscripts} +\end{figure} + +\begin{figure}\centering +\fbox{\fontspec{CharisSILR.ttf}\Large +A +^^^^2080 ^^^^2081 ^^^^2082 ^^^^2083 ^^^^2084 ^^^^2085 ^^^^2086 ^^^^2087 +^^^^2088 ^^^^2089 ^^^^208a ^^^^208b ^^^^208c ^^^^208d ^^^^208e ^^^^2090 +^^^^2091 ^^^^1d62 ^^^^2092 ^^^^1d63 ^^^^1d64 ^^^^1d65 ^^^^2093 ^^^^1d66 +^^^^1d67 ^^^^1d68 ^^^^1d69 ^^^^1d6a +Z} +\caption{ + The Unicode subscripts supported as input characters. + See note from \figref{superscripts}. +} +\figlabel{subscripts} +\end{figure} + +\subsubsection{Colon} +\seclabel{colon} + +The colon is one of the few confusing characters of Unicode maths. +In \TeX, \texttt{:} is defined as a colon with relation spacing: `$a:b$'. +While \cs{colon} is defined as a colon with punctuation spacing: `$a\colon b$'. + +In Unicode, \unichar{003A} {colon} is defined as a punctuation symbol, +while \unichar{2236} {ratio} is the colon-like symbol used in mathematics to denote +ratios and other things. + +This breaks the usual straightforward mapping from control sequence to Unicode input character +to (the same) Unicode glyph. + +To preserve input compatibility, we remap the \ascii\ input character `\texttt{:}' to \unichar{2236}. +Typing a literal \unichar{2236} char will result in the same output. +If \pkg{amsmath} is loaded, then the definition of \cs{colon} is inherited from there +(it looks like a punctuation colon with additional space around it). +Otherwise, \cs{colon} is made to output a colon with \cs{mathpunct} spacing. + +The package option |colon=literal| forces \ascii\ input `|:|' to be printed as \cs{mathcolon} instead. + + +\subsubsection{Slashes and backslashes} +\seclabel{slash-delimiter} + +There are several slash-like symbols defined in Unicode. The complete list is shown in \tabref{slashes}. + +\begin{table}\centering +\caption{Slashes and backslashes.} +\tablabel{slashes} +\begin{tabular}{@{}cl@{}cl@{}} +\toprule +Slot & Name & Glyph & Command \\ +\midrule +\unichar{002F} & \textsc{solidus} & \umfont \char"002F & \cs{slash} \\ +\unichar{2044} & \textsc{fraction slash} & \umfont \char"2044 & \cs{fracslash} \\ +\unichar{2215} & \textsc{division slash} & \umfont \char"2215 & \cs{divslash} \\ +\unichar{29F8} & \textsc{big solidus} & \umfont \char"29F8 & \cs{xsol} \\ +\midrule +\unichar{005C} & \textsc{reverse solidus} & \umfont \char"005C & \cs{backslash} \\ +\unichar{2216} & \textsc{set minus} & \umfont \char"2216 & \cs{smallsetminus} \\ +\unichar{29F5} & \textsc{reverse solidus operator}& \umfont \char"29F5 & \cs{setminus} \\ +\unichar{29F9} & \textsc{big reverse solidus} & \umfont \char"29F9 & \cs{xbsol} \\ +\bottomrule +\end{tabular} +\end{table} + +In regular \LaTeX\ we can write \cs{left}\cs{slash}\dots\cs{right}\cs{backslash} +and so on and obtain extensible delimiter-like symbols. Not all of the Unicode slashes +are suitable for this (and do not have the font support to do it). + +\paragraph{Slash} + +Of \unichar{2044} {fraction slash}, TR25 says that it is: +\begin{quote} +\dots used to build up simple fractions in running text\dots +however parsers of mathematical texts should be prepared to handle fraction slash +when it is received from other sources. +\end{quote} + +\unichar{2215} {division slash} should be used when division is represented +without a built-up fraction; $\pi\approx22/7$, for example. + +\unichar{29F8} {big solidus} is a `big operator' (like $\sum$). + +\paragraph{Backslash} + +The \unichar{005C} {reverse solidus} character \cs{backslash} is used for denoting +double cosets: $A\backslash B$. (So I'm led to believe.) +It may be used as a `stretchy' delimiter if supported by the font. + +MathML uses \unichar{2216} {set minus} like this: $A\smallsetminus B$.\footnote{\S4.4.5.11 \url{http://www.w3.org/TR/MathML3/}} +The \LaTeX\ command name \cs{smallsetminus} is used for backwards compatibility. + +Presumably, \unichar{29F5} {reverse solidus operator} is intended to +be used in a similar way, but it could also (perhaps?) be used to +represent `inverse division': $\pi\approx7\mathbin{\backslash}22$.^^A +\footnote{This is valid syntax in the Octave and Matlab programming languages, +in which it means matrix inverse pre-multiplication. I.e., $A\mathbin{\backslash} B\equiv A^{-1}B$.} +The \LaTeX\ name for this character is \cs{setminus}. + +Finally, \unichar{29F9} {big reverse solidus} is a `big operator' (like $\sum$). + +\paragraph{How to use all of these things} + +Unfortunately, font support for the above characters/glyphs is rather inconsistent. +In Cambria Math, the only slash that grows (say when writing +\[ +\left.\left[\begin{array}{cc} a & b \\ c & d\end{array}\right]\middle\slash + \left[\begin{array}{cc} 1 & 1 \\ 1 & 0\end{array}\right] \right.\quad ) +\] +is the \textsc{fraction slash}, which we just established above is +sort of only supposed to be used in text. + +Of the above characters, the following are allowed to be used after +\cs{left}, \cs{middle}, and \cs{right}: +\begin{itemize} +\item \cs{fracslash}; +\item \cs{slash}; and, +\item \cs{backslash} (the only reverse slash). +\end{itemize} + +However, we assume that there is only \emph{one} stretchy slash +in the font; this is assumed by default to be \unichar{002F} {solidus}. +Writing \cs{left/} or \cs{left}\cs{slash} or \cs{left}\cs{fracslash} +will all result in the same stretchy delimiter being used. + +The delimiter used can be changed with the |slash-delimiter| package option. +Allowed values are |ascii|, |frac|, and |div|, corresponding to the respective +Unicode slots. + +For example: as mentioned above, Cambria Math's stretchy slash is +\unichar{2044} {fraction slash}. When using Cambria Math, then +\pkg{unicode-math} should be loaded with the |slash-delimiter=frac| option. +(This should be a font option rather than a package option, but +it will change soon.) + + +\subsubsection{Growing and non-growing accents} +\seclabel{growing-accents} + +There are a few accents for which \TeX\ has both non-growing and growing +versions. Among these are \cs{hat} and \cs{tilde}; the corresponding growing +versions are called \cs{widehat} and \cs{widetilde}, respectively. + +Older versions of \XeTeX\ and \LuaTeX\ did not support this distinction, +however, and \emph{all} accents there were growing automatically. (I.e., +\cs{hat} and \cs{widehat} are equivalent.) As of \LuaTeX\ v0.65 and \XeTeX\ +v0.9998, these wide/non-wide commands will again behave in their expected +manner. + + +\subsubsection{Pre-drawn fraction characters} + +Pre-drawn fractions \unichar{00BC}--\unichar{00BE}, \unichar{2150}--\unichar{215E} +are not suitable for use in mathematics output. However, they can be useful +as input characters to abbreviate common fractions. +\begin{center} +\fontspec{DejaVuSerif.ttf} ^^A available in TeX Live 2012 if not earlier +¼ ½ ¾ ↉ ⅐ ⅑ ⅒ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ +\end{center} +For example, instead of writing `|\tfrac12 x|', you may consider it more readable to have +`|½x|' in the source instead. + +If the \cs{tfrac} command exists (i.e., if \pkg{amsmath} is loaded or +you have specially defined \cs{tfrac} for this purpose), it will be used +to typeset the fractions. If not, regular \cs{frac} will be used. The command +to use (\cs{tfrac} or \cs{frac}) can be forced either way with the package +option |active-frac=small| or |active-frac=normalsize|, respectively. + +\subsubsection{Circles} + +Unicode defines a large number of different types of circles for a variety +of mathematical purposes. There are thirteen alone just considering the +all white and all black ones, shown in \tabref{circles}. + +\LaTeX\ defines considerably fewer: \cs{circ} and \cs{bigcirc} for white; +\cs{bullet} for black. This package maps those commands to \cs{vysmwhtcircle}, +\cs{mdlgwhtcircle}, and \cs{smblkcircle}, respectively. + +\begin{table}\centering +\def\showchar#1#2#3{ \textsc{u}+{\small\ttfamily #1} & \texttt{\string#3} & \umfont \char"#1 \\} +\begin{tabular}{@{}llc@{}} +\toprule +Slot & Command & Glyph \\ +\midrule +\showchar{00B7}{centerdot}{\cdotp} +\showchar{22C5}{small middle dot}{\cdot} +\showchar{2219}{bullet operator}{\vysmblkcircle} +\showchar{2022}{round bullet, filled}{\smblkcircle} +\showchar{2981}{z notation spot}{\mdsmblkcircle} +\showchar{26AB}{medium black circle}{\mdblkcircle} +\showchar{25CF}{circle, filled}{\mdlgblkcircle} +\showchar{2B24}{black large circle}{\lgblkcircle} +\bottomrule +\end{tabular} +\def\showchar#1#2#3{ \umfont \char"#1 & \texttt{\string#3} & \textsc{u}+{\small\ttfamily #1} \\} +\begin{tabular}{@{}cll@{}} +\toprule +Glyph & Command & Slot \\ +\midrule +\\ +\\ +\showchar{2218}{composite function (small circle)}{\vysmwhtcircle} +\showchar{25E6}{white bullet}{\smwhtcircle} +\showchar{26AC}{medium small white circle}{\mdsmwhtcircle} +\showchar{26AA}{medium white circle}{\mdwhtcircle} +\showchar{25CB}{large circle}{\mdlgwhtcircle} +\showchar{25EF}{large circle}{\lgwhtcircle} +\bottomrule +\end{tabular} +\caption{Filled and hollow Unicode circles.} +\tablabel{circles} +\end{table} + +\subsubsection{Triangles} + +While there aren't as many different sizes of triangle as there are circle, +there's some important distinctions to make between a few similar characters. See \tabref{uptriangles} for the full summary. + +These triangles all have different intended meanings. Note for backwards +compatibility with \TeX, \unichar{25B3} has \emph{two} different mappings +in \pkg{unicode-math}. \cs{bigtriangleup} is intended as a binary operator +whereas \cs{triangle} is intended to be used as a letter-like symbol. + +But you're better off if you're using the latter form to indicate an +increment to use the glyph intended for this purpose, \unichar{2206}: $\increment x$. + +Finally, given that $\triangle$ and $\increment$ are provided for you +already, it is better off to only use upright Greek Delta $\Delta$ if you're +actually using it as a symbolic entity such as a variable on its own. + +\begin{table}\centering +\begin{tabular}{@{}llcl@{}} +\toprule +Slot & Command & Glyph & Class \\ +\midrule +\unichar{25B5} & \cs{vartriangle} & \umfont \char"25B5 & binary \\ +\unichar{25B3} & \cs{bigtriangleup} & \umfont \char"25B3 & binary \\ +\unichar{25B3} & \cs{triangle} & \umfont \char"25B3 & ordinary \\ +\unichar{2206} & \cs{increment} & \umfont \char"2206 & ordinary \\ +\unichar{0394} & \cs{mathup}\cs{Delta} & \umfont \char"0394 & ordinary \\ +\bottomrule +\end{tabular} +\caption{Different upwards pointing triangles.} +\tablabel{uptriangles} +\end{table} + +\iffalse +\subsubsection{Normalising some input characters} + +I believe +all variant forms should be used as legal input that is normalised to +a consistent output glyph, because we want to be fault-tolerant in the input. +Here are the duplicates: +\begin{quote}\obeylines +\unichar {251} {latin small letter alpha} +\unichar {25B} {latin small letter epsilon} +\unichar {263} {latin small letter gamma} +\unichar {269} {latin small letter iota} +\unichar {278} {latin small letter phi} +\unichar {28A} {latin small letter upsilon} +\unichar {190} {latin capital letter epsilon} +\unichar {194} {latin capital letter gamma} +\unichar {196} {latin capital letter iota} +\unichar {1B1} {latin capital letter upsilon} +\end{quote} + +(Not yet implemented.) +\fi + +\section{Advanced} + +\subsection{Warning messages} + +This package can produce a number of informational messages to try and inform the user when something might be going wrong due to package conflicts or something else. +As an experimental feature, these can be turn off on an individual basis with the package option |warnings-off| which takes a comma-separated list of warnings to suppress. +A warning will give you its name when printed on the console output; e.g., +\begin{Verbatim} + * unicode-math warning: "mathtools-colon" + * + * ... <warning message> ... +\end{Verbatim} +This warning could be suppressed by loading the package as follows: +\begin{Verbatim} + \usepackage[warnings-off={mathtools-colon}]{unicode-math} +\end{Verbatim} + +\subsection{Programmer's interface} + +(Tentative and under construction.) +If you are writing some code that needs to know the current +maths style (\cs{mathbf}, \cs{mathit}, etc.), you can query the +variable \cs{l_@@_mathstyle_tl}. It will contain the maths style +without the leading `math' string; for example, +|\symbf { \show \l_@@_mathstyle_tl }| +will produce `bf'. + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx b/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx new file mode 100644 index 00000000000..29cadd8081e --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx @@ -0,0 +1,39 @@ +%%^^A%% unicode-math-code.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> + +\documentclass[a4paper]{ltxdoc} +\input{um-doc-style.tex} +\begin{document} + +\title{Experimental Unicode mathematical typesetting: The \pkg{unicode-math} package} +\author{\itshape Will Robertson\\\itshape Philipp Stephani, Joseph Wright, Khaled Hosny\\\url{http://github.com/wspr/unicode-math}} +\date{\umfiledate \qquad \umfileversion} + +\maketitle +\tableofcontents + +\def\DTX#1{\clearpage\part{#1}\DocInput{#1}} +\DTXFILES + +\clearpage +\PrintIndex + +\end{document} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-main.dtx b/Master/texmf-dist/source/latex/unicode-math/unicode-math-main.dtx deleted file mode 100644 index 88c9524b18e..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-main.dtx +++ /dev/null @@ -1,590 +0,0 @@ - -% \section{\DTXCURR --- The main \cs{setmathfont} macro} -% -% \begin{macrocode} -%<*package&(XE|LU)> -% \end{macrocode} -% -% Using a |range| including large character sets such as \cmd\mathrel, -% \cmd\mathalpha, \etc, is \emph{very slow}! -% I hope to improve the performance somehow. -% -% \begin{macro}{\setmathfont} -% \doarg{font features (first optional argument retained for backwards compatibility)} -% \darg{font name} -% \doarg{font features} -% \begin{macrocode} -\DeclareDocumentCommand \setmathfont { O{} m O{} } - { - \@@_setmathfont:nn {#1,#3} {#2} - } -% \end{macrocode} -% -% \begin{macrocode} -\cs_set:Nn \@@_setmathfont:nn - { - \tl_set:Nn \l_@@_fontname_tl {#2} - \@@_init: -% \end{macrocode} -% Grab the current size information: -% (is this robust enough? Maybe it should be preceded by \cmd\normalsize). -% The macro \cmd\S@\meta{size} -% contains the definitions of the sizes used for maths letters, subscripts and subsubscripts in -% \cmd\tf@size, \cmd\sf@size, and \cmd\ssf@size, respectively. -% \begin{macrocode} - \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes } - \csname S@\f@size\endcsname -% \end{macrocode} -% Parse options and tell people what's going on: -% \begin{macrocode} - \keys_set_known:nnN {unicode-math} {#1} \l_@@_unknown_keys_clist - \bool_if:NT \l_@@_init_bool { \@@_log:n {default-math-font} } -% \end{macrocode} -% Use \pkg{fontspec} to select a font to use. -% After loading the font, we detect what sizes it recommends for scriptsize and scriptscriptsize, so after setting those values appropriately, we reload the font to take these into account. -% \begin{macrocode} -%<debug> \csname TIC\endcsname - \@@_fontspec_select_font: -%<debug> \csname TOC\endcsname - \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool } - { - \@@_declare_math_sizes: - \@@_fontspec_select_font: - } -% \end{macrocode} -% Now define |\@@_symfont_tl| as the \LaTeX\ math font to access everything: -% \begin{macrocode} - \cs_if_exist:cF { sym \@@_symfont_tl } - { - \DeclareSymbolFont{\@@_symfont_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} - } - \SetSymbolFont{\@@_symfont_tl}{\l_@@_mversion_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} -% \end{macrocode} -% Set the bold math version. -% \begin{macrocode} - \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} - { - \SetSymbolFont{\@@_symfont_tl}{bold} - {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} - } -% \end{macrocode} -% Declare the math sizes (i.e., scaling of superscripts) for the specific -% values for this font, -% and set defaults for math fams two and three for legacy compatibility: -% \begin{macrocode} - \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool } - { - \bool_set_true:N \g_@@_mainfont_already_set_bool - \@@_setup_legacy_fam_two: - \@@_setup_legacy_fam_three: - } -% \end{macrocode} -% And now we input every single maths char. -% \begin{macrocode} -%<debug> \csname TIC\endcsname - \@@_input_math_symbol_table: -%<debug> \csname TOC\endcsname -% \end{macrocode} -% Finally, -% \begin{itemize} -% \item Remap symbols that don't take their natural mathcode -% \item Activate any symbols that need to be math-active -% \item Enable wide/narrow accents -% \item Assign delimiter codes for symbols that need to grow -% \item Setup the maths alphabets (\cs{mathbf} etc.). -% This is an extensive part of the code; see Section~\ref{sec:mathmap}. -% \item Setup negations, which are handled on an ad hoc basis; see Section~\ref{sec:negations}. -% \end{itemize} -% \begin{macrocode} - \@@_remap_symbols: - \@@_setup_mathactives: - \@@_setup_delcodes: -%<debug> \csname TIC\endcsname - \@@_setup_alphabets: -%<debug> \csname TOC\endcsname - \@@_setup_negations: - } -% \end{macrocode} -% \end{macro} -% -% \paragraph{Fall-back font} -% -% Want to load Latin Modern Math if nothing else. -% This needs to happen early so that all of the font-loading machinery executes before -% the other `AtBeginDocument' code. -% \begin{macrocode} -\AtBeginDocument { \@@_load_lm_if_necessary: } -\cs_new:Nn \@@_load_lm_if_necessary: - { - \cs_if_exist:NF \l_@@_fontname_tl - { - % TODO: update this when lmmath-bold.otf is released - \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}] - \bool_set_false:N \g_@@_mainfont_already_set_bool - } - } -% \end{macrocode} -% Note that here we reset the `font already loaded' boolean so that a new font being set -% will do the right thing in terms of setting up defaults. -% -% TODO: need a better way to do this for the general case. (Maybe a `reset' command option?) -% -% \begin{macro}{\@@_init:} -% \begin{macrocode} -\cs_new:Nn \@@_init: - { -% \end{macrocode} -% \begin{itemize} -% \item Initially assume we're using a proper OpenType font with unicode maths. -% \begin{macrocode} - \bool_set_true:N \l_@@_ot_math_bool -% \end{macrocode} -% \item Erase any conception \LaTeX\ has of previously defined math symbol fonts; -% this allows \cmd\DeclareSymbolFont\ at any point in the document. -% \begin{macrocode} - \cs_set_eq:NN \glb@currsize \scan_stop: -% \end{macrocode} -% \item To start with, assume we're defining the font for every math symbol character. -% \begin{macrocode} - \bool_set_true:N \l_@@_init_bool - \seq_clear:N \l_@@_char_range_seq - \clist_clear:N \l_@@_char_nrange_clist - \seq_clear:N \l_@@_mathalph_seq - \seq_clear:N \l_@@_missing_alph_seq -% \end{macrocode} -% \item By default use the `normal' math version. -% \begin{macrocode} - \tl_set:Nn \l_@@_mversion_tl {normal} -% \end{macrocode} -% \item Other range initialisations. -% \begin{macrocode} - \tl_set:Nn \@@_symfont_tl {operators} - \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_noparse:nnn - \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn - \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_noparse:nnn - \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n - \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn - \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_noparse:nn - \cs_set_eq:NN \@@_make_mathactive:nNN \@@_make_mathactive_noparse:nNN -% \end{macrocode} -% \item Define default font features for the script and scriptscript font. -% \begin{macrocode} - \tl_set:Nn \l_@@_script_features_tl {Style=MathScript} - \tl_set:Nn \l_@@_sscript_features_tl {Style=MathScriptScript} - \tl_set_eq:NN \l_@@_script_font_tl \l_@@_fontname_tl - \tl_set_eq:NN \l_@@_sscript_font_tl \l_@@_fontname_tl -% \end{macrocode} -% \end{itemize} -% \begin{macrocode} - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_declare_math_sizes:} -% Set the math sizes according to the recommended font parameters. -% TODO: this shouldn't need to be per-engine; check out why the wrappers aren't used. -% \begin{macrocode} -\cs_new:Nn \@@_declare_math_sizes: - { -%<*LU> - \fp_compare:nF { \@@_script_style_size:n {ScriptPercentScaleDown} == 0 } - { - \DeclareMathSizes { \f@size } { \f@size } - { \@@_script_style_size:n {ScriptPercentScaleDown} } - { \@@_script_style_size:n {ScriptScriptPercentScaleDown} } - } -%</LU> -%<*XE> - \dim_compare:nF { \fontdimen 10 \l_@@_font == 0pt } - { - \DeclareMathSizes { \f@size } { \f@size } - { \@@_fontdimen_to_scale:nn {10} {\l_@@_font} } - { \@@_fontdimen_to_scale:nn {11} {\l_@@_font} } - } -%</XE> - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_script_style_size:n} -% Determine script- and scriptscriptstyle sizes using luaotfload: -% \begin{macrocode} -%<*LU> -\cs_new:Nn \@@_script_style_size:n - { - \fp_eval:n {\directlua{tex.sprint(luaotfload.aux.get_math_dimension("l_@@_font","#1"))} * \f@size / 100 } - } -%</LU> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_setup_legacy_fam_two:} -% \TeX\ won't load the same font twice at the same scale, so we need to magnify this one by an imperceptable amount. -% \begin{macrocode} -\cs_new:Nn \@@_setup_legacy_fam_two: - { - \fontspec_set_family:Nxn \l_@@_family_tl - { - \l_@@_font_keyval_tl, - Scale=1.00001, - FontAdjustment = - { - \fontdimen8\font= \@@_get_fontparam:nn {43} {FractionNumeratorDisplayStyleShiftUp}\relax - \fontdimen9\font= \@@_get_fontparam:nn {42} {FractionNumeratorShiftUp}\relax - \fontdimen10\font=\@@_get_fontparam:nn {32} {StackTopShiftUp}\relax - \fontdimen11\font=\@@_get_fontparam:nn {45} {FractionDenominatorDisplayStyleShiftDown}\relax - \fontdimen12\font=\@@_get_fontparam:nn {44} {FractionDenominatorShiftDown}\relax - \fontdimen13\font=\@@_get_fontparam:nn {21} {SuperscriptShiftUp}\relax - \fontdimen14\font=\@@_get_fontparam:nn {21} {SuperscriptShiftUp}\relax - \fontdimen15\font=\@@_get_fontparam:nn {22} {SuperscriptShiftUpCramped}\relax - \fontdimen16\font=\@@_get_fontparam:nn {18} {SubscriptShiftDown}\relax - \fontdimen17\font=\@@_get_fontparam:nn {18} {SubscriptShiftDownWithSuperscript}\relax - \fontdimen18\font=\@@_get_fontparam:nn {24} {SuperscriptBaselineDropMax}\relax - \fontdimen19\font=\@@_get_fontparam:nn {20} {SubscriptBaselineDropMin}\relax - \fontdimen20\font=0pt\relax % delim1 = FractionDelimiterDisplaySize - \fontdimen21\font=0pt\relax % delim2 = FractionDelimiterSize - \fontdimen22\font=\@@_get_fontparam:nn {15} {AxisHeight}\relax - } - } {\l_@@_fontname_tl} - - \SetSymbolFont{symbols}{\l_@@_mversion_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} - - \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} - { - \SetSymbolFont{symbols}{bold} - {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_setup_legacy_fam_three:} -% Similarly, this font is shrunk by an imperceptable amount for \TeX\ to load it again. -% \begin{macrocode} -\cs_new:Nn \@@_setup_legacy_fam_three: - { - \fontspec_set_family:Nxn \l_@@_family_tl - { - \l_@@_font_keyval_tl, - Scale=0.99999, - FontAdjustment={ - \fontdimen8\font= \@@_get_fontparam:nn {48} {FractionRuleThickness}\relax - \fontdimen9\font= \@@_get_fontparam:nn {28} {UpperLimitGapMin}\relax - \fontdimen10\font=\@@_get_fontparam:nn {30} {LowerLimitGapMin}\relax - \fontdimen11\font=\@@_get_fontparam:nn {29} {UpperLimitBaselineRiseMin}\relax - \fontdimen12\font=\@@_get_fontparam:nn {31} {LowerLimitBaselineDropMin}\relax - \fontdimen13\font=0pt\relax - } - } {\l_@@_fontname_tl} - - \SetSymbolFont{largesymbols}{\l_@@_mversion_tl} - {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault} - - \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal} - { - \SetSymbolFont{largesymbols}{bold} - {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault} - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\cs_new:Nn \@@_get_fontparam:nn - { -%<XE> \the\fontdimen#1\l_@@_font\relax -%<LU> \directlua{fontspec.mathfontdimen("l_@@_font","#2")} - } -% \end{macrocode} -% -% \begin{macro}{\@@_fontspec_select_font:} -% Select the font with \cs{fontspec} and define \cs{l_@@_font} from it. -% \begin{macrocode} -\cs_new:Nn \@@_fontspec_select_font: - { - \tl_set:Nx \l_@@_font_keyval_tl { -%<LU> Renderer = Basic, - BoldItalicFont = {}, ItalicFont = {}, - Script = Math, - SizeFeatures = - { - { - Size = \tf@size- - } , - { - Size = \sf@size-\tf@size , - Font = \l_@@_script_font_tl , - \l_@@_script_features_tl - } , - { - Size = -\sf@size , - Font = \l_@@_sscript_font_tl , - \l_@@_sscript_features_tl - } - } , - \l_@@_unknown_keys_clist - } - \fontspec_set_fontface:NNxn \l_@@_font \l_@@_family_tl - {\l_@@_font_keyval_tl} {\l_@@_fontname_tl} -% \end{macrocode} -% Check whether we're using a real maths font: -% \begin{macrocode} - \group_begin: - \fontfamily{\l_@@_family_tl}\selectfont - \fontspec_if_script:nF {math} {\bool_gset_false:N \l_@@_ot_math_bool} - \group_end: - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Functions for setting up symbols with mathcodes} -% \seclabel{mathsymbol} -% -% \begin{macro}{\@@_process_symbol_noparse:nnn} -% \begin{macro}{\@@_process_symbol_parse:nnn} -% If the \feat{range} font feature has been used, then only -% a subset of the Unicode glyphs are to be defined. -% See \secref{rangeproc} for the code that enables this. -% \begin{macrocode} -\cs_set:Nn \@@_process_symbol_noparse:nnn - { - \@@_set_mathsymbol:nNNn {\@@_symfont_tl} #2 #3 {#1} - } -% \end{macrocode} -% \begin{macrocode} -\cs_set:Nn \@@_process_symbol_parse:nnn - { - \@@_if_char_spec:nNNT {#1} {#2} {#3} - { - \@@_process_symbol_noparse:nnn {#1} {#2} {#3} - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\@@_remap_symbols:} -% \begin{macro}{\@@_remap_symbol_noparse:nnn} -% \begin{macro}{\@@_remap_symbol_parse:nnn} -% This function is used to define the mathcodes for those chars which should -% be mapped to a different glyph than themselves. -% \begin{macrocode} -\cs_new:Npn \@@_remap_symbols: - { - \@@_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus - \@@_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk" - \bool_if:NF \g_@@_literal_colon_bool - { - \@@_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel) - } - } -% \end{macrocode} -% \end{macro} -% Where |\@@_remap_symbol:nnn| is defined to be one of these two, depending -% on the range setup: -% \begin{macrocode} -\cs_new:Nn \@@_remap_symbol_parse:nnn - { - \@@_if_char_spec:nNNT {#3} {\@nil} {#2} - { \@@_remap_symbol_noparse:nnn {#1} {#2} {#3} } - } -\cs_new:Nn \@@_remap_symbol_noparse:nnn - { - \clist_map_inline:nn {#1} - { \@@_set_mathcode:nnnn {##1} {#2} {\@@_symfont_tl} {#3} } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \subsection{Active math characters} -% -% There are more math active chars later in the subscript/superscript section. -% But they don't need to be able to be typeset directly. -% -% \begin{macro}{\@@_setup_mathactives:} -% \begin{macrocode} -\cs_new:Npn \@@_setup_mathactives: - { - \@@_make_mathactive:nNN {"2032} \@@_prime_single_mchar \mathord - \@@_make_mathactive:nNN {"2033} \@@_prime_double_mchar \mathord - \@@_make_mathactive:nNN {"2034} \@@_prime_triple_mchar \mathord - \@@_make_mathactive:nNN {"2057} \@@_prime_quad_mchar \mathord - \@@_make_mathactive:nNN {"2035} \@@_backprime_single_mchar \mathord - \@@_make_mathactive:nNN {"2036} \@@_backprime_double_mchar \mathord - \@@_make_mathactive:nNN {"2037} \@@_backprime_triple_mchar \mathord - \@@_make_mathactive:nNN {`\'} \mathstraightquote \mathord - \@@_make_mathactive:nNN {`\`} \mathbacktick \mathord - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_make_mathactive:nNN} -% Makes |#1| a mathactive char, and gives cs |#2| the meaning of mathchar |#1| -% with class |#3|. -% You are responsible for giving active |#1| a particular meaning! -% \begin{macrocode} -\cs_new:Nn \@@_make_mathactive_parse:nNN - { - \@@_if_char_spec:nNNT {#1} #2 #3 - { \@@_make_mathactive_noparse:nNN {#1} #2 #3 } - } -% \end{macrocode} -% -% \begin{macrocode} -\cs_new:Nn \@@_make_mathactive_noparse:nNN - { - \@@_set_mathchar:NNnn #2 #3 {\@@_symfont_tl} {#1} - \@@_char_gmake_mathactive:n {#1} - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Delimiter codes} -% -% \begin{macro}{\@@_assign_delcode:nn} -% \begin{macrocode} -\cs_new:Nn \@@_assign_delcode_noparse:nn - { - \@@_set_delcode:nnn \@@_symfont_tl {#1} {#2} - } -% \end{macrocode} -% -% \begin{macrocode} -\cs_new:Nn \@@_assign_delcode_parse:nn - { - \@@_if_char_spec:nNNT {#2} {\@nil} {\@nil} - { - \@@_assign_delcode_noparse:nn {#1} {#2} - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_assign_delcode:n} -% Shorthand. -% \begin{macrocode} -\cs_new:Nn \@@_assign_delcode:n { \@@_assign_delcode:nn {#1} {#1} } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_setup_delcodes:} -% Some symbols that aren't mathopen/mathclose still need to have delimiter codes assigned. -% The list of vertical arrows may be incomplete. -% On the other hand, many fonts won't support them all being stretchy. -% And some of them are probably not meant to stretch, either. But adding them here doesn't hurt. -% \begin{macrocode} -\cs_new:Npn \@@_setup_delcodes: - { - % ensure \left. and \right. work: - \@@_set_delcode:nnn \@@_symfont_tl {`\.} {\c_zero} - % this is forcefully done to fix a bug -- indicates a larger problem! - - \@@_assign_delcode:nn {`\/} {\g_@@_slash_delimiter_usv} - \@@_assign_delcode:nn {"2044} {\g_@@_slash_delimiter_usv} % fracslash - \@@_assign_delcode:nn {"2215} {\g_@@_slash_delimiter_usv} % divslash - \@@_assign_delcode:n {"005C} % backslash - \@@_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation - \@@_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation - \@@_assign_delcode:n {"2191} % up arrow - \@@_assign_delcode:n {"2193} % down arrow - \@@_assign_delcode:n {"2195} % updown arrow - \@@_assign_delcode:n {"219F} % up arrow twohead - \@@_assign_delcode:n {"21A1} % down arrow twohead - \@@_assign_delcode:n {"21A5} % up arrow from bar - \@@_assign_delcode:n {"21A7} % down arrow from bar - \@@_assign_delcode:n {"21A8} % updown arrow from bar - \@@_assign_delcode:n {"21BE} % up harpoon right - \@@_assign_delcode:n {"21BF} % up harpoon left - \@@_assign_delcode:n {"21C2} % down harpoon right - \@@_assign_delcode:n {"21C3} % down harpoon left - \@@_assign_delcode:n {"21C5} % arrows up down - \@@_assign_delcode:n {"21F5} % arrows down up - \@@_assign_delcode:n {"21C8} % arrows up up - \@@_assign_delcode:n {"21CA} % arrows down down - \@@_assign_delcode:n {"21D1} % double up arrow - \@@_assign_delcode:n {"21D3} % double down arrow - \@@_assign_delcode:n {"21D5} % double updown arrow - \@@_assign_delcode:n {"21DE} % up arrow double stroke - \@@_assign_delcode:n {"21DF} % down arrow double stroke - \@@_assign_delcode:n {"21E1} % up arrow dashed - \@@_assign_delcode:n {"21E3} % down arrow dashed - \@@_assign_delcode:n {"21E7} % up white arrow - \@@_assign_delcode:n {"21E9} % down white arrow - \@@_assign_delcode:n {"21EA} % up white arrow from bar - \@@_assign_delcode:n {"21F3} % updown white arrow - } -% \end{macrocode} -% \end{macro} -% -% \subsection{(Big) operators} -% -% The engine does what is necessary to deal with big operators for us -% automatically with \cmd\Umathchardef. -% However, the limits aren't set automatically; that is, we want to define, -% a la Plain \TeX\ \etc, |\def\int{\intop\nolimits}|, so there needs to be a -% transformation from \cmd\int\ to \cmd\intop\ during the expansion of -% \cmd\_@@_sym:nnn\ in the appropriate contexts. -% -% \begin{macro}{\l_@@_nolimits_tl} -% This macro is a sequence containing those maths operators that require a -% \cmd\nolimits\ suffix. -% This list is used when processing |unicode-math-table.tex| to define such -% commands automatically (see the macro \cs{@@_set_mathsymbol:nNNn}). -% I've chosen essentially just the operators that look like integrals; -% hopefully a better mathematician can help me out here. -% I've a feeling that it's more useful \emph{not} to include the multiple -% integrals such as $\iiiint$, but that might be a matter of preference. -% \begin{macrocode} -\tl_set:Nn \l_@@_nolimits_tl - { - \int\iint\iiint\iiiint\oint\oiint\oiiint - \intclockwise\varointclockwise\ointctrclockwise\sumint - \intbar\intBar\fint\cirfnint\awint\rppolint - \scpolint\npolint\pointint\sqint\intlarhk\intx - \intcap\intcup\upint\lowint - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\addnolimits} -% This macro appends material to the macro containing the list of operators -% that don't take limits. -% \begin{macrocode} -\DeclareDocumentCommand \addnolimits {m} - { - \tl_put_right:Nn \l_@@_nolimits_tl {#1} - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\removenolimits} -% Can this macro be given a better name? -% It removes an item from the nolimits list. -% \begin{macrocode} -\DeclareDocumentCommand \removenolimits {m} - { - \tl_remove_all:Nn \l_@@_nolimits_tl {#1} - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Radicals} -% -% \begin{macro}{\l_@@_radicals_tl} -% The radicals are organised in \cs{@@_set_mathsymbol:nNNn}. -% We organise radicals in the same way as nolimits-operators. -% (\cs{cuberoot} and \cs{fourthroot}, don't seem to behave as proper radicals.) -% \begin{macrocode} -\tl_set:Nn \l_@@_radicals_tl {\sqrt \longdivision} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -%</package&(XE|LU)> -% \end{macrocode} -% -\endinput diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-preamble.dtx b/Master/texmf-dist/source/latex/unicode-math/unicode-math-preamble.dtx deleted file mode 100644 index 3c011d7ccab..00000000000 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-preamble.dtx +++ /dev/null @@ -1,329 +0,0 @@ - -% \section{\DTXCURR --- start of the package code} -% -% \begin{macrocode} -%<*package&(XE|LU)> -% \end{macrocode} -% -% \begin{macrocode} -%<*LU> -\RequirePackage{lualatex-math} -%</LU> -% \end{macrocode} -% -% \begin{macrocode} -\ExplSyntaxOn -% \end{macrocode} -% -% Variants needed from \pkg{expl3}: -% \begin{macrocode} -\cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: } -% \end{macrocode} -% -% For \pkg{fontspec}: -% \begin{macrocode} -\cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} -\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} -% \end{macrocode} -% -% \paragraph{Conditionals} -% -% \begin{macrocode} -\bool_new:N \l_@@_ot_math_bool -\bool_new:N \l_@@_init_bool -\bool_new:N \l_@@_implicit_alph_bool -\bool_new:N \g_@@_mainfont_already_set_bool -% \end{macrocode} -% For \opt{math-style}: -% \begin{macrocode} -\bool_new:N \g_@@_literal_bool -\bool_new:N \g_@@_upLatin_bool -\bool_new:N \g_@@_uplatin_bool -\bool_new:N \g_@@_upGreek_bool -\bool_new:N \g_@@_upgreek_bool -% \end{macrocode} -% For \opt{bold-style}: -% \begin{macrocode} -\bool_new:N \g_@@_bfliteral_bool -\bool_new:N \g_@@_bfupLatin_bool -\bool_new:N \g_@@_bfuplatin_bool -\bool_new:N \g_@@_bfupGreek_bool -\bool_new:N \g_@@_bfupgreek_bool -% \end{macrocode} -% For \opt{sans-style}: -% \begin{macrocode} -\bool_new:N \g_@@_upsans_bool -\bool_new:N \g_@@_sfliteral_bool -% \end{macrocode} -% For assorted package options: -% \begin{macrocode} -\bool_new:N \g_@@_upNabla_bool -\bool_new:N \g_@@_uppartial_bool -\bool_new:N \g_@@_literal_Nabla_bool -\bool_new:N \g_@@_literal_partial_bool -\bool_new:N \l_@@_smallfrac_bool -\bool_new:N \g_@@_literal_colon_bool -\bool_new:N \g_@@_mathrm_text_bool -\bool_new:N \g_@@_mathit_text_bool -\bool_new:N \g_@@_mathbf_text_bool -\bool_new:N \g_@@_mathsf_text_bool -\bool_new:N \g_@@_mathtt_text_bool -% \end{macrocode} -% -% \paragraph{Variables} -% \begin{macrocode} -\int_new:N \g_@@_fam_int -% \end{macrocode} -% -% For displaying in warning messages, etc.: -% \begin{macrocode} -\tl_const:Nn \c_@@_math_alphabet_name_latin_tl {Latin,~lowercase} -\tl_const:Nn \c_@@_math_alphabet_name_Latin_tl {Latin,~uppercase} -\tl_const:Nn \c_@@_math_alphabet_name_greek_tl {Greek,~lowercase} -\tl_const:Nn \c_@@_math_alphabet_name_Greek_tl {Greek,~uppercase} -\tl_const:Nn \c_@@_math_alphabet_name_num_tl {Numerals} -\tl_const:Nn \c_@@_math_alphabet_name_misc_tl {Misc.} -% \end{macrocode} -% -% \begin{macrocode} -\tl_new:N \l_@@_mathstyle_tl -\tl_new:N \l_@@_radicals_tl -\tl_new:N \l_@@_nolimits_tl -% \end{macrocode} -% -% Used to store the font switch for the \cs{operator@font}. -% \begin{macrocode} -\tl_new:N \g_@@_operator_mathfont_tl -% \end{macrocode} -% -% Variables: -% \begin{macrocode} -\seq_new:N \l_@@_missing_alph_seq -\seq_new:N \l_@@_mathalph_seq -\seq_new:N \l_@@_char_range_seq -\seq_new:N \l_@@_mclass_range_seq -\seq_new:N \l_@@_cmd_range_seq -% \end{macrocode} -% -% \begin{macro}{\g_@@_alphabets_seq} -% Each of math `style' (bfup, sfit, etc.) usually contains one or more `alphabets', which are currently |latin|, |Latin|, |greek|, |Greek|, |num|, and |misc|, although there's an implicit potential for more. -% |misc| is not included in the official list to avoid checking code. -% \begin{macrocode} -\clist_new:N \g_@@_alphabets_seq -\clist_set:Nn \g_@@_alphabets_seq { latin, Latin, greek, Greek, num } -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\clist_new:N \g_@@_named_ranges_clist -\clist_new:N \g_@@_char_nrange_clist -\clist_new:N \g_@@_unknown_keys_clist -\clist_new:N \g_@@_alphabet_clist -% \end{macrocode} -% -% \begin{macro}{\g_@@_mathclasses_seq} -% Every math class. -% \begin{macrocode} -\seq_new:N \g_@@_mathclasses_seq -\seq_set_from_clist:Nn \g_@@_mathclasses_seq - { - \mathord,\mathalpha,\mathbin,\mathrel,\mathpunct, - \mathop, - \mathopen,\mathclose, - \mathfence,\mathover,\mathunder, - \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide - } -% \end{macrocode} -% \end{macro} -% - -% \begin{macro}{\g_@@_default_mathalph_seq} -% This sequence stores the alphabets in each math style. -% \begin{macrocode} -\seq_new:N \g_@@_default_mathalph_seq -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\g_@@_mathstyles_seq} -% This is every `named range' and every `math style' known to \pkg{unicode-math}. -% A named range is such as "bfit" and "sfit", which are also math styles (with \cs{symbfit} and \cs{symsfit}). -% `Mathstyles' are a superset of named ranges and also include commands such as \cs{symbf} and \cs{symsf}. -% -% N.B. for parsing purposes `named ranges' are defined as strings! -% \begin{macrocode} -\seq_new:N \g_@@_named_ranges_seq -\seq_new:N \g_@@_mathstyles_seq -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\muskip_new:N \g_@@_primekern_muskip -\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }% arbitrary -\int_new:N \l_@@_primecount_int -\prop_new:N \g_@@_supers_prop -\prop_new:N \g_@@_subs_prop -\tl_new:N \l_not_token_name_tl -% \end{macrocode} -% -% \begin{macrocode} -\tl_new:N \g_@@_slash_delimiter_usv -\tl_new:N \g_@@_mathtable_tl -\tl_new:N \g_@@_fontname_tl -\tl_new:N \g_@@_mversion_tl -\tl_new:N \g_@@_symfont_tl -\tl_new:N \g_@@_font_keyval_tl -\tl_new:N \g_@@_family_tl -\tl_new:N \g_@@_style_tl -\tl_new:N \g_@@_remap_style_tl -% \end{macrocode} -% -% \subsection{Extras} -% -% What might end up being provided by the kernel. -% -% \begin{macro}{\@@_glyph_if_exist:nTF} -%: TODO: Generalise for arbitrary fonts! \cs{l_@@_font} is not always the one used for a specific glyph!! -% \begin{macrocode} -\prg_new_conditional:Nnn \@@_glyph_if_exist:n {p,TF,T,F} - { - \etex_iffontchar:D \l_@@_font #1 \scan_stop: - \prg_return_true: - \else: - \prg_return_false: - \fi: - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_set_mathcode:nnnn} -% \begin{macro}{\@@_set_mathcode:nnn} -% \begin{macro}{\@@_set_mathchar:NNnn} -% \begin{macro}{\@@_set_mathchar:cNnn} -% \begin{macro}{\@@_set_delcode:nnn} -% \begin{macro}{\@@_radical:nn} -% \begin{macro}{\@@_delimiter:Nnn} -% \begin{macro}{\@@_accent:nnn} -% \begin{macro}{\@@_accent_keyword:} -% These are all wrappers for the primitive commands that take numerical -% input only. -% \begin{macrocode} -\cs_set:Npn \@@_set_mathcode:nnnn #1#2#3#4 { - \Umathcode \int_eval:n {#1} = - \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: -} -\cs_set:Npn \@@_set_mathcode:nnn #1#2#3 { - \Umathcode \int_eval:n {#1} = - \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop: -} -\cs_set:Npn \@@_set_mathchar:NNnn #1#2#3#4 { - \Umathchardef #1 = - \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop: -} -\cs_new:Nn \@@_set_delcode:nnn { - \Udelcode#2 = \csname sym#1\endcsname #3 \scan_stop: -} -\cs_new:Nn \@@_radical:nn { - \Uradical \csname sym#1\endcsname #2 \scan_stop: -} -\cs_new:Nn \@@_delimiter:Nnn { - \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop: -} -\cs_new:Nn \@@_accent:nnn { - \Umathaccent #1~ \mathchar@type\mathaccent \use:c { sym #2 } #3 \scan_stop: -} -% \end{macrocode} -% -% \begin{macrocode} -\cs_generate_variant:Nn \@@_set_mathchar:NNnn {c} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% -% \begin{macro}{\@@_char_gmake_mathactive:N} -% \begin{macro}{\@@_char_gmake_mathactive:n} -% \begin{macrocode} -\cs_new:Nn \@@_char_gmake_mathactive:N - { - \global\mathcode `#1 = "8000 \scan_stop: - } -\cs_new:Nn \@@_char_gmake_mathactive:n - { - \global\mathcode #1 = "8000 \scan_stop: - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \subsection{Alphabet Unicode positions} -% -% Before we begin, let's define the positions of the various Unicode -% alphabets so that our code is a little more readable.\footnote{`\textsc{u.s.v.}' stands -% for `Unicode scalar value'.} -% -% \begin{macro}{\usv_set:nnn,\@@_to_usv:nn} -% Rather than `readable', in the end, this makes the code more extensible. -% \begin{macrocode} -\cs_new:Nn \usv_set:nnn { \tl_const:cn { c_@@_#1_#2_usv } {#3} } -\cs_new:Nn \@@_to_usv:nn { \use:c { c_@@_#1_#2_usv } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[TF]{\@@_usv_if_exist:nn} -% \begin{macrocode} -\prg_new_conditional:Nnn \@@_usv_if_exist:nn {T,F,TF} - { - \cs_if_exist:cTF { c_@@_#1_#2_usv } - \prg_return_true: \prg_return_false: - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Programmers' interface} -% -% \begin{macro}{\unimath_get_mathstyle:} -% This command expands to the currently math style. -% \begin{macrocode} -\cs_new:Nn \unimath_get_mathstyle: - { - \tl_use:N \l_@@_mathstyle_tl - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Overcoming \texorpdfstring{\cmd\@onlypreamble}{\textbackslash @onlypreamble}} -% -% The requirement of only setting up the maths fonts in the preamble is now removed. -% The following list might be overly ambitious. -% \begin{macrocode} -\tl_map_inline:nn - { - \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes - \@DeclareMathSizes\newmathalphabet\newmathalphabet@@\newmathalphabet@@@ - \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion - \version@list\version@elt\alpha@list\alpha@elt - \restore@mathversion\init@restore@version\dorestore@version\process@table - \new@mathversion\DeclareSymbolFont\group@list\group@elt - \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp - \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@ - \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar - \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter - \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter - \set@@mathdelimiter\DeclareMathRadical\mathchar@type - \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@ - } - { - \tl_remove_once:Nn \@preamblecmds {\do#1} - } -% \end{macrocode} -% -% \begin{macrocode} -%</package&(XE|LU)> -% \end{macrocode} diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx index eae42605dc7..38c525202f3 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx @@ -1,136 +1,76 @@ -% \iffalse -% !TEX TS-program = XeLaTeX -% ^^A %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% ^^A SELF-EXTRACTION BEGINS HERE -% ^^A %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%<*internal> -\begingroup -\input l3docstrip.tex\relax\keepsilent -\declarepreamble\defaultpreamble +%%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math> -Copyright 2006-2017 Will Robertson <will.robertson@latex-project.org> -Copyright 2010-2013 Philipp Stephani <st_philipp@yahoo.de> -Copyright 2012-2015 Khaled Hosny <khaledhosny@eglug.org> - -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/>. - -This work is "maintained" by Will Robertson. -\endpreamble -\nopostamble -\askforoverwritefalse -\ifx\UMDEBUG\undefined\def\UMDEBUG{}\else\def\UMDEBUG{,debug}\fi -\gdef\DTXFILES{% - \DTX{unicode-math.dtx}% - \DTX{unicode-math-preamble.dtx}% - \DTX{unicode-math-pkgopt.dtx}% - \DTX{unicode-math-msg.dtx}% - \DTX{unicode-math-usv.dtx}% - \DTX{unicode-math-setchar.dtx}% - \DTX{unicode-math-mathtext.dtx}% - \DTX{unicode-math-main.dtx}% - \DTX{unicode-math-fontopt.dtx}% - \DTX{unicode-math-fontparam.dtx}% - \DTX{unicode-math-mathmap.dtx}% - \DTX{unicode-math-mathtext.dtx}% - \DTX{unicode-math-epilogue.dtx}% - \DTX{unicode-math-primes.dtx}% - \DTX{unicode-math-sscript.dtx}% - \DTX{unicode-math-compat.dtx}% - \DTX{unicode-math-alphabets.dtx}% -} -\generate{\file{unicode-math.sty}{\from{unicode-math.dtx}{preamble,load}}} -\def\DTX#1{\from{#1}{package,XE\UMDEBUG}} -\generate{\file{unicode-math-xetex.sty}{\DTXFILES}} -\def\DTX#1{\from{#1}{package,LU\UMDEBUG}} -\generate{\file{unicode-math-luatex.sty}{\DTXFILES}} -\def\tempa{plain}\ifx\tempa\fmtname\endgroup\expandafter\bye\fi -\endgroup -\ProvidesFile{unicode-math.dtx} -%</internal> -%<package&!XE&!LU>\ProvidesPackage{unicode-math} -%<package&XE>\ProvidesPackage{unicode-math-xetex} -%<package&LU>\ProvidesPackage{unicode-math-luatex} -%<*package> - [2017/10/09 v0.8h Unicode maths in XeLaTeX and LuaLaTeX] -%</package> -%<*internal> -\input{unicode-math-doc} -%</internal> -% \fi -% -% \clearpage -% \part{Package implementation} -% \parttoc +% \section{Package declaration} % -% \section{The \texttt{unicode-math.sty} loading file} -% -% The prefix for \pkg{unicode-math} is \texttt{um}: -% \begin{macrocode} -%<@@=um> -% \end{macrocode} -% -% The plain sty file is a stub which loads necessary packages and then bifurcates into -% a XeTeX- or LuaTeX-specific version of the package. -% -% \begin{macrocode} -%<*load> -% \end{macrocode} -% Bail early if necessary. +% List all \texttt{dtx} files for +% (a) the \texttt{ins} file and~(b) typesetting the code. % \begin{macrocode} -\ifdefined\XeTeXversion - \ifdim\number\XeTeXversion\XeTeXrevision in<0.9998in% - \PackageError{unicode-math}{% - Cannot run with this version of XeTeX!\MessageBreak - You need XeTeX 0.9998 or newer.% - }\@ehd - \fi -\else\ifdefined\luatexversion - \ifnum\luatexversion<64% - \PackageError{unicode-math}{% - Cannot run with this version of LuaTeX!\MessageBreak - You need LuaTeX 0.64 or newer.% - }\@ehd - \fi -\else - \PackageError{unicode-math}{% - Cannot be run with pdfLaTeX!\MessageBreak - Use XeLaTeX or LuaLaTeX instead.% - }\@ehd -\fi\fi +%<*dtx> +\def\DTXFILES{ + \DTX{unicode-math.dtx} + \DTX{um-code-base.dtx} + \DTX{um-code-opening.dtx} + \DTX{um-code-variables.dtx} + \DTX{um-code-api.dtx} + \DTX{um-code-ui.dtx} + \DTX{um-code-pkgopt.dtx} + \DTX{um-code-msg.dtx} + \DTX{um-code-usv.dtx} + \DTX{um-code-setchar.dtx} + \DTX{um-code-mathtext.dtx} + \DTX{um-code-main.dtx} + \DTX{um-code-fontopt.dtx} + \DTX{um-code-fontparam.dtx} + \DTX{um-code-mathmap.dtx} + \DTX{um-code-epilogue.dtx} + \DTX{um-code-primes.dtx} + \DTX{um-code-sscript.dtx} + \DTX{um-code-compat.dtx} + \DTX{um-code-alphabets.dtx} +} +%</dtx> % \end{macrocode} % -% \paragraph{Packages} -% Assuming people are running up-to-date packages. -% \begin{macrocode} -\RequirePackage{expl3,xparse,l3keys2e} -\RequirePackage{fontspec} -\RequirePackage{ucharcat} -\RequirePackage{fix-cm} % avoid some warnings (still necessary? check...) -\RequirePackage{filehook} -% \end{macrocode} -% \paragraph{Bifurcate} +% Now exit if we're using plain \TeX; this would usually be the case when +% loading this file with \texttt{unicode-math.ins}. % \begin{macrocode} -\ExplSyntaxOn -\sys_if_engine_luatex:T { \RequirePackageWithOptions{unicode-math-luatex} } -\sys_if_engine_xetex:T { \RequirePackageWithOptions{unicode-math-xetex} } -\ExplSyntaxOff +%<*dtx> +\def\tmpa{plain} +\ifx\tmpa\fmtname\expandafter\endinput\fi +%</dtx> % \end{macrocode} % +% Declare the package version and date. For loading this file directly +% as a \texttt{dtx} file, \cs{fileversion} and \cs{filedate} will be set +% correctly when using \cs{GetFileInfo} without having to load the package +% directly. % \begin{macrocode} -%</load> +%<base>\ProvidesPackage{unicode-math} +%<package&XE>\ProvidesPackage{unicode-math-xetex} +%<package&LU>\ProvidesPackage{unicode-math-luatex} +%<*dtx> +\ProvidesFile{unicode-math.dtx} +%</dtx> +%<*base|package> + [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX] +%</base|package> % \end{macrocode} -% -% That's the end of the base package. The subsequent packages are derived from -% the following ordered list of \texttt{dtx} files: -% \begin{multicols}{3} -% \begin{enumerate} -% \def\DTX#1{\item \texttt{#1}} -% \DTXFILES -% \end{enumerate} -% \end{multicols} -% -\endinput +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins b/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins new file mode 100644 index 00000000000..6279c56bd5b --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins @@ -0,0 +1,57 @@ +%%^^A%% unicode-math.ins -- part of UNICODE-MATH <wspr.io/unicode-math> + +\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi +\input unicode-math.dtx\relax +\input l3docstrip.tex\relax +\keepsilent + +\declarepreamble\defaultpreamble +------------------------------------------------ +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-2017 Will Robertson, LPPL "maintainer" +Copyright 2010-2017 Philipp Stephani +Copyright 2011-2017 Joseph Wright +Copyright 2012-2015 Khaled Hosny +------------------------------------------------ +\endpreamble + +\nopostamble +\askforoverwritefalse + +\generate{\file{unicode-math.sty}{ + \from{unicode-math.dtx}{base} + \from{um-code-base.dtx}{base} + }} + +\ifx\UMDEBUG\undefined\def\UMDEBUG{}\else\def\UMDEBUG{,debug}\fi + +\def\DTX#1{\from{#1}{package,XE\UMDEBUG}} +\generate{\file{unicode-math-xetex.sty}{\DTXFILES}} + +\def\DTX#1{\from{#1}{package,LU\UMDEBUG}} +\generate{\file{unicode-math-luatex.sty}{\DTXFILES}} + +\endbatchfile +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx b/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx new file mode 100644 index 00000000000..df10b66e401 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx @@ -0,0 +1,42 @@ +%%^^A%% unicode-math.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> + +\documentclass[a4paper]{ltxdoc} +\input{um-doc-style.tex} +\begin{document} + +\title{Experimental Unicode mathematical typesetting: The \pkg{unicode-math} package} +\author{\itshape Will Robertson\\\itshape Philipp Stephani, Joseph Wright, Khaled Hosny\\\url{http://github.com/wspr/unicode-math}} +\date{\umfiledate \qquad \umfileversion} + +\maketitle + +\input{um-doc.tex} + +\clearpage +\appendix + +\input{um-doc-stixextract.tex} +\input{um-doc-nfsssummary.tex} +\input{um-doc-legacyfontdimen.tex} +\input{um-doc-mathfontdimen.tex} + +\end{document} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx b/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx new file mode 100644 index 00000000000..908c74d3125 --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx @@ -0,0 +1,68 @@ +%%^^A%% unimath-example.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> + +%%%%%%%%%%%%%%%%%%%%%%% +% UNICODE-MATH EXAMPLE FILE +%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass{article} + +% Load fontspec and define a document font: +\usepackage{fontspec} +\setmainfont{texgyrepagella-regular.otf} + +% Load unicode-math and define a math font: +\usepackage{unicode-math} +\setmathfont{texgyrepagella-math.otf} + +\begin{document} +\title{An example of \textsf{unicode-math}} +\author{Will Robertson} +\maketitle + +This is an example of the \textsf{unicode-math} package. +It allows you to write maths with Unicode input and to use fonts that contain Unicode mathematical glyphs. Follow along in the source code to see how it works. + +After loading the package and selecting a font, you shouldn't need to change much to continue to write maths as always. +\[ + F(s)=\symscr L \{f(t)\}=\int_0^\infty \symup e^{-st}f(t)\,\symup d t +\] + +The style of Latin and Greek letters is set up by default to match the output of standard \LaTeX: Latin letters and Greek lowercase letters are italic, and Greek uppercase letters are upright. These can be configured with the \texttt{math-style} package option. + +One very important feature to recognise is that bold maths now works consistently for both Latin and Greek letters. By default, \verb|\symbf| will turn a Latin letter bold and upright, and a Greek letter will remain italic and also become bold. For example: +\[ + \symbf{a} = a\,\symbf{I} \qquad \symbf{\beta} = \beta\,\symbf{I} +\] +This behaviour can be configured with the \texttt{bold-style} package option. + +In the examples above, I've used \LaTeX\ commands to input characters like \verb|\beta|, \verb|\infty|, and so on. These may now be typed directly into the source of the document: +\[ + 𝐉 = ∇×𝐇 \qquad 𝐁 = μ₀(𝐌 + 𝐇) +\] +\[ + ∫₀³ xⁿφ₁₂(x)\,ⅆx +\] +It does not matter if you use upright or italic characters; they will be normalised according to the setting of the \texttt{math-style} and \texttt{bold-style} options. + +And that's a brief introduction to the package. Please see the documentation for further details. This is a new package; feedback, suggestions, and bug reports are all most welcome. + +\end{document} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ diff --git a/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx b/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx new file mode 100644 index 00000000000..e285099899c --- /dev/null +++ b/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx @@ -0,0 +1,502 @@ +%%^^A%% unimath-symbols.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> + +%!TEX TS-program = LuaLaTeX + +%%%%%%%%%%%%%%%%%%%%%%% +% SYMBOLS DEFINED BY UNICODE-MATH +%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass[final]{article} +\makeatletter + +\usepackage{ragged2e,setspace,booktabs,catchfile,shortvrb,geometry,metalogo,textcomp,longtable,tabu,hyperref} + +\geometry{margin=3cm} +\hypersetup{colorlinks,linkcolor=black} + +\def\cmd#1{\texttt{\textbackslash\expandafter\@gobble\string#1}} + +\usepackage{fontspec} +\setmainfont{texgyrepagella}% + [ + Extension = .otf , + UprightFont = *-regular, + ItalicFont = *-italic, + BoldFont = *-bold, + BoldItalicFont = *-bolditalic, + Ligatures=TeX, + Numbers={Lowercase,Monospaced}, + ] +\usepackage[math-style=literal,bold-style=literal]{unicode-math} + +\ExplSyntaxOn +\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {c} + +\def\defmathfont#1#2#3{ + \newcounter{#1} + \setcounter{#1}{-1} + \setmathfont[version=#1,SizeFeatures={ + {Size=-10, Colour=999999}, + {Size=10-, Colour=#3}}]{#2} + \fontspec_set_fontface:cNnn {#1} \x {ItalicFont={},BoldFont={}} {#2} +} +\ExplSyntaxOff + +\defmathfont{lm}{latinmodern-math.otf}{CC6666} +\defmathfont{xits}{xits-math.otf}{CCCC66} +\defmathfont{stix}{STIXMath-Regular.otf}{AA66CC} +\defmathfont{cambria}{Cambria Math}{66CCCC} +\defmathfont{asana}{Asana-Math.otf}{6666CC} +\defmathfont{pagella}{texgyrepagella-math.otf}{AA6666} +\defmathfont{dejavu}{texgyredejavu-math.otf}{AACC66} +\defmathfont{euler}{euler.otf}{CC66CC} + +\def\INPUT{\input{unicode-math-table.tex}} +\def\TABLE{% +\par\noindent +\begin{longtabu}[l]{@{}lcccccccclX[l]@{}} + \toprule + \textsc{usv} & M & X & S & C & A & P & D & E & Macro & Description \\ + \midrule \endhead + \INPUT\\ + \bottomrule +\end{longtabu} +} +\makeatletter +\def\USV#1{\footnotesize\scshape\MakeLowercase{u+\@gobble#1}} +\makeatother +\def\CMD#1{\footnotesize\cmd#1} +\def\DESC#1{% + \begin{spacing}{0.5} + \RaggedRight\scriptsize #1% + \end{spacing} +} + +\newcommand\SHOW[1]{% + \def\UnicodeMathSymbol##1##2##3##4{% + \def\1{#1}\def\2{##3}% + \ifx\1\2\PRINTLINE{##1}{##2}{##4}\fi + }% + \TABLE +} +\ExplSyntaxOn +\def\PRINTLINE#1#2#3{ + \def\tempa{ + \USV{#1} & + \SYMB{#2}{lm}{#1} & + \SYMB{#2}{xits}{#1} & + \SYMB{#2}{stix}{#1} & + \SYMB{#2}{cambria}{#1} & + \SYMB{#2}{asana}{#1} & + \SYMB{#2}{pagella}{#1} & + \SYMB{#2}{dejavu}{#1} & + \SYMB{#2}{euler}{#1} & + \CMD{#2} + \tl_if_in:NnT \PLAIN {#2} + { + \makebox[0pt][l] + { \color[gray]{0.7} \textsuperscript{\sffamily (p)} } + } + \tl_if_in:NnT \LTXSYM {#2} + { + \makebox[0pt][l] + { \color[gray]{0.7} \textsuperscript{\sffamily (l)} } + } + \tl_if_in:NnT \AMSSYMB {#2} + { + \makebox[0pt][l] + { \color[gray]{0.7} \textsuperscript{\sffamily (a)} } + } + & + \DESC{#3} \\ + }% + \expandafter\tempa +} +\ExplSyntaxOff +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1$% + \fi +} + +\def\PLAIN{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu\xi\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega\varepsilon\vartheta\varpi\varrho\varsigma\varphi\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega +% +\aleph\hbar\imath\jmath\ell\wp\Re\Im\partial\infty\prime\emptyset\nabla\surd\top\bot\angle\triangle\forall\exists\neg\flat\natural\sharp\clubsuit\diamondsuit\heartsuit\spadesuit +% +\coprod\bigvee\bigwedge\biguplus\bigcap\bigcup\int\prod\sum\bigotimes\bigoplus\bigodot\oint\bigsqcup\smallint +% +\triangleleft\triangleright\bigtriangleup\bigtriangledown\wedge\land\vee\lor\cap\cup\ddagger\dagger\sqcap\sqcup\uplus\amalg\diamond\bullet\wr\div\odot\oslash\otimes\ominus\oplus\mp\pm\circ\bigcirc\setminus\cdot\ast\times\star\propto\sqsubseteq\sqsupseteq\parallel\mid\dashv\vdash\nearrow\searrow\nwarrow\swarrow\Leftrightarrow\Leftarrow\Rightarrow\neq\ne\lnot\leq\le\geq\ge\succ\prec\approx\succeq\preceq\supset\subset\supseteq\subseteq\in\ni\owns\gg\ll\not\leftrightarrow\leftarrow\gets\rightarrow\to\mapstochar\mapsto\sim\simeq\perp\equiv\asymp\smile\frown\leftharpoonup\leftharpoondown\rightharpoonup\rightharpoondown +% +\joinrel\relbar\Relbar\lhook\hookrightarrow\rhook\hookleftarrow\bowtie\models\Longrightarrow\longrightarrow\longleftarrow\Longleftarrow\longmapsto\longleftrightarrow\Longleftrightarrow\iff +% +\ldotp\cdotp\colon\ldots\cdots\vdots\ddots +% +\acute\grave\ddot\tilde\bar\breve\check\hat\vec\dot\widetilde\widehat +% +\overrightarrow\overleftarrow\overbrace\underbrace\lmoustache\rmoustache\lgroup\rgroup\arrowvert\Arrowvert\bracevert\Vert\vert\uparrow\downarrow\updownarrow\Uparrow\Downarrow\Updownarrow\backslash\rangle\langle\rbrace\lbrace\rceil\lceil\rfloor\lfloor\sqrt} + +% /© +% +% ------------------------------------------------ +% 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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ + +\def\LTXSYM{ +\cong +\notin +\rightleftharpoons +\doteq +\mathring +} + +\def\AMSSYMB{\boxdot\boxplus\boxtimes\square\blacksquare\centerdot\lozenge\blacklozenge\circlearrowright\circlearrowleft\leftrightharpoons\boxminus\Vdash\Vvdash\vDash\twoheadrightarrow\twoheadleftarrow\leftleftarrows\rightrightarrows\upuparrows\downdownarrows\upharpoonright\restriction\downharpoonright\upharpoonleft\downharpoonleft\rightarrowtail\leftarrowtail\leftrightarrows\rightleftarrows\Lsh\Rsh\rightsquigarrow\leftrightsquigarrow\looparrowleft\looparrowright\circeq\succsim\gtrsim\gtrapprox\multimap\therefore\because\doteqdot\Doteq\triangleq\precsim\lesssim\lessapprox\eqslantless\eqslantgtr\curlyeqprec\curlyeqsucc\preccurlyeq\leqq\leqslant\lessgtr\backprime\risingdotseq\fallingdotseq\succcurlyeq\geqq\geqslant\gtrless\vartriangleright\vartriangleleft\trianglerighteq\trianglelefteq\bigstar\between\blacktriangledown\blacktriangleright\blacktriangleleft\vartriangle\blacktriangle\triangledown\eqcirc\lesseqgtr\gtreqless\lesseqqgtr\gtreqqless\Rrightarrow\Lleftarrow\veebar\barwedge\doublebarwedge\measuredangle\sphericalangle\varpropto\smallsmile\smallfrown\Subset\Supset\Cup\doublecup\Cap\doublecap\curlywedge\curlyvee\leftthreetimes\rightthreetimes\subseteqq\supseteqq\bumpeq\Bumpeq\lll\llless\ggg\gggtr\circledS\pitchfork\dotplus\backsim\backsimeq\complement\intercal\circledcirc\circledast\circleddash\lvertneqq\gvertneqq\nleq\ngeq\nless\ngtr\nprec\nsucc\lneqq\gneqq\nleqslant\ngeqslant\lneq\gneq\npreceq\nsucceq\precnsim\succnsim\lnsim\gnsim\nleqq\ngeqq\precneqq\succneqq\precnapprox\succnapprox\lnapprox\gnapprox\nsim\ncong\diagup\diagdown\varsubsetneq\varsupsetneq\nsubseteqq\nsupseteqq\subsetneqq\supsetneqq\varsubsetneqq\varsupsetneqq\subsetneq\supsetneq\nsubseteq\nsupseteq\nparallel\nmid\nshortmid\nshortparallel\nvdash\nVdash\nvDash\nVDash\ntrianglerighteq\ntrianglelefteq\ntriangleleft\ntriangleright\nleftarrow\nrightarrow\nLeftarrow\nRightarrow\nLeftrightarrow\nleftrightarrow\divideontimes\varnothing\nexists\Finv\Game\eth\eqsim\beth\gimel\daleth\lessdot\gtrdot\ltimes\rtimes\shortmid\shortparallel\smallsetminus\thicksim\thickapprox\approxeq\succapprox\precapprox\curvearrowleft\curvearrowright\digamma\varkappa\Bbbk\hslash\backepsilon} + +\input{unicode-math.dtx} +\makeatletter +\def\GetFileInfo#1{% + \def\filename{#1}% + \def\@tempb##1 ##2 ##3\relax##4\relax{% + \def\filedate{##1}% + \def\fileversion{##2}% + \def\fileinfo{##3}}% + \edef\@tempa{\csname ver@#1\endcsname}% + \expandafter\@tempb\@tempa\relax? ? \relax\relax} +\makeatother +\GetFileInfo{unicode-math.dtx} +\let\umfiledate\filedate +\let\umfileversion\fileversion + +\begin{document} +\MakeShortVerb\| +\title{Every symbol (most symbols) defined by \textsf{unicode-math}} +\author{Will Robertson} +\date{\umfiledate \qquad \umfileversion} +\maketitle + +This document uses the file \texttt{unicode-math-table.tex} +to print every symbol defined by the \textsf{unicode-math} +package. +Use this document to find the command name or the Unicode glyph slot for a symbol that you wish to use. +The following fonts are shown: (with approximate symbol counts) +\begin{itemize} +\item[M] \mathversion{lm} $\mathup{Latin\ Modern\ Math}$ (\ref{count:lm}) +\item[X] \mathversion{xits} $\mathup{XITS\ Math}$ (\ref{count:xits}) +\item[S] \mathversion{stix} $\mathup{STIX\ Math}$ (\ref{count:stix}) +\item[C] \mathversion{cambria} $\mathup{Cambria\ Math}$ (\ref{count:cambria}) +\item[A] \mathversion{asana} $\mathup{Asana\ Math}$ (\ref{count:asana}) +\item[P] \mathversion{pagella} $\mathup{TeX\ Gyre\ Pagella\ Math}$ (\ref{count:pagella}) +\item[D] \mathversion{dejavu} $\mathup{DejaVu\ Math\ TeX\ Gyre}$ (\ref{count:dejavu}) +\item[E] \mathversion{euler} $\mathup{Neo\ Euler}$ (\ref{count:euler}) +\end{itemize} +Note that there are addition maths fonts in the `\TeX\ Gyre' collection which aren't included here. + +Symbols defined in Plain \TeX\ are indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (p)}} after their macro name. +\LaTeX\ follows Plain \TeX, but defines a handful more, indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (l)}} +Symbols defined in \textsf{amssymb} are indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (a)}}. + +\tableofcontents + +\clearpage +\section{Opening symbols, \cmd\mathopen} +\begingroup +\def\sqrt{\sqrtsign{}} +\def\longdivision{\longdivisionsign{}} +\SHOW\mathopen +\endgroup + +\clearpage +\section{Closing symbols, \cmd\mathclose} +\SHOW\mathclose + +\clearpage +\section{Fence symbols, \cmd\mathfence} +\SHOW\mathfence + +\section{Punctuation symbols, \cmd\mathpunct} +\SHOW\mathpunct + +\section{`Over' symbols, \cmd\mathover} +\begingroup +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle #1{\mitx+\mity}$% + \fi +} +\SHOW\mathover +\endgroup + + +\section{`Under' symbols, \cmd\mathunder} +\begingroup +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle #1{\mitx+\mity}$% + \fi +} +\SHOW\mathunder +\endgroup + +\clearpage +\section{Accents, \cmd\mathaccent} + +Note that accents will only be properly placed if used with an OpenType font with the necessary information. + +\begingroup +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1 \mitx$% + \fi +} +\SHOW\mathaccent +\endgroup + +\section{Bottom accents, \cmd\mathbotaccent} +\begingroup +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \refstepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1 \mitx$% + \fi +} +\SHOW\mathbotaccent +\endgroup + +\clearpage +\section{Big operators, \cmd\mathop} + +Of the operators shown below, a subset need to be flagged by \textsf{unicode-math} for \cmd\nolimits\ adjustments. +The limits behaviour as specified by \textsf{unicode-math} are shown with grey subscripts and superscripts. +\begingroup +\def\SYMB#1#2#3{% + \expandafter\iffontchar\csname#2\endcsname #3\relax + \stepcounter{#2}% + \mathversion{#2}% + $\displaystyle#1_0^1$% + \fi +} +\SHOW\mathop +\endgroup + +\section{Binary relations, \cmd\mathbin} +\SHOW\mathbin + +\clearpage +\section{Ordinary symbols, \cmd\mathord} +\SHOW\mathord + +\clearpage +\section{Relation symbols, \cmd\mathrel} +\SHOW\mathrel + +\clearpage +\section{Alphabetical symbols, \cmd\mathalpha} + +% first read in all \mathalpha symbols into a variable: +\ExplSyntaxOn +\cs_set:Npn \UnicodeMathSymbol #1#2#3#4 { + \str_if_eq:nnT {\mathalpha} {#3} { + \exp_not:n { \UnicodeMathSymbol {#1}{#2}{#3}{#4} } + } +} +\CatchFileEdef + \ALPHA{unicode-math-table.tex} + {\char_set_catcode_space:N \ } + +% now each time we print an alphabet we remove the slot; +% this ensures we won't miss anything + +\def\INPUT{\ALPHA} +\cs_new:Npn \SLOTS #1#2 { + \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { + \bool_lazy_and:nnT + { \int_compare_p:n {##1 >= #1} } + { \int_compare_p:n {##1 <= #2} } + { + \PRINTLINE{##1}{##2}{##4} + } + } + \TABLE + \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 { + \bool_lazy_or:nnT + { \int_compare_p:n {##1 > #2} } + { \int_compare_p:n {##1 < #1} } + { + \exp_not:n { \UnicodeMathSymbol {##1}{##2}{##3}{##4} } + } + } + \edef\ALPHA{\ALPHA} +} + +\ExplSyntaxOff + +\subsection{Normal weight} + +\subsubsection{Upright Greek, uppercase} +\SLOTS{"00391}{"003A9} + +\subsubsection{Upright Greek, lowercase} +\SLOTS{"003B1}{"003F5} + +\subsubsection{Italic, Latin, uppercase} +\SLOTS{"1D434}{"1D44D} + +\subsubsection{Italic, Latin, lowercase} +\SLOTS{"1D44E}{"1D467} + +\subsubsection{Italic Greek, uppercase} +\SLOTS{"1D6E2}{"1D6FA} + +\subsubsection{Italic Greek, lowercase} +\SLOTS{"1D6FC}{"1D71B} + +\subsubsection{Script, Latin, uppercase} +\SLOTS{"1D49C}{"1D4B5} + +\subsubsection{Script, Latin, lowercase} +\SLOTS{"1D4B6}{"1D4CF} + +\subsubsection{Fraktur, Latin, uppercase} +\SLOTS{"1D504}{"1D51C} + +\subsubsection{Fraktur, Latin, lowercase} +\SLOTS{"1D51E}{"1D537} + +\subsubsection{Blackboard, Latin, uppercase} +\SLOTS{"1D538}{"1D550} + +\subsubsection{Blackboard, Latin, lowercase} +\SLOTS{"1D552}{"1D56B} + +\subsubsection{Sans serif, Latin, uppercase} +\SLOTS{"1D5A0}{"1D5B9} + +\subsubsection{Sans serif, Latin, lowercase} +\SLOTS{"1D5BA}{"1D5D3} + +\subsubsection{Italic sans serif, Latin, uppercase} +\SLOTS{"1D608}{"1D621} + +\subsubsection{Italic sans serif, Latin, lowercase} +\SLOTS{"1D622}{"1D63B} + +\subsubsection{Typewriter, Latin, uppercase} +\SLOTS{"1D670}{"1D689} + +\subsubsection{Typewriter, Latin, lowercase} +\SLOTS{"1D68A}{"1D6A3} + +\subsection{Bold} + +\subsubsection{Bold, Latin, uppercase} +\SLOTS{"1D400}{"1D419} + +\subsubsection{Bold, Latin, lowercase} +\SLOTS{"1D41A}{"1D433} + +\subsubsection{Bold Greek, uppercase} +\SLOTS{"1D6A8}{"1D6C0} + +\subsubsection{Bold Greek, lowercase} +\SLOTS{"1D6C2}{"1D6E1} + +\subsubsection{Bold italic, Latin, uppercase} +\SLOTS{"1D468}{"1D481} + +\subsubsection{Bold italic, Latin, lowercase} +\SLOTS{"1D482}{"1D49B} + +\subsubsection{Bold italic Greek, uppercase} +\SLOTS{"1D71C}{"1D734} + +\subsubsection{Bold italic Greek, lowercase} +\SLOTS{"1D736}{"1D755} + +\subsubsection{Bold script, Latin, uppercase} +\SLOTS{"1D4D0}{"1D4E9} + +\subsubsection{Bold script, Latin, lowercase} +\SLOTS{"1D4EA}{"1D503} + +\subsubsection{Bold fraktur, Latin, uppercase} +\SLOTS{"1D56C}{"1D585} + +\subsubsection{Bold fraktur, Latin, lowercase} +\SLOTS{"1D586}{"1D59F} + +\subsubsection{Bold sans serif, Latin, uppercase} +\SLOTS{"1D5D4}{"1D5ED} + +\subsubsection{Bold sans serif, Latin, lowercase} +\SLOTS{"1D5EE}{"1D607} + +\subsubsection{Bold italic sans serif, Latin, uppercase} +\SLOTS{"1D63C}{"1D655} + +\subsubsection{Bold italic sans serif, Latin, lowercase} +\SLOTS{"1D656}{"1D66F} + +\subsubsection{Bold sans serif Greek, uppercase} +\SLOTS{"1D756}{"1D76E} + +\subsubsection{Bold sans serif Greek, lowercase} +\SLOTS{"1D770}{"1D78F} + +\subsubsection{Bold italic sans serif Greek, uppercase} +\SLOTS{"1D790}{"1D7A8} + +\subsubsection{Bold italic sans serif Greek, lowercase} +\SLOTS{"1D7AA}{"1D7C9} + +\subsection{Miscellaneous} +\def\UnicodeMathSymbol#1#2#3#4{\PRINTLINE{#1}{#2}{#4}} +\TABLE + +\refstepcounter{lm}\label{count:lm} +\refstepcounter{xits}\label{count:xits} +\refstepcounter{stix}\label{count:stix} +\refstepcounter{cambria}\label{count:cambria} +\refstepcounter{asana}\label{count:asana} +\refstepcounter{pagella}\label{count:pagella} +\refstepcounter{euler}\label{count:euler} +\refstepcounter{dejavu}\label{count:dejavu} + +\end{document} + +\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-2017 Will Robertson, LPPL "maintainer" +% Copyright 2010-2017 Philipp Stephani +% Copyright 2011-2017 Joseph Wright +% Copyright 2012-2015 Khaled Hosny +% ------------------------------------------------ +% +% ©/ |