[texhax] A macro programming question

Paul Isambert zappathustra at free.fr
Sat Apr 10 16:59:10 CEST 2010


A final # in the parameter text of a definition stands for a left brace.
So \def\foo#1#{...} means that the first argument is delimited by a left 
brace, hence it's "abc" in the following call:
\foo abc{...}
Note that this delimiter is not absorbed as delimiters normally are, 
i.e. TeX still reads a left brace once it has found the argument.
As remarked by Philipp, the weakness of the solution here is that boxes 
can be opened by an implicit \bgroup instead of {, which is not possible 
anymore with \hboxR.
Paul

Arno Trautmann a écrit :
> Paul Isambert wrote:
>   
>> You can say:
>>
>> \def\hboxR#1#{%
>>     
>
> I saw this kind of definition in a package and tried to understand what
> it does (to change \textcolor a bit) – but I just didn’t get the meaning
> of it. Could you explain shortly what the effect of #1# is? …
>
> cheers
> Arno
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20100410/22ef78a8/attachment-0001.html>


More information about the texhax mailing list