[texhax] Unexisting commands.

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Thu Apr 15 00:52:10 CEST 2010


Philipp Stephani <st_philipp at yahoo.de> wrote:

> Am 14.04.2010 um 13:33 schrieb Paul Isambert:
> 
> > Shouldn't we try to all use the same construction to test for the existence of commands?
> 
> You should normally treat \relax as undefined, but nevertheless take
> care not to define control sequences with \csname. Everyone should use
> packages like etoolbox for these tests because they are not trivial. 

as chris rowley said earlier, what's good and what's obeyed are
necessarily different things.

> > If we took e-TeX for granted, then \ifcsname would solve the problem.
> 
> Even without e-TeX, you can check for the existence of control
> sequences without visible side effects: 
> 
> \begingroup\expandafter\expandafter\expandafter\endgroup
> \expandafter\ifx\csname ...\endcsname\relax ...

yup.  trips off the toungue like a chunk of finnegan's wake.

(i wrote that one down, long ago, with a thought of sticking it in the
faq.  i've still not done that, due to my lack of conviction.)


More information about the texhax mailing list