{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.

learn more… | top users | synonyms

3
votes
1answer
887 views

TeX Live, Ubuntu - Update expl3 to l3kernel problem

I'm a noob with LaTeX. Trying to get my import package to work, I came across a dependency on the ExplFileVersion macro. Googling this issue, I realized I need to update my l3kernel package. The ...
7
votes
2answers
124 views

Is it possible to set a particular item of a LaTeX3 seq?

I want to use a seq as an array and then set a particular item of this array by its index. I know that I can access an item via \seq_item:Nn but didn’t find out if there's something like ...
7
votes
2answers
139 views

How to count the frequency of a token in a token list

Is it possible to count the number of a token in a token list? \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \tl_new:N \tobi_list_tl \tl_set:Nn \tobi_list_tl {foo~bar~baz} ...
8
votes
1answer
132 views

Use LaTeX3 variables within TikZ picture

I’m new to LaTeX3 and don’t understand why the following doesn’t work \documentclass{article} \usepackage{xparse} \usepackage{tikz} \ExplSyntaxOn \tl_new:N { \g_tobi_color_tl } \tl_set:Nn { ...
5
votes
0answers
89 views

What are best practices when augmenting and building on the keys provided by someone else's package

The situation is one where I'm developing my own commands and environments which build on the commands and environments provided by another package: for ease of talking let's call this other package ...
12
votes
2answers
123 views

How can I access the depth of a given sectioning command?

In the LaTeX Wikibook, we can see a table that gives the depths of the sectioning commands: part: -1 chapter: 0 section: 1 subsection: 2 etc. Is there any way to access this information dynamically ...
6
votes
3answers
185 views

White space unexpectedly lost when trimming a string

I'm trying to follow the example given here \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \seq_new:N \l_ae_insertQuotedMatter_seq \tl_new:N \l_ae_insertQuotedMatter_trash_tl ...
3
votes
1answer
107 views

LaTeX3: insert macro after (unknown unknown number of) parameters?

I've just played with expl3 for a couple of hours. Many things are much more convenient than with 2e. There are functions for things that I thought to be impossible with LaTeX. However, I am missing ...
6
votes
2answers
111 views

How do I get a token list with an end-of-line character in it?

The context of this question is that I have a command defined using xparse that slurps in a verbatim argument which can be long. I want to do a replacement on the resulting token list, but the token ...
8
votes
1answer
98 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: ...
6
votes
2answers
156 views

expl3 switch for booleans: Is there a \bool_case:Nnn?

There's \int_case:Nnn, \tl_case:Nnn, \str_case:Nnn, but I can't find something like \bool_case:Nnn. I know I can write: \bool_if:NT \l__<mymodule>_<nameA>_bool { ... } \bool_if:NT ...
3
votes
1answer
88 views

l3doc in combination with minted

The following question is related: How to add listings environment to DTX files I want to use the document class l3doc in combination with minted. However I am not able to get a nice result. If I ...
5
votes
2answers
130 views

Can I refer to key value in general code?

Related: keyreader: How to save choice key value to a macro. I’m using l3keys2e, but I suspect this might not be the ideal way to go about what I’m trying to do. I’m building a private package ...
5
votes
1answer
88 views

Entering infinite loop when defining command with a weird argument

I thought that I was following the model offered in Splitting delimited token list argument. The only difference is that I did not see the need for using the lower case trick. \documentclass{article} ...
7
votes
2answers
143 views

Generate l3keys meta key from subkey

I’ve created a simple package with options settable via l3keys2e. I was able to figure out how to make the syntax \usepackage[format = international]{phone} work, but I’d like to make the syntax ...
4
votes
2answers
84 views

Optional argument not getting set to \makebox through expl3 key assignment

The basic idea that I wanted was to create a key to pass a value that would inform \makebox how the contents of the box should be aligned. Big fail here. The intended contents of the \makebox are ...
13
votes
1answer
134 views

How do I remove the next token from the stream in LaTeX3?

I want to remove a token from the stream from within a command (ignoring spaces). The next token will be a { (actually, I've just thought that it might not be ... but I'll continue as if it were). ...
4
votes
1answer
128 views

How to output sequence elements and total in expl3

Suppose, I have a sequence of numbers: {1,2,3}. I want to output it like this: 1 + 2 + 3 = 6 I created this code: \documentclass{article} \usepackage{xparse} \usepackage{expl3} ...
3
votes
2answers
125 views

How to use a local variable inside a macro in expl3

I extended egregs answer by defining a macro, that creates and initializes an fp value in 1 line. Then put the variables into a sequence and printed the sequence: \documentclass{article} ...
7
votes
1answer
94 views

Use expl3 variable decimal representation outside of expl3 block

Suppose, I have a floating point value inside expl3 block. Can I use it's decimal representation outside of expl3 block? This doesn't work: \documentclass{article} \usepackage{expl3} ...
4
votes
1answer
83 views

How to format expl3 floating point number using siunitx

Code \documentclass{article} \usepackage{expl3} \usepackage{siunitx} \setlength\parindent{0pt} \begin{document} \ExplSyntaxOn \fp_new:N \mynumber \fp_set:Nn \mynumber{5} \fp_div:Nn \mynumber{2} ...
6
votes
2answers
71 views

Inline Mapping Bug?

The enclosed document creates a sequence variable and then uses inline mapping to attach a sequence number to each item. The inline map then outputs the result and places it into a token list variable ...
8
votes
2answers
425 views

Rounding up decimal number using LaTeX 3

I would like to use LaTeX 3 to round up decimal numbers; I want something like the following: If I type \RoundingUpFunction{2.7} it should return 3 as output. Unfortunately, I haven't taken the ...
9
votes
2answers
132 views

Emulating \@ifnextchar in expl3

I would like to write an expl3 version of the following. \documentclass{article} \makeatletter \def\ie{i.e\@ifnextchar.{}{.\@{} }} \makeatother \pagestyle{empty} \begin{document} \noindent \ie ...
9
votes
3answers
167 views

Test whether last letter of a string is upper case or not

I would like to define a command that will behave according to the nature of the last character fed it. But I'm having difficulty just getting the components of my command to work. I thought I could ...
13
votes
1answer
133 views

How do I register the prefix of my expl3 package?

This question needs an easy to find answer here, so: I was told that I can and should register prefixes of my macro names in my expl3 using packages. How do I do that?
7
votes
2answers
148 views

How to document a expl3 macro using dtx

I am writing the documentation to a package implemented in expl3 using ltxdoc, and the relevant part would look like % \begin{macro}{\conteq_args_once} % Some explanation % % \begin{macrocode} ...
8
votes
2answers
167 views

Can I store sequences in sequences with expl3

The documentation for l3seq states LaTeX3 implements a “sequence” data type, which contain an ordered list of entries which may contain any balanced text . but for many programming tasks it ...
8
votes
2answers
340 views

PDF keywords from Expl3 clist

I’m trying to add PDF keywords to my résumé. In the custom class file, I have these lines: \clist_new:N \jcsres_keywords_clist \NewDocumentCommand \keywords {m} { \clist_gset:Nn ...
3
votes
1answer
83 views

Expl V-type argument no fully expanding as I expected

This is related to an earlier question of mine. I'm posting my own interpretation of what's happening hoping that if I'm wrong, someone will chime in an explain why. The issue with xparse's ...
5
votes
2answers
127 views

Expl variable assignments not behaving as I expect

I don't get what I'm doing wrong here. Neither of the commented lines work as the uncommented version does. \begin{filecontents}{silly.tex} This is just a test. \end{filecontents} ...
4
votes
2answers
83 views

“hiding” \par from a tabular

I want to use a macro to write a line of a tabular. As part of this macro, there is an argument that isn't set in the tabular, but is saved for later use. This unused argument should be allowed to ...
8
votes
1answer
133 views

Sorting a clist in LaTeX3

I have a clist that I'd like to bubble sort. I'm sure this is a simple matter of something like \clist_bubblesort:N or something, but I don't know what the appropriate incantation is. A quick google ...
6
votes
2answers
79 views

l3prop - getting an entry inside a macro fails

I the following example I defined two new macros \UseLength and \xUseLength. Both macros shall put back the stored value of the key in the input stream. The macro \UseLength works as expected. The ...
5
votes
1answer
66 views

How to redefine \str_if_eq:xxTF for backward compatibility

I just updated all the packages for TeXLive 2012 today and it appears that \str_if_eq:xxTF has been deprecated. How do I define a macro so that I can use the latest TeX Live but still be able to run ...
4
votes
2answers
132 views

Can't generate a tikz matrix, using expl3

Suppose, I want to generate a matrix of nodes: \documentclass{article} \usepackage{expl3} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \matrix [ row ...
3
votes
1answer
117 views

How to use a macro inside \tl_set:Nx

This code works: \documentclass{article} \usepackage{expl3} \usepackage{color} \setlength\parindent{0pt} \begin{document} \ExplSyntaxOn \tl_new:N \_text \tl_set:Nn \text {1} \tl_set:Nx \text ...
3
votes
1answer
83 views

expl3 outputting sequence of plists

Suppose, I have a sequence of 2 plists: ( { 1 => 2, 3 => 4 }, { 5 => 6, hello => 8 } ) I am traversing through the sequence and want to output only plists, ...
35
votes
2answers
607 views

What do ExplSyntaxOn and ExplSyntaxOff do?

Related to the question What do \makeatletter and \makeatother do? for LaTeX2e, here related to LaTeX3 What do \ExplSyntaxOn and \ExplSyntaxOff do?
6
votes
3answers
377 views

How to use data structures in TikZ?

I created a foreach statement, using expl3 and TikZ/pgf: \documentclass{article} \usepackage{tikz} \setlength{\parindent}{0cm} \usepackage{expl3} \ExplSyntaxOn \cs_new:Npn \Counter #1 \Stopper { ...
9
votes
2answers
160 views

Text within ExplSyntaxOn/Off

As below, I would like to test whether a user has input some custom text, and if not, then to display default text. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N \l_empty_tl ...
7
votes
1answer
377 views

Wrapper for siunitx' \SI macro to automatically split number and unit

Problem I use the siunitx-package to typeset numbers and units with correct spacing etc. There is a command \SI{<number>}{<unit>} for that. However, it would be much easier to write ...
4
votes
1answer
144 views

Search specific entries in database

I have written a command, which takes five arguments to interpolate between two points. Now I tried to get the two points from an csv file. \documentclass{article} \usepackage{expl3} ...
8
votes
1answer
172 views

Working with clist indices in LaTeX3

Friends, I'm trying to port an old code of mine to a LaTeX3 implementation. Thanks to egreg, Joseph and David, I made a good progress! But then, I got stuck. From the link above, I'm porting my ...
3
votes
1answer
64 views

How do I create an expandable conditional with a loop inside?

I need to create an expandable conditional that uses a loop (that is, a ..._map_function:). It should either return true from inside the loop, or return false otherwise. In a 'normal' programming ...
4
votes
1answer
119 views

Writing macros on file defined at compilation time

This is a follow-up to this question. I have a LaTeX3 code that reads a file formatted as follows: <numberA> "<nameA>" <numberB> "<nameB>" <numberC> "<nameC>" ...
1
vote
0answers
74 views

Conflict between expl3.sty and breqn [duplicate]

I've encountered some problems using the breqn-package. I've allready read most of the topics on this forum about breqn but didn't find a solution. When I use the breqn-package, the log-file produces ...
3
votes
0answers
885 views

miktex 2.9, l3kernel installation fails [closed]

I freshly installed 2.9 I tried to compile a XeLatex document, which works fine on my work computer. I got the following error: expl3.sty missing. It tries to install l3kernel starting package ...
14
votes
2answers
343 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
73 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 ...