@@ -21,11 +21,17 @@ $if(euro)$
2121 \usepackage{eurosym}
2222$endif$
2323\else % if luatex or xelatex
24+$if(mathspec)$
2425 \ifxetex
2526 \usepackage{mathspec}
2627 \else
2728 \usepackage{fontspec}
29+ \usepackage{unicode-math}
2830 \fi
31+$else$
32+ \usepackage{fontspec}
33+ \usepackage{unicode-math}
34+$endif$
2935 \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
3036$for(fontfamilies)$
3137 \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
@@ -43,7 +49,14 @@ $if(monofont)$
4349 \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
4450$endif$
4551$if(mathfont)$
52+$if(mathspec)$
53+ \ifxetex
4654 \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
55+ \else
56+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
57+ \fi
58+$else$
59+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
4760$endif$
4861$if(CJKmainfont)$
4962 \usepackage{xeCJK}