5

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):

enter image description here

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:

enter image description here

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.

1 Answer 1

8

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

enter image description here

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.

3
  • 1
    +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. Commented Dec 22, 2013 at 22:00
  • Now that I've removed the unnecessary \usepackage{fontspec} and the math option from mathspec, everything's good. Commented Dec 22, 2013 at 22:01
  • 1
    @ZevChonoles Glad to help. Commented Dec 22, 2013 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .