{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

103
votes
5answers
9k views

LaTeX3 versus pure Lua

Reading this site for the last nearly two years I've learned a lot about LaTeX3 (which I had previously understood to be a defunct pipe dream) and LuaTeX (of which I was previously totally unaware). ...
37
votes
3answers
942 views

LaTeX3-sensitive editors

I'm starting to embed LaTeX3 code in my custom classes and packages -- and enjoying it more the further I learn about it --, but at least to me it would make for an even better experience if, as it is ...
36
votes
2answers
569 views

How “safe” is it to use LaTeX3 (l3packages, l3kernel)?

Are l3kernel and l3packages present in most of the LaTeX distributions? Are they "stable enough"? I am asking this because I am preparing a .tex document for a client. I have found convenient to use ...
35
votes
2answers
525 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?
28
votes
2answers
751 views

Moving to LaTeX3 for package authors

I would like to write a package using as much of LaTeX3 stuff as possible (in particular expl3, xparse and xtemplate). What should I read to learn these? In particular: I know that there are good ...
28
votes
1answer
308 views

LaTeX3 — What is the difference between the modules l3seq and l3clist?

LaTeX3 provides the two modules seq and clist. What is the difference? The module clist is introduced by Comma lists contain ordered data where items can be added to the left or right end of ...
19
votes
7answers
1k views

Pros and cons of the LaTeX3 syntax?

The programming language introduced by expl3 in LaTeX3 is a bit unusual compared to other TeX macro languages in that it uses both _ and : for function names. Could someone provide some technical ...
19
votes
2answers
420 views

Usage of \lastbox

As part of our LaTeX3 work, we provide a consistent interface to TeX programming through the expl3 package. We've recently been discussing the TeX primitive \lastbox, which is used to inspect or ...
18
votes
4answers
504 views

How do I get a value out of a group?

I've just recovered from my first real foray into LaTeX3 programming. It was ... an experience. Not a completely unpleasant one and once I'd gotten used to the syntax then I found it a lot easier ...
18
votes
1answer
322 views

Vim Configuration for expl3

I've started with programming in expl3 and vim doesn't realise that underscores are now part of LaTeX identifiers. I'd be much obliged if somebody could explain how to best configure vim so it has ...
17
votes
1answer
411 views

What are expl3 quarks? When, where, why and how should I use them?

I feel particularly bombarded by sub-atomic particles right now (and it's mostly Will's fault :)). First, in Will's answer to this question today, he referred to expl3's \prg_case_str:nnn command. ...
16
votes
4answers
668 views

Is this branching code I wrote a bit obfuscated?

I've been away for a while and I forget if this sort of question is appropriate, but here goes. Recently I wrote some code (in expl3 but I hope it's clear enough) and in hindsight I wonder on its ...
16
votes
2answers
718 views

Where can I find the LaTeX3 manual?

Few month ago I saw a big pdf-manual of all LaTeX3-packages and the new syntax. I think it was bigger than 300 pages. I can't find it on the web. Does anyone have a link?
15
votes
3answers
623 views

Will LaTeX3 have proper support for hooks? Does LuaTeX?

Tex has powerful support for extensions triggered by events happen in generating output, by running one of six token lists appropriately: \everycr \everydisplay \everyhbox \everymath \everypar ...
15
votes
1answer
408 views

Guidelines: when is LaTeX3 too much LaTeX3?

This morning I found myself writing a document where essentially the same text is repeated several times. Because I've been mucking around a lot recently learning LaTeX3, it took absolutely no ...
14
votes
2answers
334 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 ...
14
votes
2answers
147 views

writing to \jobname.aux using LaTeX3

In LaTeX2e, one can write to the standard auxiliary file via the \@auxout file handle. Are there dedicated LaTeX3 functions (planned) that facilitate writing to \jobname.aux or is there an equivalent ...
14
votes
1answer
343 views

Is there a LaTeX3 approach to \ignorespaces?

The following code works as I would like it to: Given the state of the boolean, certain content is to be printed or not. If it's not printed, then I run the risk of creating extraneous whitespace. ...
14
votes
1answer
808 views

How to transpose a table in expl3

I've been very impressed with xparse and expl3, and have written a wonderful document command using \ProcessList that takes a comma separated list and turns it into a (basically) 1 column table. ...
13
votes
1answer
594 views

Subscripts and superscripts

In LaTeX2 a_1, a_{123} and a^1, a^{123} used to produce subscripts and superscripts respectively. In LaTeX3 superscripts still work the same way, but what happened to subscripts? I suspect the ...
13
votes
1answer
131 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?
13
votes
1answer
145 views

How do I insert a tie (~) under expl3 syntax?

I need to define a token list of the form \tl_new:N \g_silly_tl \tl_set:Nn \g_silly_tl { Text ~ and ~ a ~ tie:?? } How do I do this? More generally, is there a reference where one can see how ...
13
votes
1answer
172 views

Using calc-like (calc Package) Commands within LaTeX3/expl3

