summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx')
-rw-r--r--Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx59
1 files changed, 40 insertions, 19 deletions
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 ceaca6ea596..76fb00e32b6 100644
--- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
+++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
@@ -31,7 +31,7 @@ This work is "author-maintained" by Will Robertson.
%</internal>
%<preamble>\ProvidesPackage{unicode-math}
%<*preamble>
- [2010/09/19 v0.5b Unicode maths in XeLaTeX and LuaLaTeX]
+ [2010/09/27 v0.5b Unicode maths in XeLaTeX and LuaLaTeX]
%</preamble>
%<*internal>
\documentclass{ltxdoc}
@@ -266,6 +266,13 @@ This work is "author-maintained" by Will Robertson.
% the same math type, such as \cs{mathopen}, or complete math alphabets such as \cs{mathbb}.
% (Only numerical slots, however, can be used in ranged declarations.)
%
+% \paragraph{\XeTeX\ users only}
+% \XeTeX\ uses the first maths font selected for choosing various parameters
+% such as the thickness of fraction rules and so on.
+% (In \LuaTeX, they are chosen automatically based on the current font.)
+% To select a new font for these parameters use \cs{resetmathfont},
+% which behaves identically to \cs{setmathfont}.
+%
% \subsubsection{Control over maths alphabets}
%
% Exact control over maths alphabets can be somewhat involved.
@@ -1054,6 +1061,7 @@ This work is "author-maintained" by Will Robertson.
\bool_new:N \l_um_ot_math_bool
\bool_new:N \l_um_init_bool
\bool_new:N \l_um_implicit_alph_bool
+\bool_new:N \g_um_mainfont_set_bool
% \end{macrocode}
% For \opt{math-style}:
% \begin{macrocode}
@@ -2255,18 +2263,14 @@ This work is "author-maintained" by Will Robertson.
\keys_set:nn {unicode-math} {#1}
\um_fontspec_select_font:n {#2}
% \end{macrocode}
-% Check for the correct number of \cs{fontdimen}s:
-% \begin{macrocode}
-%% \ifdim \dimexpr\fontdimen9\l_um_font*65536\relax =65pt\relax
-%% \bool_set_true:N \l_um_ot_math_bool
-%% \else
-%% \bool_set_false:N \l_um_ot_math_bool
-%% \PackageWarningNoLine{unicode-math}{
-%% The~ font~ '#2' ~is~ not~ a~ valid~ OpenType~ maths~ font.~
-%% Some~ maths~ features~ will~ not~ be~ available~ or~ behave~
-%% in~ a~ substandard~ manner
-%% }
-%% \fi
+% Check whether we're using a real maths font:
+% \begin{macrocode}
+ \group_begin:
+ \fontfamily{\zf@family}\selectfont
+ \fontspec_if_script:nTF {math}
+ {\bool_gset_true:N \l_um_ot_math_bool}
+ {\bool_gset_false:N \l_um_ot_math_bool}
+ \group_end:
% \end{macrocode}
% If we're defining the full Unicode math repetoire, then we skip all
% the parsing processing needed if we're only defining a subset.
@@ -2299,6 +2303,13 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\DeclareSymbolFont{\um_symfont_tl}
{\encodingdefault}{\zf@family}{\mddefault}{\updefault}
+ \bool_if:nT {\l_um_ot_math_bool && !\g_um_mainfont_set_bool} {
+ \bool_set_true:N \g_um_mainfont_set_bool
+ \DeclareSymbolFont{symbols}
+ {\encodingdefault}{\zf@family}{\mddefault}{\updefault}
+ \DeclareSymbolFont{largesymbols}
+ {\encodingdefault}{\zf@family}{\mddefault}{\updefault}
+ }
% \end{macrocode}
% And now we input every single maths char.
% \begin{macrocode}
@@ -2325,6 +2336,16 @@ This work is "author-maintained" by Will Robertson.
% \end{macro}
%
%
+% \begin{macro}{\resetmathfont}
+% \begin{macrocode}
+\DeclareDocumentCommand \resetmathfont { O{} m } {
+ \bool_set_false:N \g_um_mainfont_set_bool
+ \setmathfont[#1]{#2}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\um_fontspec_select_font:}
% Select the font with \cs{fontspec} and define \cs{l_um_font} from it.
% \begin{macrocode}
@@ -2630,11 +2651,11 @@ This work is "author-maintained" by Will Robertson.
% \subsection{OpenType maths font features}
% \begin{macrocode}
\xetex_or_luatex:nnn { \um@zf@feature {ScriptStyle} }
- { \zf@update@ff{+ssty=0} }
- { \zf@update@ff{+ssty=1} }
+ { \fontspec_update_featstr:n {+ssty=0} }
+ { \fontspec_update_featstr:n {+ssty=1} }
\xetex_or_luatex:nnn { \um@zf@feature {ScriptScriptStyle} }
- { \zf@update@ff{+ssty=1} }
- { \zf@update@ff{+ssty=2} }
+ { \fontspec_update_featstr:n {+ssty=1} }
+ { \fontspec_update_featstr:n {+ssty=2} }
% \end{macrocode}
%
% \subsection{Script and scriptscript font options}
@@ -3130,7 +3151,7 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\clist_map_inline:nn {#2} {
\cs_if_exist:cT {um_config_ \l_um_style_tl _##1:n} {
- \tl_if_eq:nnTF {##1}{misc} {
+ \str_if_eq:nnTF {##1}{misc} {
\um_maybe_init_alphabet:V \l_um_style_tl
\clist_map_break:
}{
@@ -3146,7 +3167,7 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\clist_map_inline:nn {#2} {
\cs_if_exist:cT {um_config_ \l_um_style_tl _##1:n} {
- \tl_if_eq:nnTF {##1}{misc} {
+ \str_if_eq:nnTF {##1}{misc} {
\um_trace:nx {setup-alph} {math \l_um_style_tl~(##1)}
\use:c {um_config_ \l_um_style_tl _##1:n} {#3}
}{