LaTeX Engine
pdfLaTeX
\documentclass{article} \usepackage{iftex} \newcommand\test[1]{\par\expandafter#1\string#1: true\fi} \begin{document} \ttfamily \test\ifpdftex \test\ifluatex \test\ifxetex \test\ifptex \test\ifuptex \end{document}
LuaLaTeX
%!TEX LuaLaTeX \documentclass{article} \usepackage{iftex} \newcommand\test[1]{\par\expandafter#1\string#1: true\fi} \begin{document} \ttfamily \test\ifpdftex \test\ifluatex \test\ifxetex \test\ifptex \test\ifuptex \end{document}
XeLaTeX
%!TEX XeLateX \documentclass{article} \usepackage{iftex} \newcommand\test[1]{\par\expandafter#1\string#1: true\fi} \begin{document} \ttfamily \test\ifpdftex \test\ifluatex \test\ifxetex \test\ifptex \test\ifuptex \end{document}