[texhax] xspace

tom sgouros tomfool at as220.org
Mon Dec 11 16:27:56 CET 2006


Many thanks for both of these.  I see I can just use the \@ifundefined
directly.  I wish I'd stumbled across that long ago.

 -tom


Morten Høgholm <morten.hoegholm at gmail.com> wrote:

> Another possibility is to define \testref in such a way that the code to  
> be executed is moved outside of the conditional:
> 
> \newcommand{\testref}[3]{%
>    \expandafter\ifx\csname r@#1\endcsname\relax
>      \expandafter\@firstoftwo
>    \else
>      \expandafter\@secondoftwo
>    \fi
>    {#2}{#3}}
> 
> Even easier is to make use of the functionality provided by the LaTeX  
> kernel:
> 
> \newcommand{\testref}[3]{\@ifundefined{r@#1}{#2}{#3}}
> 


-- 
 ------------------------
 tomfool at as220 dot org
 http://sgouros.com  
 http://whatcheer.net


More information about the texhax mailing list