@@ -21,11 +21,15 @@ $if(euro)$
2121 \usepackage{eurosym}
2222$endif$
2323\else % if luatex or xelatex
24+$if(mathspec)$
2425 \ifxetex
2526 \usepackage{mathspec}
2627 \else
27− \usepackage{fontspec}
28+ \usepackage{unicode-math}
2829 \fi
30+$else$
31+ \usepackage{unicode-math}
32+$endif$
2933 \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
3034$for(fontfamilies)$
3135 \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
@@ -43,7 +47,15 @@ $if(monofont)$
4347 \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
4448$endif$
4549$if(mathfont)$
50+$if(mathspec)$
51+ \ifxetex
4652 \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
53+ \else
54+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
55+ \fi
56+$else$
57+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
58+$endif$
4759$endif$
4860$if(CJKmainfont)$
4961 \usepackage{xeCJK}