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:
Mon, 29 Aug 2011 11:37:43 +0100
Content-Type:
text/plain
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