Closed muzimuzhi closed 6 months ago
For definition \edef\x{\scantokens{abc\noexpand}, if wrapped in \unravel, an extra pair of braces is added to the result of \scantokens.
\edef\x{\scantokens{abc\noexpand}
\unravel
\scantokens
\documentclass{article} \usepackage{unravel} \begin{document} \edef\x{\scantokens{abc\noexpand}} \unravel{\edef\y{\scantokens{abc\noexpand}}} \show\x % macro:->abc \show\y % macro:->{abc} % WRONG DEFINITION % another example without \edef $a \scantokens{+\noexpand} b$ $a \unravel{\scantokens{+\noexpand}} b$ % output looks like $a{+}b$ \end{document}
Actually just \unravel{\scantokens{+}} adds the extra braces, and \unravel{\edef\y{\scantokens{abc}}} incorrectly works.
\unravel{\scantokens{+}}
\unravel{\edef\y{\scantokens{abc}}}
Bruno fixed \scantokens at the macro level ;-)
For definition
\edef\x{\scantokens{abc\noexpand}
, if wrapped in\unravel
, an extra pair of braces is added to the result of\scantokens
.