# fontspec mathspec clash

I have just updated to fontspec 2017/02/12 v2.6. Now when I compile my code I get a clash with mathspec.

C:\Program Files\MiKTeX 2.9\tex\xelatex\mathspec\mathspec.sty:65: LaTeX Error: Option clash for package fontspec. [...Package[\eu@zf@math]{fontspec}[2008/08/09]] 

Example:

% !TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass{article}

\usepackage{fontspec}
\usepackage{mathspec}

\begin{document}
Test
\end{document}

• How about... delete the line \usepackage{fontspec}. – Symbol 1 Mar 22 '17 at 1:17

I found the answer: \usepackage[no-math]{fontspec}

• Or simply don't load fontspec as mathspec is doing it anyway. – Ulrike Fischer Mar 22 '17 at 11:11

Note that currently top-voted answer is not current for mathspec 0.2b (22 December 2016).

The documentation states:

It is not necessary to put \usepackage{fontspec} because mathspec will ensure that fontspec is loaded anyway. To load fontspec with some options, parse them through mathspec, for example,

\usepackage[quiet]{mathspec}


is equivalent to

\usepackage[quiet]{fontspec}
\usepackage{mathspec}


In practice, loading fontspec with any options gives me an error, but loading just mathspec works fine, and it accepts options which it passed on to fontspec.

• Welcome to TeX.SE! I'm a bit confused by your remark "this answer is not current for 0.2b", do you mean your own answer (i.e., 'this answer') or the other answer by igm2013 (i.e., 'the other answer')? Maybe you can clarify this by editing your answer, initially I read it as "what I am now going to say does not apply to the current version of mathspec" which is probably not what you meant. – Marijn Nov 12 '19 at 16:20
• Great point @Marijn thank you. Revised accordingly. – dan mackinlay Nov 13 '19 at 17:14