LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Content-Transfer-Encoding: 7bit
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Joseph Wright <[log in to unmask]>
Date: Thu, 18 Sep 2008 14:09:00 +0100
Content-Type: text/plain; charset=ISO-8859-1
MIME-Version: 1.0
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (34 lines)
Hello all,

I'm taking a look at how to begin on siunitx in expl3, and I've already
found something I'm stuck with.  The code I have at present is essentially:

\def\example#1{
  \begingroup
    \makeatletter
    \@makeother{\,}%
    \@makeother{\.}%
    \@makeother{\+}%
    \@makeother{\-}%
    \def~{}%
    \def\,{}%
    \catcode`\~=\active\relax
    \catcode`\^=\active\relax
    \catcode`\_=\active\relax
    \everyeof{\noexpand}%
    \endlinechar\m@ne
    \protected@xdef\storage{\scantokens{#1}}%
  \endgroup
}

which results in \storage containing an expanded copy of #1, with any
hard spaces (~ and \,) removed.  This may not be the best way, but it
works.  (In siunitx, see \si@num for the context of this).

In expl3, I can only find \scantokens, \everyeof and \endlinechar in the
:D range, so these are out.  I'm guessing that I should do things a
different way, but could do with enlightenment.  Does no-one want
\scantokens?
-- 
Joseph Wright

ATOM RSS1 RSS2