# Using mathspec to change digits font in math mode isn't working

I'd like to use the Linux Libertine font with a document, and I'm running into a problem with digits in math mode. Here is a MWE:

\documentclass[11pt]{article}

\usepackage[math]{mathspec}
\setprimaryfont{Linux Libertine O}

\begin{document}
1 $1$ $\mathrm{1}$ $\text{1}$
\end{document}


which, when compiled with XeLaTeX, produces the following (no errors reported):

As you can see, $1$ still gives Computer Modern. But my understanding from the mathspec documentation is that \setprimaryfont should apply to digits in math mode:

Perhaps I'm misunderstanding something about the documentation, or perhaps I have a problem with my fonts. I'm using TeXstudio 2.6.6 with MiKTeX 2.9 on Windows 7 64-bit.

Any help with getting $1$ to make a Linux Libertine 1 would be appreciated.

You can simply remove the option math when loading mathspec.

MWE

\documentclass[11pt]{article}

\usepackage{mathspec}
\setprimaryfont{Linux Libertine O}

\begin{document}
1 $1$ $\mathrm{1}$ $\text{1}$
\end{document}


Output

Loading mathspec with the math option forces mathspec to load fontspec without the no-math option.

And the fontspec manual states:

If you find that fontspec is incorrectly changing the maths font when it should be leaving well enough alone, apply the [no-math] package option to manually suppress its maths font.

• +1 Thanks for your answer - in my actual document, I used the math option for mathspec because I would get an error Option clash for package fontspec. ...Package[\eu@zf@math]{fontspec}[2008/08/09] if I didn't, but that's just because I was stupidly including the fontspec package separately, when the mathspec package already calls it. – Zev Chonoles Dec 22 '13 at 22:00
• Now that I've removed the unnecessary \usepackage{fontspec} and the math option from mathspec, everything's good. – Zev Chonoles Dec 22 '13 at 22:01
• @ZevChonoles Glad to help. – karlkoeller Dec 22 '13 at 22:02