I get the following error message whenever using mathspec
in LyX
...Package[\eu@zf@math]{fontspec}[2008/08/09]
The package fontspec has already been loaded with options: [] There has now been
an attempt to load it with options [no-math] Adding the global
options: ,no-math to your \documentclass declaration may fix this.
Try typing <return> to proceed.
Here is my preamble in LyX
\usepackage[no-math]{mathspec}
\setmathsfont(Latin)[Scale=MatchLowercase,Uppercase=Regular,Lowercase=Italic]{SNsanafonmaruP}
\setmathsfont(Greek)[Scale=MatchLowercase,Uppercase=Regular,Lowercase=Regular]{SNsanafonmaruP}
\setmathsfont(Digits)[Numbers={Lining}]{SNsanafonmaruP}
(n.b. mathspec
loads fontspec
with no-math
by default. I put it in there explicitly, but the error occurs even when it is not there.)
The problem is that LyX loads fontspec
automatically and this is throwing the error.
I am not sure how to proceed.
I am using XeTeX as my output...
UPDATE 2/29/12
I have tried to use unicode-math
instead of mathspec
, as follows:
usepackage[vargreek-shape=unicode]{unicode-math}
\unimathsetup{math-style=TeX} % sets whther vars are upper or lc vars and lating chars in math
\setmathfont{lmmath-regular.otf} % this is obligatory or no math font will be set...
\setmathfont[range=\mathup/{latin, Latin, num}]{SNsanafonmaruP} % upper and lower case latin and numbers
\setmathfont[range=\mathup/{Greek,greek}]{SNsanafonmaruP} % upper case Greek
\setmathfont[range=\mathit/{latin, Latin, num}]{SNsanafonmaruP}
\setmathfont[range=\backepsilon]{SNsanafonmaruP}
\setmathfont[range=\mathit/{greek,Greek}]{SNsanafonmaruP}
but unicode-math
doesn't default (e.g. to computer modern...I am not pleased with the traditional Unicode alternatives Asana and STIX (too fat, especially the summation signs, and I like the default symbols, I just want my own font for the greek and latin and numerals) to anything, which would be nice, so I have to include the first \setmathfont
and specify a default font,
but when I try to put in "Computer Modern" or "Computer Modern Math" it doesn't find it, and I guess it couldn't cause it isn't Unicode??, so I tried lmmath-regular.otf
or Latin Modern Math, and I probably have to install these, but I cant find a package for it in MikTeX, and anyway, according to the bug list on unicode-math
this will break mathcal
so I shouldn't, and to boot it doesn't work, since the font is not found.
so it seems like I am so close, and yet so far, as the saying goes...
fontspec
or you must prevent Lyx from loading fontspec itself.