When using the mathspec package, is it possible to have more than one math digits font in different places in the same document.
Mostly, I want the font for my math digits to be the same as my main text font, but at some places I use Eastern Arabic numerals within the math environment, so I want to be able to switch to a font that has these unicode characters. (Yes, I could choose a font that has these defined as my main text font, but that is not the optimal solution at the moment.)
Here is a minimal example, which helps explain what I am trying to do.
\documentclass[a4paper,12pt]{article}
\usepackage[MnSymbol]{mathspec}
\setmainfont[Mapping=tex-text]{Junicode}
\setmathsfont(Digits){Junicode} % XITS Math
\setmathsfont(Symbols){XITS Math}
\setmathsfont(Latin){Junicode}
\setmathrm{Junicode}
\def\offsetdigits#1{%
\xoffset{#1}0%
\xoffset{#1}1%
\xoffset{#1}2%
\xoffset{#1}3%
\xoffset{#1}4%
\xoffset{#1}5%
\xoffset{#1}6%
\xoffset{#1}7%
\xoffset{#1}8%
\xoffset{#1}9}
\def\xoffset#1#2{%
\XeTeXmathcodenum`#2=\numexpr\XeTeXmathcodenum`#2-`0+#1\relax}
\begin{document}
I want the digits in my math environment to be the same as those in my text,
for example, 44{\textdegree} and $\frac{\pi}{\sin 44 \text{\textdegree}}$.
But at other points in the document, I want to be able to switch to a different
font so that I can have some Eastern Arabic digits in the math environment; for
example {\offsetdigits{"0660}$\frac{2}{5}$}. The numbers in this fraction will
only appear if we switch Junicode with XITS Math in the \verb|\setmathsfont(Digits)
{Junicode}| line in the preamble.
\end{document}