I know that there is the iftex package that allows you to do specific actions depending on whether the engine used is PDFLaTeX, XeLaTeX or LuaLaTeX.
I also know that LuaLaTex forbids using the inputenc package and requires fontspec. I do not know the forbidden and the prerequisites for others.
How to fulfill the conditions of the iftex package for these three engines with the packages: tikz, tcolorbox, babel, amsmath, amsfonts, amssymb and with the others ?
For example, how to fill the preamble of this ECM so that it is common to all LaTeX engines, or if this is impossible to maximum LaTeX engines?
Edit I am not asking the question for this document, but for every conceivable document. I put the ECM below because I know I'm going to be asked to put one, so I put the one there whose only use is to have a preamble.
\documentclass[11pt]{article}
\usepackage{iftex}
%\usepackage{tikz}
%\usepackage{amsmath, amsfonts, amssymb,mathrsfs}
%\usepackage[margin=1cm]{geometry}
%\usepackage[french]{babel}
%\ifLuaTeX
%\usepackage{fontspec}
%\else
%⟨material not for LuaT E X⟩
%\fi
%\ifXeTeX
%⟨material for XeT E X⟩
%\else
%⟨material not for XeT E X⟩
%\fi
%
%\ifPDFTeX
%⟨material for PDFT E X⟩
%\else
%⟨material not for PDFT E X⟩
%\fi
\begin{document}
Bien sûr, il s'agit d'écrire aussi avec des accents français et des formules mathématiques comme $2\times3^2=18$
Left of picture\begin{tikzpicture}
\draw[use as bounding box] (2,0) rectangle (3,1);
\draw (1,0) -- (4,.75);
\end{tikzpicture}right of picture
\end{document}
\usepackage{tikz}and would work with current pdflatex xelatex and lualatex – David Carlisle Apr 28 '18 at 17:29spec(and doesn't forbidinputenc, it just ignores that) – David Carlisle Apr 28 '18 at 17:31\usepackage{color}and it will again work in all three. If you need to use\directluathen it only works in luatex. What other answer can be given? – David Carlisle Apr 28 '18 at 18:00\documentclass{article}\begin{document} hello world\end{document}works correctly in all three engines. i only needed to add babel, tikz and fontenc because your example document used French and tikz. – David Carlisle Apr 28 '18 at 18:09\usepackage{zzz}just in case the document used a command from that package????? – David Carlisle Apr 28 '18 at 18:16\usepackage{lmodern}to get latin modern and someone else wants to add\usepackage{times}to get times, then you have to decide who wins but that is a social not a technical question and unrelated to "working in all tex engines" which is the title of your question. – David Carlisle Apr 28 '18 at 18:30texdoc lshorton the command line. There might even be a recent introduction in your native language. – Johannes_B Apr 29 '18 at 05:25