3

I am working with a LaTeX3 template that stores a list of languages in a l3seq sequence g_languages_seq. I want to pass these to polyglossia, so in essence I want to do something like

\setotherlanguages{\seq_use:Nn \g_languages_seq {,}}

However, in some older versions of polyglossia that I need to support, \setotherlanguages doesn't work with ExplSyntaxOn, so I need to turn it off before like this:

\ExplSyntaxOff
\setotherlanguages{\seq_use:Nn \g_languages_seq {,}}
\ExplSyntaxOn

But now of course, I can't use \seq_use:Nn, because it gives me "Undefined control sequence" - that is expected. So how can I use it? I tried to "save" the result of seq_use:Nn using things like \edef and \NewDocumentCommand, but it always gives me "Undefined control sequence" :(

I am very new to LaTeX3, so maybe I am misunderstanding the fundamentals, if so, please correct me.

0

1 Answer 1

7

You need to read the argument in the scope of \ExplSyntaxOn . It would normally not affect an already defined macro such as \setotherlanguages but presumably that causes other files to be read and you need to make sure they are input under normal latex2e conventions so you can do

\use:n {
\ExplSyntaxOff 
\setotherlanguages{\seq_use:Nn \g_languages_seq {,}} 
\ExplSyntaxOn
} 

where the \use:n causes the full expression to be parsed in L3 conventions but then this is disabled while \setotherlanguages is executed.

6
  • Thanks, that did the trick! May 15 at 13:38
  • \use:n causes everything to be parsed before anything is executed? Is that right?
    – cfr
    2 days ago
  • @cfr well yes it's \@firstofone ie \def\foo#1{#1} 2 days ago
  • I knew I would regret asking.
    – cfr
    2 days ago
  • @cfr at least you're not having to use Word (see chat:-) 2 days ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .