My situation is similar to, but hopefully different from How do I ‘expand’ a control sequence \let to a character?, as that question does not admit a positive answer. I want to parse, not expand, but not character by character, if I can avoid that (as in Parsing a macro argument character-by-character for conditional execution). Existing parsers like Can one define an expandable command that removes control sequences from its argument? seem not not work for me, unfortunately (well, I can't get them to work, that is).
Consider the following: There is this \let definition
\newif\ifintheway
\inthewayfalse
\show\inthewayfalse % ->\let \ifintheway \iffalse .
that sits in a macro \parseme of which I want to extract the text 17
\def\parseme{\inthewayfalse 17}
How can I do that?
Obviously, expanding the macro with \edef\parsedmacro{\parseme} does not work and I get the complaint
! Incomplete \iffalse; all text was ignored after line 5.
However, adding a \fi in the \edef does not help, either. Is there something else I can do?
In my situation I even know what the obstacle is. It is always \intheway. Then there is my text (of which I know it is a number), and then the macro ends. Finally, as an additional obstacle, \parseme is really a `\csname b\@citeb\endcsname.
(A positive answer would also resolve Custom \thebibliography with alphabetic numbering for scrltt2 not working in presence of babel, at least in parts.)
\defrather than\edef? – cfr Nov 22 '14 at 22:02\edefwas that it expands away the stuff I don't need. In contrast,\defdoes not expand anything, so the obstructing\let/\inthewayfalsestays where it is and I just have a new macro with a different name but the same problem as before. – bjoseru Nov 24 '14 at 10:32