Skip to main content

Timeline for Test if token is a control sequence

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Jul 15, 2017 at 14:55 history edited David Carlisle CC BY-SA 3.0
Fixing a site bug of disappearing double backslashes: https://tex.meta.stackexchange.com/questions/7168/double-backslashes-disappear-from-code
Jun 23, 2011 at 22:21 comment added egreg @Bruno: it all depends on the use Martin wants to make of this test and what he expects the argument to be. Of course one can devise tricky input to defy any attempt to build the test in the most general way; but normal input, in many cases, is just normal input.
Jun 23, 2011 at 21:33 comment added Bruno Le Floch it depends on your definition of borderline case. A very weak form of the test would be \ifcat$\expandafter\@gobble\string#1$ (with the relevant \@firstoftwo and \@secondoftwo), if we don't care about spaces, and the case where \escapechar is 32 or non-printable.
Jun 23, 2011 at 19:27 comment added egreg @Bruno: that's what I suspected. If one doesn't need to cope with borderline cases, \ifcat may be sufficient.
Jun 23, 2011 at 18:36 comment added Bruno Le Floch It is not possible to have a purely expandable solution: \escapechar=-1\let\*=* makes * and \* indistinguishable expandably, except by delimited macro arguments (but you can't have that for all characters). Same problem with active characters.
Jun 23, 2011 at 15:02 history answered egreg CC BY-SA 3.0