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.

Filter by
Sorted by
Tagged with
1
vote
1answer
41 views

Expl3 - Can you outline the trick applied with \file_parse_full_name:nNNN for preventing expansion only with active characters?

This question is not about something not working. This question is about how a nice trick is accomplished. interface3.pdf, section "12.2 File operation functions" says about the function \...
0
votes
1answer
35 views

Process index of l3doc file / of .dtx file

I understand that .dtx files are a way to both document and implement a package in one file together. Also, in newer versions, usually pdflatex package.dtx should typeset the documentation. I wanted ...
1
vote
0answers
39 views

Save environment declared with \NewDocumentEnvironment to redefine it

I have some environment declared with \NewDocumentEnvironment, lets call it oldenv which I want to redefine in another package, to tweak it a little bit. However, in the redefinition I want to make ...
0
votes
1answer
36 views

Understaning 'Predicate must be expandable' error

I don't understand the commented version of this piece of code. \regex_match:nnTF is not expandable, so why should a predicate derived from it be defined as expandable? \documentclass{article} \...
1
vote
1answer
47 views

Variant of \quark_if_novalue:n not generating

I have a token list variable, which I assigned by extracting a key from a property list. I now want to test if the token list is the \q_novalue quark. From what I understand, I would need the \...
3
votes
2answers
86 views

How to use variables in a conditional function with expl3?

I want to learn expl3 programming. To make myself familiar with the syntax, I wanted to create some dummy programms, such as computing prime numbers. However, I am stuck defining a function which ...
1
vote
1answer
52 views

clist_if_in:nV fail on a str variable

