[texhax] xspace

tom sgouros tomfool at as220.org
Mon Dec 11 05:57:25 CET 2006

Re-read my own question and it answered itself.  Sorry for cluttering up
all those in-boxes.

The \egroup in question is not part of \testref's definition, but a
convenience used to make a list of tokens into a single token suitable
for using as an argument to another macro. 

Is the lesson, then, that one can use a list like this as an argument to
a macro, but the price is that you're stuck with the list delimiters.
Is that correct?

Many thanks for the help,


tom sgouros <tomfool at as220.org> wrote:

> > I have this macro defined to test a reference and give me some alternate
> > text if the label doesn't exist.
> > 
> > \newcommand{\testref}[3]{%
> >   \expandafter\ifx\csname r@#1\endcsname\relax #2\else #3\fi}
> > 
> > It's used like this:
> > 
> > \renewcommand{\tableref}[1]{\testref{#1}{User Guide\xspace}{Table~\ref{#1}\xspace}}

 tomfool at as220 dot org

More information about the texhax mailing list