# To have both Luatex85.sty and a correct \ifpdftex (through iftex.sty)

Loading luatex85.sty makes \ifpdftex true, under Luatex or LuaHBTex. This is probably by design, however how can we revert back to the correct \ifpdftex after dealing with an old package that is still needs luatex85.sty?

In my case, I need to fool tufte-latex by using luatex85.sty as stated here: I can't use \maketitle with tufte and lualatex. However, my package which deals with bidi texts, need to distinguish between PDFTex, Xetex, and Luatex correctly. Is there anyway to have both solutions in the same package (or other workarounds)?

MWE

\RequirePackage{luatex85}
\documentclass{minimal}
\usepackage{iftex}
\begin{document}
\ifluatex
This is Lua
\fi

\ifluahbtex
This is Lua HB
\fi

\ifpdftex
This is PDFTex
\fi

\ifxetex
This is xetex
\fi

\end{document}

• Sorry, I fixed it in the question. Yes, I meant ifpdftex. – Shahryar Jul 18 at 18:41

It would really be better to just get the class fixed or patch it with a specific patch rather than using luatex85 which adds compatibility definitions for everything

However you can just add an extra test:

\RequirePackage{luatex85}
\documentclass{minimal}
\usepackage{iftex}
\begin{document}
\ifluatex
This is Lua
\fi

\ifluahbtex
This is Lua HB
\fi

\ifpdftex
\ifluatex
This is LuaTex
\else
This is PDFTex
\fi
\fi

\ifxetex
This is xetex
\fi

\end{document}


with lualatex you then get

• Thanks! This code surely works, but it also shows that it is much better to find a fix or patch for tufte-latex. Tufte-latex has not been updated since 2015. That is a pity. I guess it is used frequently in the Tex community. – Shahryar Jul 18 at 18:50