Is it a bug? Following code got BUG STR and PASS TL \documentclass{article} \ExplSyntaxOn \str_set:Nn \l_tmpa_str { b } \clist_if_in:nVTF { a, b } \l_tmpa_str { \tl_show:n { PASS~STR } } { \...
5
votes
2answers
215 views

Is there any reason to *not* use the LaTeX3 Programming Layer (expl3)

I am just discovering the LaTeX3 Programming Layer (expl3) and am pleased by the very elegant solutions that it provides. Considering that it exists for quite a while now, but still is in development (...
2
votes
0answers
55 views

Conflict with tikz using LaTeX3's keys module

I want to use LaTeX3 to set some parameters for node, but something goes wrong, mwe is as follows \documentclass{article} \usepackage{tikz,xparse,expl3} \begin{document} \ExplSyntaxOn \...
4
votes
2answers
146 views

"Lazy" cases with expl3?

Problem: i would like to have a command, which takes one mandatory and one optional argument. If the optional argument exist, select the corresponding case, otherwise return all case opportunities. ...
1
vote
1answer
62 views

Creating a table from a comma separated list in LaTeX3

I have a comma separated list and want to create a table from it, like so: \documentclass[margin=0.1cm]{standalone} \usepackage{expl3} \begin{document} \begin{tabular}{c | c} \...
3
votes
3answers
70 views

No space no caps tokenlist

This took me longer than I'd like to accomplish what should have been a very simple task. I needed a way to turn a tokenlist lowercase and remove the spaces. But str_lowercase:N doesn't exist! And ...
1
vote
1answer
35 views

How can I correctly expand the result of \prop_item:Nn to work with my own \DoSomething function?

OK, here is the thing. I want to store property-value pairs and then later use this as a lookup table to feed the value into another function. This is what I came up with and I don't know how to fix ...
1
vote
1answer
27 views

Using token list of expl3 with array package leads to conflicts

I use the syntax of expl3 to type a table with increasing number. The usage can be found here: Create tabular depending on counter \documentclass{article} \usepackage{array} \begin{document} \...
3
votes
1answer
59 views

Unexpected line break before makebox with expl3 syntax

I want to type some texts as the following. some text:____underline_text_______ I hope the total length of the above texts could be some given length. The length of the underline part depends on the ...
1
vote
1answer
73 views

LaTeX3 package internationalisation

I am working on a package for redacting names in minutes of meetings. The idea is that a name 'John Doe' is replaced by '<person 1>'. However, this package may be used both in English and in ...
4
votes
2answers
57 views

How to use \clist_map_tokens:Nn?

p. 175: \clist_map_tokens:Nn⟨clist var⟩{⟨code⟩} calls ⟨code⟩{⟨item⟩} for every ⟨item⟩stored in the ⟨comma list⟩. If the ⟨code⟩consists of a single function this is equivalent to \clist_map_function:nN....
5
votes
2answers
86 views

Merge comma separated lists from Datatool

I have tried solving this for some time now but can´t seem to find the solution. I have a document that loads data from a CSV-file using Datatool and I have been trying to combine comma separated ...
4
votes
2answers
74 views

latex3: \tl_case not properly detecting value of a token

I am creating a package with different internal functions that can be setup with the tokens provided during the initialization of the package. Inside the package, everything is written using the ...
0
votes
0answers
68 views

Is there a package that provides the "additional functionality" required by l3kernel?

The README.md file for the l3kernel package says that the package "requires the e-TeX extensions and additional functionality to support string comparisons, expandable character generation with ...
1
vote
1answer
50 views

linewidth failed after using \dim_set_eq in LaTeX3

When I wanted to compare a dimension variable with the current linewidth, I use the follow MWE code: \documentclass{article} \begin{document} \ExplSyntaxOn \dim_new:N \l_line_width_dim \dim_set_eq:NN \...
1
vote
2answers
88 views

variable in expl3 case function does not seem to expand/substitue (code compiles but strange output)

the provided code copy-paste ready and compiles. Problem: the \l_secondIndex_tl variable does not seem to expand to its stored value in the \tl_case:NnF -line and therefore the code does not find the ...
6
votes
1answer
60 views

Why does a newline character still disappear even with other/active catcode set?

For example, with this code %! TEX program = lualatex \documentclass{article} \begin{document} \ExplSyntaxOn \char_set_catcode_other:N \% \tl_set:Nn\var{%} \tl_analysis_show:N\var \ExplSyntaxOff \...
9
votes
2answers
519 views

In LaTeX3, how do I peek ahead for an active character?

LaTeX3 defines the \peek_catcode_ignore_spaces:NTF which allows me to look ahead at the next token in the stream (ignoring spaces) and test its catcode against those of a slew of standard tokens. So ...
6
votes
2answers
135 views

Expl3 token list with UTF-8 characters (or seeing it as a byte list)

I'm currently using expl3 code in a project. It's been a slow learning process. Now I need to deal with an UTF-8 input stream, but, as I already suspected there's a problem dealing with 2-byte ...
3
votes
1answer
60 views

Latex3: handling of sub-functions with shared name sub-parameters

I am using latex3 to write a set of macros. I have defined the nomeclature class, and a nominal case which comprehends all the possible combinations to be used in the test cases_i ( i = 1:N ). Now I ...
4
votes
2answers
91 views

Appending a token list keeps referring to it instead of copying

I actually had some workarounds and overcame my issue. But I still cannot understand some points. I'm trying to write a command to draw a table. I started with this: \documentclass[10pt]{article} \...
3
votes
1answer
106 views

What are the differences between choice and multichoice in LaTeX3?

When I was reading the interface3.pdf or the source3.pdf about the key-value part, I got confused when I saw <key>.choice: and <key>.multichoice:. The explanations and examples of these ...
4
votes
1answer
246 views

“new” and “set” in LaTeX3

I have some questions in LaTeX, There are many "new" and "set" in LaTeX3, I don't quite understand when “new” is needed,such as \int_set:Nn \l_my_int{12} An error occurred ! ...
0
votes
1answer
40 views

Expansion while processing math in lists with xparse

I'm trying to "print" a comma-separated list of strings. The actual use case is more complex, the list being stored as a key-value, but the MWE below shows the problem: when I add math to ...
2
votes
2answers
70 views

Split a text to a list after passing through \keys_define

I'm trying to create a command with key-value arguments with the second one is a list of items separated by commas. The list is printed normally when I passed it directly to the \DrawList command, ...
18
votes
4answers
1k views

Use recursion in LaTeX3

I want to use recursion to calculate n! in LaTeX3, but found that the result is not correct, mwe is as follows \documentclass{article} \ExplSyntaxOn \cs_set:Nn \froac:n { \...
2
votes
1answer
30 views

Columns of questions without interruptions for a test with multiple choice

I have the file sebmcq.sty created by the excellent users Florent Rougon, Enrico Gregorio to generate a multiple choice questions with answers. % sebmcq.sty --- Multiple choice questions. Can print ...
0
votes
1answer
66 views

How can I make TeX stop on the first error, but do not stop on \show (or \tl_show:n)?

I want TeX to terminate on any error, because I only care about the first error and so that it finishes faster. Unfortunately, if I use either -interaction=errorstopmode (and run with </dev/null) ...
3
votes
2answers
55 views

expl3 empty variable when called by another macro

Here is the boiled-down extract of what I'm trying to do. Apologies beforehand if some of the computations do not make sense, I've modified them for the sake of simplicity. Basically, I've a function ...
4
votes
2answers
158 views

Removing white space from one side of a binary operator

Following up this answer, I would like to create a \num-based command that nullifies the white space from the left side of a binary operator and keeps the space on its right side. In other words, I ...
3
votes
1answer
217 views

Regular Expression using `expl3`

Can anyone explain these regular expressions using expl3 and how those works? \regex_replace_all:nnN { a\-(ai) } { \1 } \l_mytrans_tl \regex_replace_all:nnN { a\-(au) } { \1 } \l_mytrans_tl \...
1
vote
1answer
45 views

expl3: partially expand an argument

I wish to assign a \crefname with dynamical strings. With \exp_args_generate:n { xVV }, I ended up with something like: \exp_args:NxVV \crefname {\__my_countername: } {\csname ...
1
vote
1answer
78 views

expl3: fully expand two more arguments

I wish to assign the \crefname of a counter \__my_countername: according to two related string, and for this I wrote something like: \exp_args:Nx \crefname { \__my_countername: }{ \csname my@cref@\...
0
votes
2answers
56 views

Transliteration of vowels in Benglai problem

Vowels Problem I can't fix a problem regarding with া, ি, ী, ু, ূ etc. bangla vowels. For example, if I write \bn{amra khai} using following MWE, it should be আমরা খাই, but I get the output ামরা াম খা...
4
votes
1answer
64 views

hyperref: Special characters in section title, retrieved from an expl3 property list

I'm having trouble getting an ampersand to show up in the PDF table of contents in a document structured like so: \documentclass{article} \usepackage{hyperref} \ExplSyntaxOn \prop_const_from_keyval:...
3
votes
1answer
118 views

Relative and absolute position inside a tikzpicture

I would like to position "grids" on the page. I've placed them in a scope, named the local bounding box, and attempted to use that for relative positioning, e.g. shift={($(myscope.center)+(...
4
votes
1answer
155 views

How would I know to use #1 versus ##1 in the function used in \seq_set_map?

On page 148 of The LaTeX3 Interfaces (interface3.pdf) dated 2021-10-12, the documentation for \seq_set_map:Nn states that the inline function that I'm using should receive each item in the sequence as ...
0
votes
1answer
98 views

Does author of LaTeX documents need xparse or \ExplSyntaxOn?

If an "end-user" is preparing documents with LaTeX and using the current version of LaTeX(as of now, LaTeX2e <2021-06-01> patch level 1), which automatically loads L3 programming layer ...
1
vote
1answer
34 views

Custom command with nested sequences and argument with macro

I am trying to create a command that used nested sequences e.g. [[1,2,3],[4,5,6],...] where the brackets represent a sequence The problem I have right now is that I cannot pass a macro as an argument. ...
0
votes
1answer
52 views

Nested sequence containing sequences

I am trying to create a nested sequence where each element is a sequence but for some reason it does not compile and exists with an emergency stop. MWE: \documentclass{article} \usepackage{expl3} \...
6
votes
1answer
74 views

Is `\coffin_gattach:…` not really global?

Below is an MWE that typesets “AB”, as it should. However, if one uncomments the \group_begin: and \group_end:, the B disappears—i.e., the attachment seems to be performed locally, despite the use of ...
1
vote
1answer
45 views

How to set specific seed for random number generator in expl3 for use with xfp

I am using the xfp package to generate some random numbers, and am trying to figure out how to specify a specific random seed for the pseudo random number generator (so it gives the same results ...
4
votes
2answers
54 views

Redefine active character `~` in expl3

Is there any way to redefine the tilde (~) active character in expl3 syntax? In expl2, I would simply do something like \let~\relax, but due to the interpretation of ~ in expl3, this is not possible.
0
votes
1answer
52 views

Generate an expandable error message when a file does not exist

I would like to understand how to use the expl3 command \msg_expandable_error (as used here) with \IfFileExists to get an expandable error message if some external file does not exist. I deliberately ...

1
2 3 4 5
22