Closed muzimuzhi closed 1 year ago
The <replacement text>
is blue in \edef
and \xdef
syntax because these primitives read it fully expanded. On the other hand, the <replacement text>
is red in \def
and \gdef
syntax because these primitives read it not expanded.
Oh. Then the blue }
is also intended?
Yes, it is blue. Try this:
\def\fin{\iffalse{\fi}}
\edef\a{text\fin
\meaning\a
The expand processor is normally working when the <parametere text>
is read including closing }
.
Ah the brace hack! Thank you I learnt sth new today.
This also explains why the left braces in syntax for \detokenize
, \scantokens
, etc., are blue. "TeX performs expansion to find the opening brace of a <general text>
."
On page 11, TeX in a Nutshell v0.9, the syntax for
\edef
and\xdef
are colored differently than\def
and\gdef
.https://github.com/olsak/tex-nutshell/blob/2ae3c848c1706c272ff1bcc90b17d85bd75abf7c/tex-nutshell/tex-nutshell.tex#L868-L873
It seems it's cause by wrong position of
;
in the markup|...;
.