Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [expl3]

{expl3} is the programming "language" written for the LaTeX3 project. It is a library of common functions for storing and manipulating data and performing higher-level logical tasks than commonly provided for in TeX and LaTeX.

2
votes
1answer
28 views

How can I strip the percent char of a number read by csvsimple?

I have a CSV table containing some numbers in percent with the percent char explictily written in the CSV data (that can’t be changes). Is there a (LaTeX3) way to strip the percent char and preceding ...
4
votes
2answers
41 views

Implementing a keyword / token / tag system

I want to have a keyword / tag / label / token system for my documents. There will be a hard coded list of allowed keywords and all theorems/examples/exercises will (optionally) be tagged with one of ...
3
votes
1answer
65 views

How to use \ExplSyntaxOn and \ExplSyntaxOff inside tikzset?

If you place ExplSyntax on/off inside tikzset, code (that is expected to work) within ExplSyntax would generate errors. But if you bring ExplSyntax outside of tikzset (enclosing the tikzset), it makes ...
3
votes
2answers
55 views

Why using a variable as index of a list-item does not retrieve that item with \clist_item:Nn?

For some reason, using a variable as index of a list-item does not work for retrieving that item. But using a number instead of a variable works. Why? \documentclass{standalone} \usepackage{expl3} \...
2
votes
2answers
179 views

How to check if comma list is empty?

How do I check if \myList is empty? Following (is my attempt) prints "NOT empty" when, in fact, the list is empty. \documentclass{standalone} \usepackage{expl3} \begin{document} \ExplSyntaxOn \...
2
votes
1answer
37 views

How to suppress comma list from outputting its values on declaration?

I need to suppress the display of the comma list on its declaration. I just need comma-list variable to store the list, not display it. \documentclass{standalone} \usepackage{expl3} \begin{document} ...
3
votes
2answers
61 views

expl3-strategy to automatically update the title of a document, depending on its content

