I am writing a class file and want to use fontspec and unicode-math if the compiler is luatex or xetex. If the compiler is pdftex I would like to define default fonts like cmr and phv instead. I am trying to use \sys_if_engine* in the cls-file but getting the error: sys not defined or somethins like that. Can I get around this?
Asked
Active
Viewed 48 times
0
Niklas
- 11
1 Answers
0
I realised that these packages did not use the \ProvidesPackage but \ProvidesExplPackage so I researched that and found this solution:
\newif \if@luatex
\newif \if@xetex
@luatexfalse
@xetexfalse
\ExplSyntaxOn
\sys_if_engine_luatex:T {@luatextrue}
\sys_if_engine_xetex:T {@xetextrue}
\ExplSyntaxOff
...
\ifthenelse{\boolean{@luatex} \OR \boolean{@xetex}}{
\RequirePackage{unicode-math}
\RequirePackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily \arial {Arial}
\setmathfont{Cambria Math}
}{
% Have not solved this part yet.
}
Niklas
- 11