9
votes
1answer
49 views

LaTeX3 Property lists and expansion

So, I'm trying to pass the "date" value associated with the current environment to a property list defined by a macro. It doesn't seem to work and I'm not sure why. Here's a MWE: ...
7
votes
3answers
500 views

Command that changes its definition the nth time it's used

I need a command to behave differently the first time than the next times it's called. Right now I use \newcommand\foo{First\gdef\foo{Next}}, that is, it redefines itself the first time. Moreover, I ...
8
votes
1answer
64 views

How can I expand macros and write the expansion to an external file?

I'm trying to do a bit of single-sourcing with my resume, and would like to write given information to an external text file. \documentclass{article} \usepackage{expl3,xparse} \ExplSyntaxOn ...
4
votes
1answer
39 views

Expl3 prop doesn't seem to work when the key is a macro value

I'd expect this example code to give two identical lines, however \usevalue{\xyz} doesn't result in XYZ as the other. Can I force the key to be expanded to make \usevalue{\xyz} and \usevalue{0} refer ...
6
votes
1answer
82 views

Expanding a macro as many times as possible without error

I'd like compute cosets using the permute package. Here's what I have so far: \documentclass{article} \usepackage{expl3,xparse,permute} \ExplSyntaxOn % Create a new command to compute the right ...
7
votes
1answer
47 views

expl3: \tl_put_right:Nx chokes on \{

I am trying to compose a command into a token list. \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \tl_new:N \__a \tl_new:N \__b \tl_new:N \__c \tl_set:Nn \__a { ...
1
vote
1answer
132 views

Defining a `\subtitle` macro - `\reserved@e` undefined

I want to define a general-ish \subtitle macro that simply adds to the \@title macro set by the user-level \title. Here is what I've got: \documentclass{article} \RequirePackage{xparse,expl3} ...
3
votes
0answers
63 views

Difficulty saving formatting to a sequence to be called later in my code

I had an idea about how to answer this question and started putting some things together. I wanted to put something together that was fairly powerful and could handle simplification of linear ...
4
votes
1answer
96 views

I need a fully expandable function to expand in an “f” type argument

I really hope that I'm asking the correct question. What I'm actually working on if far more convoluted than what's happening in the MWE here. I think I've narrowed down things to real problem. I ...
5
votes
3answers
150 views

How can I remove outer brackets without expanding content?

I'm trying to use pgfkeys to collect information that will be passed to a clist. But, I'm not able to get this to work correctly. It seems that I'm getting brackets around the list and is prevent ...
8
votes
1answer
86 views

How do the \xx_case: functions work?

In the process of answering expl3 switch for booleans: Is there a \bool_case:Nnn?, I tried to make sense of the various \xx_case: functions Expl3 provides. Here, for example, is \tl_case:Npn: ...
14
votes
2answers
323 views

LaTeX3: How to get reliable control over the level of expansion?

Say you want to write LaTeX3 code that manages user data. Sometimes you want to process that data, but other times you just want to store it, move it around and return it unchanged (when developing a ...
3
votes
1answer
68 views

List Version of \str_if_eq

I am using \str_if_eq:xxTF{\A}{\Target}{<true>}{<false} to execute the <true> or <false> code if \A=\Target. What is the list version equivalent of this? So I am looking for ...
4
votes
2answers
79 views

expl3: \cs_generate_variant broke with the last update: undefined control sequence \::T [closed]

The last expl3 update broke my "continue" detection for the index. Here is a MWE: (EDIT: I realized it is possible to reduce it even further) \documentclass{minimal} \usepackage{expl3,xparse} ...
8
votes
1answer
115 views

'Fake' variants in expl3

Suppose you have a function that operates on three tokens, \cs_new:Nn \@@_on_three:NNN { #1, #2, #3 } And you have a variable whose value is the three tokens: \tl_set:Nn \l@@_three_tl { foo } ...
7
votes
2answers
284 views

Why does this protection not work?

The answers to this question explain in detail what protection is so I'm not wondering about that. My question is why a certain command definition with expl3 does not give a protected command. ...
10
votes
2answers
276 views

How do I pass an expanded optional argument using expl3/xparse?

I have a command defined using xparse syntax: \DeclareDocumentCommand \foo { O{} m } {} Inside some other command (say, \bar), I want to call this command. The calling command (\bar) has to ...
3
votes
1answer
252 views

LaTeX3: expansion of argument to function

I would like to define functions which extract the PDF object number from a PDF object reference, such as 12 from 12 0 R. I defined two versions of such a function, a low level one and a high level ...