Context The current question arises: as an attempt to improve the aim explained in a question of mine (Expl3' tl variable storing the result of a \seq_map_inline: OK in article's title but ...
4
votes
2answers
146 views

\TeX and \LaTeX differently expl3-x-written (exhaustive expansion) to an auxiliary file

As pointed out by the following MCE, \TeX and \LaTeX are expl3-written to an auxiliary file: the same way when no manipulation is involved (\iow_now:Nn) (but that is useless for my real use case): \...
2
votes
1answer
21 views

expl3 sequence name replaced by \s__seq when written to the .aux file

I'm trying to adapt this egreg's answer but I'm facing a very strange phenomenon. As shown by the following MCE, the similar lines that are supposed to be written to the .aux file: \int_gset:Nn \...
4
votes
2answers
120 views

Expl3 and recent xparse on overleaf: No expl3 loader detected

I'm currently writting a library that requires a recent xparse (to have the +b option for environments). Unfortunately, my computer does not have such recent xparse, so I downloaded the package here, ...
3
votes
3answers
105 views

Expl3' tl variable storing the result of a \seq_map_inline: OK in article's title but not in beamer's title

As pointed out by the following MCE, an expl3' token list variable storing the result of a \seq_map_inline: used in \title's argument: works like a charm with the article class, doesn't work with the ...
3
votes
1answer
60 views

Beamer illegal parameter number \insertfootnotetext with expl3 seq

I am trying to build my own beamer theme for which I personalized citations. Using the seq module of the package expl3, I have written a function that gathers all citations of a frame into a sequence ...
2
votes
1answer
22 views

Environment to nullify the use of label

Why does the following code, meant to nullify the action of the label command, only work if I don't include the amsmath package? \documentclass{article} % \usepackage{amsmath} \usepackage{amsthm} \...
3
votes
3answers
73 views

Summing the values of a sequence using expl3

In the code below, what should the definition of \sumcounters be to make it sum the current values of the counters thm and lemma? \documentclass{book} \usepackage{amsthm} \usepackage{xparse} \...
4
votes
1answer
57 views

Help to understand a simple example of clist in expl3

Sorry if my question is elemental. I have start learning LaTeX a month ago. I'm learning at the same time as have new ideas. That being said, someone could help me to understand a simple example of ...
1
vote
0answers
85 views

How to change \scantokens to \tl_rescan:?

After reading the documentation, reviewing the forum and seeing the comments, I have tried to move a code that I have using \scantokens to \tl_rescan:. I want to save the result in a variable and ...
3
votes
1answer
81 views

How to debug “Inconsistent local/global assignment” in l3seq (expl3)?

I'm trying to debug an expl3 code that usesl3seq and seq_gput_right. By adding the enable-debug and reviewing the code I get the error: ! LaTeX3 Error: Inconsistent local / global assignment That ...
0
votes
0answers
41 views

How to update a specific package from ctan

In the answer to this thread it is advised to use the package xparse released 05/03/2019 or later. I've been trying to update this specific package, but without success. First I updated all the ...
1
vote
0answers
18 views

Problems with an automatic theorem list

I took the code from this thread and modified it a little to fit my personal needs. Everything works fine until I add a second theorem environment, which in the MWE I'm posting is the lemma ...
1
vote
1answer
47 views

Looping over characters in a string and applying a macro with an additional argument

The following code was kindly provided for me in TeX Chat by @egreg. This LaTeX 3 code loops over a list of characters, and puts a box around each character. It does not skip whitespace \...
5
votes
1answer
112 views

What is the maximum limit of elements in a list (expl3/xparse)?

I have a query with the maximum number of items that can be saved in an expl3 list. Thanks to the response that @egreg gave me in Avoid passing an empty [optional argument] an environment (with ...
2
votes
1answer
47 views

Use name of referenced object as argument of string comparison

I have argument #1 which contains some text X representing some label. I would like to use \str_if_eq to compare X and name of paragraph referenced by this string. What I want to achieve is that if \...
3
votes
1answer
133 views

Avoid passing an empty [optional argument] an environment (with verbatim content) using xparse?

this query is related to How to pass an optional argument to an environment with verbatim content? (whose solution did not work in my case) and with Emulating @ifnextchar in expl3 (which is the one I'...
2
votes
1answer
34 views

Problem with font commands as `l3keys2e` values

I'm setting some fonts and font-related commands using l3keys, and that works just fine—but it seems there's an issue when setting the same keys via l3keys2e. Is this expected behavior? Is there a way ...
1
vote
1answer
54 views

Modeling a mapping from strings to lists of strings in LaTeX3

I'd like to work on a data structure using expl3. This data structure would be read from and written to the .aux file in the following format (this is my proposal—I'm open to better suggestions, of ...
2
votes
1answer
38 views

Expl3 seq with macros

I use it TeXLive with XeLaTex I had an Expl3 function to insert a character between the characters of each word. My code: \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \seq_new:N \...
1
vote
1answer
130 views

How to expand a \macro (or a copy) to save in a list at end of environment in xparse (expl3)?

I am trying to encapsulate a couple of environments to pass them to lists using xparse/expl3. I have defined a one command and two environments and I have had a problem with one of them. I use the ...
1
vote
1answer
37 views

Definition before \multicolumn or the like?

Is it possible to have definitions take effect at the beginning of the first cell of a tabular row (using array.sty, if relevant), and still leave room for \multicolumn, \hline, etc.? The problem is, ...
1
vote
1answer
44 views

Problem with siunitx package together with rmstyle.cls

could somebody point out what to change in rmstyle.cls file to get siunitx working? Here is the MWE: \documentclass{rmstyle}[12pt] % \documentclass{article}[12pt] \usepackage{siunitx} \setcounter{...
1
vote
1answer
92 views

Keep a key locally passed from multicols to enumitem using xparse

I have a small problem when trying to keep a key=val locally defining using xparse to pass multicols to enumerate (enumitem package). I have redefined the environment enumerate to accept the columns=...
2
votes
1answer
27 views

How to use the token list variable from \prop_get

Here is a MWE. I use a token list, and I can get 10 and October in the final pdf file. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N \l_my_tl \prop_new:N \l_my_prop \...
3
votes
2answers
141 views

How to implement \expandbefore, similarly to \expandafter?

I am trying to define a new command, but specifying the new control string "on the fly" using csname and endcsname. (This is for the purpose of implementing a dependency injection pattern.) **...
3
votes
3answers
61 views

Environment with comma separated optional arguments

Using xparse, how does one get something like this to work? \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentEnvironment{ anenvironment }{ >{\SplitArgument{1}{,}}o }{ \...
0
votes
0answers
118 views

! Argument of \@firstoftwo has an extra }

I am attempting to write macro that extracts and formats information from a label. I get the messages ! Argument of \@firstoftwo has an extra }. <inserted text> \par l.84 ......
2
votes
1answer
28 views

Trouble parsing filename in expl3

I am trying to parse the file extension of a user-given path in expl3. I have got the file extension, but I can not manage to compare it to the expected file extension. My MWE is \documentclass[]{...
3
votes
1answer
122 views

Automatic date in personal journal

I keep a personal journal using LaTeX. I'd like to create an environment that automatically keeps track of the date of every entry, without having to manually input them myself. This is the code so ...
1
vote
0answers
40 views

\ifthenelse command when using expl3 syntax

What is the equivalent of \ifthenelse{<statement>}{<iftrue>}{<iffalse>} when using expl3 syntax?
11
votes
1answer
131 views

Combine `map` and `use` expl3 macros

I'm trying to build a macro that processes a comma-separated-list of elements so that: \MapAndUse{a,b,c} would produce: My first intuition is to use a expl3 combination of \seq_map* to process each ...
2
votes
1answer
49 views

How to display string variable without hanging texworks

I was getting unexpected results storing a parameter into a string variable, and added the statement "\str_show:N \l_tmpa_str" to produce debugging output. Texworks treats the output as an error. My ...
2
votes
1answer
33 views

Write file content obeying whitespace using expl3

I want to create a control sequence using expl3 to write file content while obeying whitespace. So far I have the following MWE which does write to file, but ignores whitespace. \documentclass[]{...
4
votes
2answers
110 views

Convert token to string in LaTeX3

While trying to answer another question on this site, I was experimenting with \peek_after:Nw and \l_peek_token. I can set \l_peek_token OK, but then I want to test if this token is one of several ...
3
votes
1answer
144 views

Automatic theorem list

In the accepted answer to Code between \begin{environment} and \end{environment} stored in an array it's shown how to create an automatic list of theorems using expl3 syntax. However the \...
4
votes
1answer
92 views

Is there latex3 work being done on a boolean case statement?

Various languages have constructs like select; when <expression 1> then <action 1>; when <expression 2> then <action 2>; ... when <expression n> ...
10
votes
5answers
663 views

A command challenge

Here's a little challenge. The goal is to create a command that takes is two or three arguments without using square brackets for optional arguments. The first and second argument are separated by a ...
3
votes
1answer
49 views

Macro expansion in TikZ node

I am having some problems with macro expansion in TikZ nodes. The MWE below is supposed to draw nodes at specified coordinates and display their coordinate rounded to the nearest number, but it shows ...
3
votes
2answers
67 views

\str_case:nnF not finding match

I have written a command using expl3 that is supposed to behave differently if the optional argument is specified as * or **. The command is intended for a math environment, and is supposed to render ...
2
votes
1answer
93 views

What is the e specifier for latex3 and where is it documented/

Pages 1-2 of interface3.pdf, "The LATEX3 Interfaces The LATEX3 Project" Released 2018-10-31 only list specifiers of c, D, , F, f, N, n, o, P, T, V, v, w and x. The e specifier of \str_if_eq:eeTF is ...
4
votes
2answers
62 views

Strange behaviour in l3keys

Consider the following code which uses \keys_set_known:nnN: \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \keys_define:nn {empty_module} {} \keys_define:nn {module1} {key1 .code:n = {\...
2
votes
1answer
40 views

Command defined with \NewDocumentCommand and specifiers {O{strict} m} not receiving all of the mandatory parameter

I defined a command using \NewDocumentCommand with specifiers {O{strict} m}. I expected #1 to default to strict when calling the command with only a parameter enclosed in {}, and to pick up all of the ...
0
votes
3answers
51 views

Function to redefine functions so that they operate with a modified argument

I need to locally redefine some commands taking one argument, so that they are executed with the argument modified by the addition of a prefix. For instance, I need to locally redefine \label so that \...