[texhax] A macro programming question

Arno Trautmann Arno.Trautmann at gmx.de
Sat Apr 10 17:25:55 CEST 2010


Paul Isambert wrote:
> 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{...}

Ah … I see. Now I understand many things way better …
Thanks a lot for this!

cheers
Arno

> 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
> 
> 
> 
> _______________________________________________
> 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 --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://tug.org/pipermail/texhax/attachments/20100410/70c85c09/attachment.bin>


More information about the texhax mailing list