In my pursue to switch as much as possible from LaTeX2e code to LaTeX3/expl3, I got stuck with the usage of some of the calc package facilities. I've read of the l3calc package, but it seems it is ...
13
votes
1answer
121 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). ...
12
votes
2answers
122 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 ...
11
votes
2answers
253 views

aliasing vs variants — preferred practices?

This is somewhat related to a question I asked earlier here. I'm trying to split a token using a delimiter. However, the delimiter is stored in a token. Looking at the most recent documentation, I ...
11
votes
2answers
80 views

How can I insert an entire input stream (up to EOF) into an output stream?

I am trying to automate the generation of a text version of my resume. I'd like to incorporate a note to any potential human readers (most plain text resumes are, to my understanding, simply scanned ...
11
votes
1answer
93 views

Processing document class options with l3keys

How can I parse (that is, access) the entire option list given to the current document class with l3keys? This would obviously need some sort of \keys_define:nn { document-class-?? } { default ...
11
votes
1answer
139 views

Is it reasonable to expect an expl3-compatible release of TikZ/PGF in the future? / Workarounds for using TikZ under expl3 syntax

Keeping in mind: TikZ uses space tokens significantly, and expl3 syntax completely disregards whitespace and will only become more prevalent, is it reasonable to expect a future version of TikZ ...
11
votes
1answer
834 views

A LaTeX3 macro to typeset chemical compounds?

Out of curiosity I wonder how would a macro coded in expl3 that does the basics of mhchem (as in section basics in mhchem manual) looks like? I have found examples in TeX and LuaTeX in ...
10
votes
2answers
289 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 ...
10
votes
3answers
142 views

What is the difference between \cs_if_exist:NTF and \cs_if_free:NTF?

I don't understand what difference of existance and being free means. Consider this example: \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \cs_new:Npn \my_cs: {} ...
10
votes
1answer
612 views

How can I define NaN in LaTeX3

LaTeX3 l3fp offers a way to check if a variable has a an infinite value. The following code defines a number and then sets its value to π/2. It then calculates tan(π/2) to get a large result. ...
10
votes
1answer
121 views

determine character code in LaTeX3 (equivalent for backtick notation)

Is there some dedicated expl3 command that is equivalent to the backtick notation of TeX in order to determine the character code?
10
votes
1answer
152 views

Processing a sequence of pairs

I want to process a list of pairs like this: {{a1,b1},{a2,b2},{a3,b3}} where the first items in each pairs are distinct. So, for each pair of those {ai,bi} I would need the following data: ...
10
votes
1answer
94 views

How to dynamically give key names with expl3?

I have a property list which associate names with values name 1 -> value 1 name 2 -> value 2 ... I want to use names from the property list to dynamically create keys. The following code ...
10
votes
1answer
62 views

Log all keys in a module

Using l3keys, is there any way to inspect the keys currently in a (sub)module? I'm looking for something like \clist_show, but for keys. \keys_show sounded promising, but requires that you already ...
9
votes
2answers
6k views

How do I get expl3 from CTAN?

My real problem is that I am trying to use a package which depends on siunitx, and it complains on compiling with the following error: (/usr/share/texmf/tex/latex/siunitx/siunitx.sty ! Package ...
9
votes
3answers
158 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 ...
9
votes
2answers
245 views

How can I define a greedy macro?

I have a feeling this is a duplicate somewhere, but how can I ensure that TeX will keep scanning until \relax or something similar? \documentclass{article} \usepackage{xparse} \pagestyle{empty} ...
9
votes
2answers
145 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 ...
9
votes
2answers
130 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
1answer
95 views

\hbox_overlap_right:n{} vs. \makebox[0pt][l]{}

I stumbled about some, to my understanding, unexpected behaviour of the expl3 command \hbox_overlap_right:n. I was expecting all examples below to produce the same result, that is, the frame box ...
9
votes
1answer
137 views

Does writing to a property list take longer than writing to a token list?

In the question Write a column selectively to the appropriate row using pgfplotstable? I offered the following: \documentclass{article} \usepackage{xparse} \usepackage{booktabs} ...
9
votes
1answer
225 views

Store results of a calculation automatically under a new macro name

As I am now accessing values from tables via a macro to make dynamic references in the text (see here) and make calculations with it, I need a way to make the resulting variables under which the ...
9
votes
1answer
64 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: ...
9
votes
1answer
395 views

Expl3 syntax highlighting for TeXworks

Does anyone have a syntax pattern for TeXworks’s syntax-patterns.txt that will correctly highlight Expl3 code? I.e., something that will recognize that the entirety of \cs_new:Npn is a command ...
8
votes
2answers
153 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
1answer
121 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 ...
8
votes
1answer
131 views

printing the value of a boolean to terminal without stopping latex

I'm trying to debug some LaTeX3 code. To do so I would like to write the value of an internally generated boolean to the terminal, but I don't want to stop the work-flow of the LaTeX run. For the ...