diff options
Diffstat (limited to 'macros/latex/contrib/unicode-math/um-code-mathtext.dtx')
-rw-r--r-- | macros/latex/contrib/unicode-math/um-code-mathtext.dtx | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/macros/latex/contrib/unicode-math/um-code-mathtext.dtx b/macros/latex/contrib/unicode-math/um-code-mathtext.dtx index 602ba01352..d002483378 100644 --- a/macros/latex/contrib/unicode-math/um-code-mathtext.dtx +++ b/macros/latex/contrib/unicode-math/um-code-mathtext.dtx @@ -32,10 +32,10 @@ \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} + \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\shapedefault} } - \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault} + \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\shapedefault} % integrate with fontspec's \setmathrm etc: \tl_case:Nn #1 @@ -169,35 +169,48 @@ % % \subsubsection{Maths font} % -% If the maths fonts are set explicitly, then the text commands above will not execute their branches to set the maths font alphabets. +% If the maths fonts are set explicitly, then the text commands above will not execute +% their branches to set the maths font alphabets. +% +% Helper macro for looking up customisable series' by family (new \LaTeXe\ feature 2020). +% \begin{macrocode} +\cs_new:Nn \@@_rm_series_default:n + { + \ifcsname #1series@rm\endcsname + \csname #1series@rm\endcsname + \else + \csname #1default\endcsname + \fi + } +% \end{macrocode} % \begin{macrocode} \@@_cs_set:Nn \__fontspec_setmathrm_hook:nn { - \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault - \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault - \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault + \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl{\@@_rm_series_default:n {md}}\shapedefault + \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl{\@@_rm_series_default:n {md}}\itdefault + \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl{\@@_rm_series_default:n {bf}}\shapedefault } % \end{macrocode} % \begin{macrocode} \@@_cs_set:Nn \__fontspec_setboldmathrm_hook:nn { - \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\updefault - \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\bfdefault\updefault + \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl{\@@_rm_series_default:n {md}}\shapedefault + \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl{\@@_rm_series_default:n {bf}}\shapedefault \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\itdefault } % \end{macrocode} % \begin{macrocode} \@@_cs_set:Nn \__fontspec_setmathsf_hook:nn { - \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault - \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault + \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl{\@@_rm_series_default:n {md}}\shapedefault + \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl{\@@_rm_series_default:n {bf}}\shapedefault } % \end{macrocode} % \begin{macrocode} \@@_cs_set:Nn \__fontspec_setmathtt_hook:nn { - \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault - \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault + \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl{\@@_rm_series_default:n {md}}\shapedefault + \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl{\@@_rm_series_default:n {bf}}\shapedefault } % \end{macrocode} % |