I have a problem with testing whether an argument is empty or not. The following sample code should return "correct" but does not.
Example:
\documentclass{article}
\newcommand{\ifxnotworking}[1]{
\if #1{}
correct
\else
false
\fi}
\begin{document}
\ifxnotworking{}
\end{document}
Comparing {}{} or with \empty has the same result. This only occurs with empty strings, as far as I know.
Does anyone know why and what would be a proper Solution?
\if\relax\detokenize{#1}\relaxwas put forward by @HeikoOberdiek, but maybe he was not first (e-TeX was slowly digested by first-timers TeX macro-ers) – Sep 26 '17 at 15:47