Am 25.06.10 15:39, schrieb Aditya Mahajan:
On Fri, 25 Jun 2010, Vyatcheslav Yatskovsky wrote:


Now I check for an undefined constant like this:

\ifx \Homeworks \undefined \else Home works -- {\Homeworks} \fi

The useful part is in "else" clause. How to swap this check so that "else" is not needed?

From syst-gen.mkii

%D \macros
%D   {doifundefined,doifdefined,
%D    doifundefinedelse,doifdefinedelse,
%D    doifalldefinedelse}
%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 \starttyping
%D \doifundefined      {string}    {...}
%D \doifdefined        {string}    {...}
%D \doifundefinedelse  {string}    {then ...} {else ...}
%D \doifdefinedelse    {string}    {then ...} {else ...}
%D \doifalldefinedelse {commalist} {then ...} {else ...}
%D \stoptyping



Low level (etex) solutions:

\ifdefined\Homeworks ... \fi

\unless\ifx\Homeworks\undefined ... \fi


If your question is of interest to others as well, please add an entry to the 

maillist : /
webpage  : /
archive  :
wiki     :

Reply via email to