Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
33 views

Use value from xparse key-value store in regular expressions

This is an extension of a previous question (link). I would like to include the following xparse key-value store holding a name value into the document below: % Key-value store \ExplSyntaxOn \...
1
vote
1answer
28 views

How to create a string comparison with xparse's \NewDocumentCommand?

My MWE was created with the help of these two Q&As: 1 and 2. MWE: \documentclass{article} \usepackage{xparse} \usepackage{xstring} \usepackage{pdftexcmds} % Command declaring a global ...
0
votes
1answer
43 views

How to use xparse's NewDocumentCommand for global definition?

This is re: egreg's solution to this question. Issue: I would like the \NameOne command to replicate the \NameTwo command where it outputs only when being called on like so: \NameOne. When an ...
3
votes
1answer
47 views

Getting errors using Acro for abbreviations and acronyms: Undefined Control Sequence in acro.sty

I've been trying to use acro for abbreviating terms in a report. It mostly works but each compile requires intervention to complete and does something to my first page, leaves an =1 and a page break. ...
7
votes
3answers
524 views

Who ate my space? (How to stop \exp_args:Nf from consuming a space?)

I have a macro that uses \prg_replicate:nn to produce a number of spaces, then pass those spaces, after f-expanding \prg_replicate:nn, to another macro. The problem is that when I use \exp_args:Nf, it ...
2
votes
0answers
81 views

recent l3kernel package and TikZ library calligraphy are not compatible [duplicate]

Today I update my MikTeX installation. Among updated packages is l3kernel which doesn't work with calligraphy library, even if it is not used in TikZ picture: \documentclass[border=1mm, tikz]{...
0
votes
0answers
46 views

l3keys2e's option with accent: \UseTextAccent… \@curr@enc error

The following expl3 class, that provides an option (mykeyword) thanks to l3keys2e, works like a charm: \begin{filecontents*}{myclass.cls} \RequirePackage{l3keys2e} \RequirePackage{expl3} \...
3
votes
2answers
33 views

Special treatment for first and last items in \seq_map_inline

It is rather common to have to apply special treatment for first and last items of a sequence. I wonder what the best ways to treat these cases in expl3's \seq_map_inline. For instance, suppose I'd ...
2
votes
1answer
58 views

What's the expl3 way to access TeX insertions?

Is there an established expl3 way of working with insertions defined in TeX? The issue came up for me with trying to modify \footins. I don't see anything in the documentation other than the renamed ...
3
votes
2answers
198 views

LaTeX 3 string variable with braces

I want to include some braces in my string variable: \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \str_new:N \l_example_var \int_new:N \l_example_int \...
6
votes
1answer
70 views

Protected expansion in expl3

I am trying to understand whether there is a proper expl3 way to achieve the same result as the latex2e \protected@edef, that is expanding a token list while respecting the \protect mechanism of ...
0
votes
0answers
45 views

Why is \tex_par:D behaving differently from \par?

As illustrated in the MWE, using \tex_par:D rather than \par within a list environment leads to unexpected side-effects. Is this intended behavior? If so, it's likely to break a lot of code. I ran ...
3
votes
1answer
106 views

Proper LaTeX3 syntax for \usepackage{<name of .sty file>} - \ProvidesPackage{<name of .sty file>}

The MWE_1 defines a document command which in turn calls a \cs_ macro. Both are defined in the document's preamble section sandwiched between \ExplSyntaxOn \ExplSyntaxOff statements, as is the ...
3
votes
1answer
33 views

Locally redefining ~ in code that uses expl3 facilities

I am trying to rewrite a package to use expl3 facilities. Here I need to define an \initializeplaintitle command that stores a "purified" version of the document title, retrieved from \@title into a ...
4
votes
2answers
48 views

latex3 / expl3 equivalent of \raisebox with lenght expression

