Given a parameterless macro whose replacement text is blank but not empty (contains one or more spaces only) as first parameter, \ifdefempty expands to \<true>, which is, in my point of view, inconsistent with the related words in package documentation (see etoolbox.tex@L667-669).
Expands to \<true> if the \<control sequence> is defined and is a parameterless macro whose replacement text is empty, and to \<false> otherwise. ...
Example:
\def\test{ }
\ifdefempty{\test}{T}{F} % prints T
Investigating the source code, it shows \ifdefempty uses \etb@ifdefempty after some conditionals, and \etb@ifdefempty uses \ifblank (see etoolbox.sty#L266-280).
If this is more close to a bug, rather than a feature, I think the problem is caused by the usage of \ifblank. Substituting \ifblank to \ifstrempty might fix the problem.
Given a parameterless macro whose replacement text is blank but not empty (contains one or more spaces only) as first parameter,
\ifdefempty
expands to \<true>, which is, in my point of view, inconsistent with the related words in package documentation (see etoolbox.tex@L667-669).Example:
Investigating the source code, it shows
\ifdefempty
uses\etb@ifdefempty
after some conditionals, and\etb@ifdefempty
uses\ifblank
(see etoolbox.sty#L266-280).If this is more close to a bug, rather than a feature, I think the problem is caused by the usage of
\ifblank
. Substituting\ifblank
to\ifstrempty
might fix the problem.