summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/unicode-math
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-10 20:56:13 +0000
committerKarl Berry <karl@freefriends.org>2015-09-10 20:56:13 +0000
commitca4208ab5d96c12b345e9ebe3462cb7dfb81591c (patch)
tree52ea0a999a7515cc798b1b4c0f1a377b4c93ef7a /Master/texmf-dist/source/latex/unicode-math
parentd6daef3a658568116139bd1b33b00599207157f0 (diff)
unicode-math (10sep15)
git-svn-id: svn://tug.org/texlive/trunk@38337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/unicode-math')
-rw-r--r--Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx4
-rw-r--r--Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx133
2 files changed, 63 insertions, 74 deletions
diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx b/Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx
index 6ab6f351241..f7768095976 100644
--- a/Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx
+++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math-compat.dtx
@@ -217,7 +217,7 @@
&& \int_compare_p:nNn { \leftroot@ } = { \c_zero }
}
{
- \luatexUroot \l_@@_radical_sqrt_tl { #1 } { #2 }
+ \Uroot \l_@@_radical_sqrt_tl { #1 } { #2 }
}
{
\hbox_set:Nn \rootbox
@@ -258,7 +258,7 @@
\mskip \uproot@ mu
\c_math_toggle_token
}
- \luatexUroot \l_@@_radical_sqrt_tl
+ \Uroot \l_@@_radical_sqrt_tl
{
\box_move_up:nn { \box_wd:N \l_tmpa_box }
{
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 848935c481b..3f4faf47fe0 100644
--- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
+++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
@@ -69,7 +69,7 @@ This work is "maintained" by Will Robertson.
%<preamble&XE>\ProvidesPackage{unicode-math-xetex}
%<preamble&LU>\ProvidesPackage{unicode-math-luatex}
%<*preamble>
- [2014/08/06 v0.8a Unicode maths in XeLaTeX and LuaLaTeX]
+ [2015/09/09 v0.8b Unicode maths in XeLaTeX and LuaLaTeX]
%</preamble>
%<*internal>
\def\DOCUMENTEND{F}
@@ -136,6 +136,7 @@ This work is "maintained" by Will Robertson.
% \paragraph{Packages}
% \begin{macrocode}
\RequirePackage{expl3}[2015/03/01]
+\RequirePackage{ucharcat}
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
\RequirePackage{fontspec}[2015/03/14]
@@ -148,6 +149,11 @@ This work is "maintained" by Will Robertson.
\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}
@@ -370,7 +376,7 @@ This work is "maintained" by Will Robertson.
%
% Rather than `readable', in the end, this makes the code more extensible.
% \begin{macrocode}
-\cs_new:Nn \usv_set:nnn
+\cs_new:Nn \usv_set:nnn
{ \tl_set:cn { g_@@_#1_#2_usv } {#3} }
\cs_new:Nn \@@_to_usv:nn
{ \use:c { g_@@_#1_#2_usv } }
@@ -637,7 +643,7 @@ This work is "maintained" by Will Robertson.
}
\use:c {@@_setup_active_frac:}
}
-
+
{normalsize}
{
\bool_set_false:N \l_@@_smallfrac_bool
@@ -845,9 +851,9 @@ This work is "maintained" by Will Robertson.
\@@_char_gmake_mathactive:n {#3}
\@@_active_char_set:wc #3 \q_nil { \cs_to_str:N #2 _sym }
\group_end:
-
+
\@@_set_mathchar:cNnn {\cs_to_str:N #2 op} \mathop {#1} {#3}
-
+
\cs_gset:cpx { \cs_to_str:N #2 _sym }
{
\exp_not:c { \cs_to_str:N #2 op }
@@ -958,18 +964,18 @@ This work is "maintained" by Will Robertson.
\DeclareDocumentCommand \setmathfontface { m O{} m O{} }
{
\tl_clear:N \l_@@_mversion_tl
-
+
\keys_set_known:nnN {@@_mathface} {#2,#4} \l_@@_keyval_clist
\exp_args:Nnx \fontspec_set_family:Nxn \l_@@_tmpa_tl
{ ItalicFont={}, BoldFont={}, \exp_not:V \l_@@_keyval_clist } {#3}
-
+
\tl_if_empty:NT \l_@@_mversion_tl
{
\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:
\tl_case:Nn #1
{
@@ -1001,7 +1007,7 @@ This work is "maintained" by Will Robertson.
%
% \subsubsection{Text font}
% \begin{macrocode}
-\cs_generate_variant:Nn \tl_if_eq:nnT {o}
+\cs_generate_variant:Nn \tl_if_eq:nnT {o}
\cs_set:Nn \__fontspec_setmainfont:nn
{
\fontspec_set_family:Nnn \rmdefault {#1}{#2}
@@ -1122,7 +1128,7 @@ This work is "maintained" by Will Robertson.
\bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool }
{
\@@_declare_math_sizes:
- \@@_fontspec_select_font:
+ \@@_fontspec_select_font:
}
% \end{macrocode}
% Now define |\@@_symfont_tl| as the \LaTeX\ math font to access everything:
@@ -1523,7 +1529,7 @@ This work is "maintained" by Will Robertson.
% 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
@@ -1665,12 +1671,16 @@ This work is "maintained" by Will Robertson.
% \begin{macro}{\@@_new_cramped_style:N}
% \darg{command}
% Define \meta{command} as a new cramped style switch.
-% For \LuaTeX, simply rename the correspronding primitive.
+% For \LuaTeX, simply rename the correspronding primitive if it is not
+% already defined.
% For \XeTeX, define \meta{command} as a new quark.
% \begin{macrocode}
\cs_new_protected_nopar:Nn \@@_new_cramped_style:N
%<XE> { \quark_new:N #1 }
-%<LU> { \cs_new_eq:Nc #1 { luatex \cs_to_str:N #1 } }
+%<LU> {
+%<LU> \cs_if_exist:NF #1
+%<LU> { \cs_new_eq:Nc #1 { luatex \cs_to_str:N #1 } }
+%<LU> }
% \end{macrocode}
% \end{macro}
%
@@ -2011,24 +2021,24 @@ This work is "maintained" by Will Robertson.
% \begin{macrocode}
\prg_new_conditional:Nnn \@@_if_mathalph_decl:n {TF}
{
- \tl_set:Nn \l_@@_tmpa_tl {#1}
+ \tl_set:Nn \l_@@_tmpa_tl {#1}
\tl_clear:N \l_@@_tmpb_tl
\tl_clear:N \l_@@_tmpc_tl
-
+
\tl_if_in:NnT \l_@@_tmpa_tl {->}
{ \exp_after:wN \@@_split_arrow:w \l_@@_tmpa_tl \q_nil }
-
+
\tl_if_in:NnT \l_@@_tmpa_tl {/}
{ \exp_after:wN \@@_split_slash:w \l_@@_tmpa_tl \q_nil }
-
- \tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl }
+
+ \tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl }
\exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \math }
\exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \sym }
\tl_trim_spaces:N \l_@@_tmpa_tl
\tl_if_empty:NT \l_@@_tmpc_tl
{ \tl_set_eq:NN \l_@@_tmpc_tl \l_@@_tmpa_tl }
-
+
\seq_if_in:NVTF \g_@@_named_ranges_seq \l_@@_tmpa_tl
{ \prg_return_true: } { \prg_return_false: }
}
@@ -2326,7 +2336,7 @@ This work is "maintained" by Will Robertson.
\clist_set:Nn \g_@@_named_ranges_clist
{
up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal,
- frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf
+ frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf
}
\clist_map_inline:Nn \g_@@_named_ranges_clist
{ \@@_new_named_range:n {#1} }
@@ -2427,7 +2437,7 @@ This work is "maintained" by Will Robertson.
% The following are alphabets which do not have a math/text ambiguity.
% \begin{macrocode}
\clist_map_inline:nn
- {
+ {
normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
}
@@ -2477,7 +2487,7 @@ This work is "maintained" by Will Robertson.
% \begin{document}
% \makeatletter
% ${\operator@font Mod}\, x$
-%
+%
% \def\operator@font{%
% \let \math@bgroup \relax
% \def \math@egroup {\let \math@bgroup \@@math@bgroup
@@ -2496,7 +2506,7 @@ This work is "maintained" by Will Robertson.
% \begin{document}
% \makeatletter
% ${\operator@font Mod}\, x$
-%
+%
% \def\operator@font{\mathgroup\symfoo}
% ${\operator@font Mod}\, x$
% \end{document}
@@ -2560,7 +2570,7 @@ This work is "maintained" by Will Robertson.
\prop_get:cnN { g_@@_named_range_ \l_@@_style_tl _prop }
{ default-alpha } \l_@@_alphabet_clist
}
-
+
\@@_setup_math_alphabet:
}
\seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } }
@@ -2980,10 +2990,17 @@ This work is "maintained" by Will Robertson.
%
% \section{Definitions of the active math characters}
%
-% Here we define every Unicode math codepoint an equivalent macro name.
-% The two are equivalent, in a |\let\xyz=^^^^1234| kind of way.
-%
% \begin{macro}{\@@_cs_set_eq_active_char:Nw}
+% This macro is used to give each Unicode math codepoint an equivalent macro name.
+% The two are equivalent, in a |\let\xyz=^^^^1234| kind of way. (For now!!)
+% \begin{macrocode}
+\cs_set:Npn \@@_cs_set_eq_active_char:Nw #1 = "#2 \q_nil
+ {
+ \exp_last_unbraced:NNx \cs_gset_eq:NN #1 { \Ucharcat "#2 ~ 12 ~ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_active_char_set:wc}
% We need to do some trickery to transform the |\_@@_sym:nnn| argument
% |"ABCDEF| into the \XeTeX\ `caret input' form |^^^^^abcdef|. It is \emph{very important}
@@ -2995,30 +3012,6 @@ This work is "maintained" by Will Robertson.
% \begin{macrocode}
\group_begin:
\char_set_catcode_other:N \^
- \cs_gset:Npn \@@_cs_set_eq_active_char:Nw #1 = "#2 \q_nil
- {
- \tex_lowercase:D
- {
- \tl_rescan:nn
- {
- \ExplSyntaxOn
- \char_set_catcode_other:N \{
- \char_set_catcode_other:N \}
- \char_set_catcode_other:N \&
- \char_set_catcode_other:N \%
- \char_set_catcode_other:N \$
- }
- {
- \cs_gset_eq:NN #1 ^^^^^#2
- }
- }
- }
-% \end{macrocode}
-% Making |^| the right catcode isn't strictly necessary right now but it helps
-% to future proof us with, e.g., breqn.
-% Because we're inside a |\tl_rescan:nn|, use plain old \TeX\ syntax to avoid
-% any catcode problems.
-% \begin{macrocode}
\cs_new:Npn \@@_active_char_set:wc "#1 \q_nil #2
{
\tex_lowercase:D
@@ -3029,7 +3022,10 @@ This work is "maintained" by Will Robertson.
}
\group_end:
% \end{macrocode}
-% \end{macro}
+% Could be defined simply as the following if Ucharcar allowed active chars!
+% \begin{Verbatim}
+% \exp_last_unbraced:Nx \cs_gset_protected_nopar:Npx { \Ucharcat "#2 ~ 13 ~ } { \exp_not:c {#2} }
+% \end{Verbatim}
% \end{macro}
%
% Now give \cmd\_@@_sym:nnn\ a definition in terms of \cmd\@@_cs_set_eq_active_char:Nw\
@@ -3045,7 +3041,7 @@ This work is "maintained" by Will Robertson.
\char_set_catcode_math_superscript:N \^
\cs_set:Npn \_@@_sym:nnn ##1##2##3
{
- \tl_if_in:nnT
+ \tl_if_in:nnT
{ \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence }
{##3}
{
@@ -3057,22 +3053,6 @@ This work is "maintained" by Will Robertson.
\group_end:
}
% \end{macrocode}
-% Fix \cs{backslash}, which is defined as the escape char character
-% above:
-% \begin{macrocode}
-\group_begin:
- \lccode`\*=`\\
- \char_set_catcode_escape:N \|
- \char_set_catcode_other:N \\
- |lowercase
- {
- |AtBeginDocument
- {
- |let|backslash=*
- }
- }
-|group_end:
-% \end{macrocode}
%
% \section{Fall-back font}
%
@@ -3261,7 +3241,7 @@ This work is "maintained" by Will Robertson.
\cs_new:Nn \@@_scanprime_collect:N
{
\int_incr:N \l_@@_primecount_int
- \peek_meaning_remove:NTF '
+ \peek_meaning_remove:NTF '
{ \@@_scanprime_collect:N #1 }
{
\peek_meaning_remove:NTF \@@_scan_prime:
@@ -3442,6 +3422,15 @@ This work is "maintained" by Will Robertson.
%
% \subsection{Unicode radicals}
%
+% Make sure \cs{Uroot} is defined in the case where the \LaTeX{}
+% kernel doesn't make it available with its native name.
+% \begin{macrocode}
+%<*LU>
+\cs_if_exist:NF \Uroot
+ { \cs_new_eq:NN \Uroot \luatexUroot }
+%</LU>
+% \end{macrocode}
+%
% \begin{macrocode}
\AtBeginDocument{\@@_redefine_radical:}
\cs_new:Nn \@@_redefine_radical:
@@ -3493,7 +3482,7 @@ This work is "maintained" by Will Robertson.
% \begin{macrocode}
\cs_set:Npn \root ##1 \of ##2
{
- \luatexUroot \l_@@_radical_sqrt_tl { ##1 } { ##2 }
+ \Uroot \l_@@_radical_sqrt_tl { ##1 } { ##2 }
}
% \end{macrocode}
% \end{macro}
@@ -3820,7 +3809,7 @@ This work is "maintained" by Will Robertson.
% \end{macrocode}
% These are names that are `frozen' in HTML but have dumb names:
% \begin{macrocode}
-\def\dbkarow {\dbkarrow}
+\def\dbkarow {\dbkarrow}
\def\drbkarow{\drbkarrow}
\def\hksearow{\hksearrow}
\def\hkswarow{\hkswarrow}