I am trying to learn expl3 by re-implementing some macros and little packages to take advantage of it. I am now wondering if there is a more latex3-ish way of doing something like \raisebox{-\height+...
3
votes
1answer
83 views

Issue with \@ifl@ter and expl3 date style

I use MiKTeX on windows and am currently having trouble loading expl3. I recently updated the LaTeX3 packages. The following code is sufficient to generate the error: \documentclass{article} \...
2
votes
1answer
52 views

Undefined control sequence \g__prg_map_int [duplicate]

I'm trying to improve an answer of mine and I've found a solution which works perfectly on Overleaf (I looked at the log, not only what is displayed). \listfiles \documentclass[12pt,fleqn]{article} \...
12
votes
2answers
425 views

What is the best practice to pass spaces to Lua from expl3?

In LuaTeX, using the \directlua primitive (within a standard LaTeX2e setup) \directlua{tex.print("Hello World!")} will produce "Hello World!" to the output PDF. On the other hand, in expl3 code \...
0
votes
1answer
49 views

Biblatex: brackets and no bracket

I would like to know whether it is possible with biblatex and pdflatex to automatically select the in-text look of the \cite command, with the author-year style. For instance, I would like citations ...
0
votes
1answer
34 views

Can `function`s called in `\tl_map_` and `\seq_map_function`s be defined with more than one argument?

In providing an answer to my recent post "Preserving spaces when scanning tl variables into a sequence using \seq_set_split" Enrico Gregorio defined \__rn_add:n to be called by \tl_map_function. In ...
4
votes
1answer
57 views

Question about the booleans in expl3 (of LaTeX3)

In expl3, there are the commands \int_zero_new:N, \tl_clear_new:N, \str_clear_new:N , \seq_clear_new:N, \clist_clear_new:N, etc., but there is no similar command for the booleans (something like \...
1
vote
2answers
48 views

Testing a tl variable for being a special character

Following on from my question yesterday (Testing items in a tokenlist variable for special characters using tokenlist constants) and the brief discussion and answer I had from egreg, the least I would ...
2
votes
1answer
33 views

Testing items in a tokenlist variable for special characters using tokenlist constants

My attempts to test individual items in a tokenlist variable for special characters using the constants provided in interface3 VII.9: Constant token lists are failing miserably. Passing a special ...
2
votes
1answer
42 views

How to test a \newif conditional in expl3

Suppose I want to test an \ifSomething conditional that is defined by a package which may or may not be loaded. I know how to do this in plain LaTeX, but I'd like to define an expl3 conditional to do ...
4
votes
3answers
113 views

Preserving spaces when scannig `tl` variables into a sequence using `\seq_set_split`

As stated in the interface3 document (Part IX, 1. Creating and initializing sequences) \seq_set_split: does not preserve spaces. Wishing to scan the text contained in a _tl variable into a sequence ...
2
votes
2answers
48 views

Math subscript inside ExplSyntax switches

I'd tried to rewrite @egreg answer given in this Reusing of DeclarePairedDelimiter in a foreach manner thread to solve another 'code reuse' issue, but I've got some problem with math subscript between ...
4
votes
1answer
46 views

Where does the \par come from with \hbox:n

I don't know anything about expl3. I naively thought that I would get the same output for both lines \documentclass{article} \usepackage{expl3} \begin{document} \makeatletter A \def\par{1\global\let\...
15
votes
2answers
480 views

Passing arguments to a macro hidden in the text

Context: I'm trying to write a macro that behaves somewhat like C's printf family of functions. For instance, the following C code: #include <stdio.h> int main() { printf("Hello %s! Today'...
3
votes
1answer
35 views

Reusing of DeclarePairedDelimiter in a foreach manner

I'd like to reuse mathtools DeclarePairedDelimiter in a foreach loop manner, but I have never done any low-level (La)TeXing before. Here is my code: \documentclass{article} \usepackage{mathtools} \...
3
votes
1answer
47 views

expl3 property list values as `clist` vs token lists

I have a (potentially) long property list, which values, at the moment, are just token lists. Now, I want to implement that some of the keys may have multiple values. I will store these multiple ...
0
votes
0answers
31 views

Is there a function that allows the internal code of a `\cs_` function to identify by which `\cs_` function or `document command` it was called?

As one accumulates and works with an increasing number of utility functions (control sequences), the ability, when tracking errors, to identify the function or document command from which a call was ...
2
votes
1answer
109 views

What is it I am doing wrong using `\tl_case:Nn …`?

When using document command arguments for case distinctions I routinely have been using the \str_case:nn function, which works fine as is evident from the output of the \myStrCase command. When ...
3
votes
1answer
57 views

\file_add_path:nN function appears to have gone overboard

The l3file package in the interface3 document used to define the \file_add_path:nN function; but no longer. Has that function been discarded? If so I wonder how to work around this as I am using \...
11
votes
1answer
1k views

Is LaTeX3 ever going standalone or has this goal been abandoned?

I recall that earlier (over 10 years ago), producing a standalone compiler of LaTeX3 code was a project's goal. Today, this goal is no more articulated. Instead, the developers stress today that LaTeX ...
2
votes
1answer
123 views

How can I put four (or more) commands in one command, without repeating so much code using expl3?

I'm trying to put together four commands that encapsulate tikzpicture environments and the use of tikzmark, in one, all have their own keys, but, they have a lot of code in common. The commands are ...
3
votes
1answer
42 views

How to pop (right) a token list with expl3?

The expl3 package provides \tl_put_right which enables us to append tokens to the right side of the current content of a token list variable: \documentclass{article} \usepackage{xparse} \begin{...
4
votes
1answer
30 views

Custom command to lay out a row of images

I'm learning expl3, and to practice I created a simple command to lay out a row of images so that the row fits in one line and all the images have the same height and, optionally, a spacing between ...
2
votes
1answer
34 views

expl3's [check-declarations] fails to recognize a declared constant

The answer to TeX.SX submission Labelling confusion in expl3: (public, private) Vs (global, local) dated May 6, 2016 was accompanied by the code below. Why does loading expl3 with [check-declarations]...
2
votes
2answers
33 views

Using control sequence as part of key names in property list

Adapting Joseph's answer in Extract the numerical and non-numerical portion from text to count a non-numerical portion from a text. The idea behind my method is to use regex to seperate the numerical ...
7
votes
1answer
61 views

latex regex remove word

I am using the hyperref package and I want to make a command for writing \hrefs once with their protocol removed. For example, https://google.com becomes linked google.com http://google.com becomes ...
4
votes
1answer
42 views

expl3: How to add a clist-grouping brace to a tokenlist?

I have LaTeX3 code for a macro that processes its parameters in a complicated way and builds a tree-like structure. To represent this structure it constructs a comma-separated list of strings and ...
2
votes
2answers
119 views

Token list vs string in LaTeX3

In my opinion, l3 strings are special token lists whose where all characters has category code 12 (except space), and most interfaces in l3tl and l3str are similar. So, if I just want to process "...
2
votes
1answer
90 views

Latex3 programming and tex primitives: how to “execute after” instead of expandafter

Here is a bit lengthy question. I hope it is not too specific. I'm trying to scan some tex documents and I want to produce text files directly. I'll achieve this by scanning the tex input token by ...
1
vote
1answer
44 views

Problem in l3bootstrap.sty, not compiling?

I am trying to compile a tex document using PCTeX, but I get the error appears on the package file (l3bootstrap.sty) as it shown in the image below, I dont know whats the problem here, why is there an ...
10
votes
1answer
130 views

Undefined sequence error with calligraphy tikz library

The following MWE is from calligraphy's manual (p.9) with Joseph Wright's workaround for the library's use of obsolete functions: \documentclass[border=10pt]{standalone} \usepackage{tikz} \usepackage{...
2
votes
1answer
70 views

expl3 read a comma list from file

I am using expl3 now, I want to read data from file, and store them in a comma list, then use the comma list one by one. I don't have any code, I just know exp13 have these function, so need someone ...
2
votes
1answer
71 views

Latex3: Unicode (utf8) string, weird output with pdflatex

I want to store text that contains non-ascii characters in latex3 string variables. With xelatex and lualatex it works well but With pdflatex next mwe produces incorrect output. For legacy reasons ...
6
votes
2answers
60 views

listings: highlight a prefixed keyword starting with a single quote

This is about Rust and their lifetime notation: \documentclass[crop,varwidth]{standalone} \usepackage{listings} \usepackage{xparse} \usepackage{expl3} \usepackage[svgnames]{xcolor} \def\noprint#1{} ...
11
votes
1answer
184 views

Querying the state of a boolean from lua

I can query and use the states of counts in lua without problem. But now I'm wondering how to at best do it with booleans. I have been looking at the token library but it seems not to allow to get and ...
3
votes
1answer
53 views

Latex3: multicolumn at the beginning of a token list produces an error

I'm not sure if using token list is a good approach to generating table data. Anyway, here is a weird result. It works well in all other cases except when the first item in token list is multicolumn. ...