LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Sat, 1 Aug 2009 09:55:35 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
Will Robertson wrote:
> What sort of circumstances are you running into this? (Just out of
> curiousity.)

This tends to be when constructing a list of tokens to possibly be added
to something like \frac or sub/superscripted.  The token list is built
up, then I need to wrap it up in braces so that whatever function I'm
applying to it works correctly.  As far as possible, I'm keen to make
the token lists I use end up the same as if they'd been done by hand: it
makes debugging a lot easier.   For example:

\tl_set:Nn \l_tmpa_tl { abc }
\tl_set:Nn \l_tmpb_tl { def }
\tl_put_right:NV \l_tmpa_tl \l_tmpb_tl
\tl_set:No \l_tmpa_tl {
  \exp_after:wN { \l_tmpa_tl }
}
\tl_put_left:Nn \l_tmpa_tl { 10 ^ }

to end up with 10^{abcdef} in \l_tmpa_tl.

> In general I guess I'm not opposed to adding *anything* to the expl3
> code while we're playing around with it. But I suppose every time that
> we write a new module we'll come across the same situation, and it's
> always harder to remove functions than to add them.

That's why I thought I'd ask.  If no-one else needs this type of thing,
I'll leave well alone. (The context here is writing siunitx version 2,
where I need to build fractions, superscripts and so on from input on a
token-by-token basis).
-- 
Joseph Wright

ATOM RSS1 RSS2