LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sat, 18 Sep 2010 18:23:42 +0200
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <1458322901.1855783.1284827022401.JavaMail.fmail@mwmweb012>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=UTF-8
From: Uwe Lueck <[log in to unmask]>
Parts/Attachments: text/plain (54 lines)
Heiko Oberdiek <[log in to unmask]>, 18.09.2010 01:33:51:
>On Fri, Sep 17, 2010 at 11:34:50PM +0200, Uwe Lueck wrote:
>> Not tested exactly this way, sorry, but in a so far private package of mine, I have
>>     \providecommand*{\MakeActiveDef}[2]{%
>>       \catcode`#1\active
>>       \begingroup
>>         \lccode`\~`#1%
>>         \lowercase{\endgroup \def ~{#2}}%
>>     }
> But then the contents of #2 is converted to lowercase, too.
> The trick is to move the (parameter text and) definition text
> outside of \lowercase:
>    \providecommand*{\MakeActiveDef}[2]{%
>      \catcode`#1\active
>      \begingroup
>        \lccode`\~`#1%
>        \lowercase{\endgroup \def ~}{#2}%
>    }

I wanted to try this in my package ... actually it has been there already; I seem not to have pasted (which is somewhat clumsy with my favourite editor under Hatari), rather changed similar code of previous mails.

So this shows that Heiko's proposal already has been tested and he is right!

> or even
>    \providecommand*{\MakeActiveDef}[1]{%
>      \catcode`#1\active
>      \begingroup
>        \lccode`\~`#1%
>        \lowercase{\endgroup \def ~}%
>    }
> The latter allows definition of active chars with parameters:
>  \MakeActiveDef{\+}#1{Do something with #1}

Anyway, I usually consider definitions like


mistakes and type 


instead, maybe I didn't realize it here -- indeed I change my \MakeActiveDef according to Heiko's proposal ... tested successfully!

Thanks, cheers,