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
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Mon, 29 Aug 2011 11:37:43 +0100
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=ISO-8859-1
From: Joseph Wright <[log in to unmask]>
Parts/Attachments: text/plain (28 lines)
On 29/08/2011 09:43, Ulrike Fischer wrote:
> Assuming that I have a token list variable like this:
> 
> \tl_set:Nn \l_temp_tl { a b c {e f} g {h} i }.
> 
> What is the right way to remove the inner braces and convert it to 
> 
> { a b c e f g h i } 
> 
> ? (spaces don't matter)
> 
> (I want to loop through the list, but I need simply chars as
> arguments)

The is no pre-build 'strip_braces' function at present. You don't say if
we are talking one set of braces or multiple sets. For the former case,
a simple 'do nothing' loops would be easiest:

  \RequirePackage{expl3}
  \ExplSyntaxOn
  \tl_new:N \l_temp_tl
  \tl_set:Nn \l_temp_tl { a b c {e f} g {h} i }
  \tl_set:Nx \l_temp_tl
    { \tl_map_function:NN \l_temp_tl \exp_not:n }
  \tl_show:N \l_temp_tl
--
Joseph Wright

ATOM RSS1 RSS2