Hum, there is currently no \directlua in XeTeX I know that. \ifx\undefined\directlua ... non-lua engines .. \else \def\formatname{\directlua{tex.engine_ident()}}% \fi