Thank you all for such a variety of solutions! Gonna look into it. ))
%D \macros %D {doifundefined,doifdefined, %D doifundefinedelse,doifdefinedelse, %D doifalldefinedelse} %D %D The standard way of testing if a macro is defined is %D comparing its meaning with another undefined one, usually %D \type{\undefined}. To garantee correct working of the next %D set of macros, \type{\undefined} may never be defined! %D %D \starttyping %D \doifundefined {string} {...} %D \doifdefined {string} {...} %D \doifundefinedelse {string} {then ...} {else ...} %D \doifdefinedelse {string} {then ...} {else ...} %D \doifalldefinedelse {commalist} {then ...} {else ...} %D \stoptyping %D
\doifdefined{Homeworks}{...}
Low level (etex) solutions:
\ifdefined\Homeworks ... \fi
\unless\ifx\Homeworks\undefined ... \fi
-- Best Regards, Vyatcheslav Yatskovsky