{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

2
votes
1answer
40 views

Text formating depending on conditions

I have some conditions which are stored in boolean variables, such as \bool_new:N \l_word_numbered_bool \bool_new:N \l_word_lowercase_bool \bool_new:N \l_word_centering_bool I need to format words ...
6
votes
0answers
45 views

Should expl3 code be used in packages intended to be compatible with multiple formats?

Maybe this question is just not a good idea in general, but, I'm curious. This could make package development simpler for some in the future. (Of course, this would not be forced on any package ...
6
votes
1answer
65 views

Capitalization in headings - a LaTeX3 approach

In the early days of this site we had a question Automatically capitalize first letters of words in titles? with one solution. Since expl3 has matured well since then I have worked out a partial ...
3
votes
1answer
57 views

How do I load expl3 without LaTeX (or any other format)?

\input expl3-generic % hello, world \bye gives me \inf errors about undefined control sequences when processed with tex. When processed with initex, I'm greeted with an even more puzzling error ...
2
votes
1answer
27 views

What are the disandvantages for using a rule to define an \hspace-like command?

In the LaTeX2e source code \hspace and its star version are defined with \hskips. I have defined an alternative version using rules. I cannot see any obvious disantvantages of this approach other than ...
4
votes
1answer
55 views

LaTeX3 iteration and token list comparisons-code improvement

I am trying to make a fully expandable function that uses two arguments. The first one is the tokenlist to test against the second argument another tokenlist. The test is a character by character ...
2
votes
1answer
43 views

Extending xparse for new arguments

I was looking for a way of grabbing sub and superscripts as optional arguments to a command in xparse. That is, \foo_{a}^{b} would receive a as an optional argument and b as another optional argument. ...
1
vote
0answers
31 views

Finding current siunitx settings (or extracting expl3 keys)

The siunitx package provides a way of formatting (SI) units. It has a plethora of internal settings that the user can set with \sisetup. For example, \documentclass{article} \usepackage{siunitx} ...
3
votes
2answers
69 views

What is a function's signature? [LaTeX3]

I am trying to understand the interface3 documentation. The LaTeX Interface 3 documentation v. May 20, 2014 and March 1, 2015 refer to Defining new functions using the signature in section 3.3. I am ...
4
votes
1answer
50 views

pgfpositionnodelater with nested \tikz environments (Issue with PGF 2.1 -> 3.0 upgrade)

I'm trying to use \pgfpositionnodelater to create and measure nodes before placing them. (Their size influences where they should be placed) This works fine until I try to use \pgfpositionnode later ...
3
votes
2answers
43 views

Writing a token list conditional with expl3

This is a follow-up question to LaTeX3 conditional with grouping fails to compile. I would like to write a token list conditional with expl3 that is fully expandable in order to use it as a predicate ...
3
votes
1answer
56 views

LaTeX3 conditional with grouping fails to compile

I am trying to write a LaTeX3 conditional using \prg_new_conditional:Nnn from the expl3 package. Since the code in the conditional needs to make assignments to some variables, I would like to use ...
3
votes
1answer
56 views

Is there an easier way to 'corner-frame' a piece of text?

I've written a hodge-podge of LaTeX2e and expl3 to produce the following effect: What I have is ugly and ideologically incorrect. I'm looking for a better way to do the same thing. I think coffins ...
8
votes
0answers
70 views

How to best make the transition from LaTeX2e to expl3 syntax

I was peeking at the LaTeX3 github repository and specifically l3auxdata.dtx. There was a surprise for me, as I have been practicing and studying the expl3 syntax and modules for the last couple of ...
4
votes
1answer
60 views

Multiple uses of pgfpositionnodelater

I'm trying to generate and measure multiple nodes before placing them. Currently I'm using the following macros: % some helper / wrapper commands around \pgfplacenodelater % #1 = identifier for ...
2
votes
1answer
47 views

Getting sequences, macros, lists, and such expanded(confused)

I'm trying to do some very basic programming tasks(but as usual TeX makes this extremely time consuming and difficult (for me, of course) ;/) The problem is that I can't seem to get LaTeX to expand ...
6
votes
1answer
50 views

expl3: Expand every item once when adding to a clist

I want to add items to a clist and expand every item once. But the (to my eyes) natural \clist_set:No didn't work as expected as it expanded only the first item. \documentclass{article} ...
9
votes
2answers
110 views

What is the preferred way of expanding twice in expl3?

expl3 includes the o, f, and x argument specifiers for one-level and the two kinds of full expansion, respectively, before passing the argument to the base function. What is the preferred way of ...
4
votes
2answers
31 views

How can I set contents in a box of zero width and specified height, optionally rotating, using expl3 syntax?

Using Steven B. Segletes's answer, I can centre something horizontally, optionally rotating it, using \centering \makebox[0pt]{\rotatebox{<angle>}{<contents>}} \par However, I would ...
5
votes
1answer
97 views

Differences in LaTeX3 function generation methods

In l3basics module there are two methods provided for each command generating function. The one requires the function signature to be provided, whereas the second does not. Since the second is more ...
4
votes
1answer
35 views

\seq_put_right does not execute when placed in an enumerate's item

\documentclass[a4paper, titlepage, twocolumn]{article} \usepackage{expl3} \ExplSyntaxOn \seq_new:N \myStack \begin{document} \begin{enumerate} \item\seq_put_right:Nn \myStack {1} ...
9
votes
3answers
96 views

Peek ahead for a digit (expl3) – or any regex, for that matter

Is there an easy way to peek ahead for a digit? Something like \peek_charcode:NTF [0-9] The approach to nest 10 \peek_charcode:NTF is quite cumbersome. I want to match digits only. Digits, ...
8
votes
1answer
73 views

How can I load the table of contents into an lt3graph?

Question's in the title, really. I'd like to load the table of contents in a graph data structure. I would like to somehow keep the sections (chapters, paragraphs, etc.) ordered, but I'm not quite ...
3
votes
0answers
78 views

Immutable functions in latex3?

Imagine we have a nonempty sequence named \l_tmpa_seq. We want to assign a name \l_tmpb_seq a value which is the result of invoking a function like \int_eval:n {#1 + 1} on every member of the ...
4
votes
1answer
90 views

Calculate quartiles of data set

Comment: The following code is taken from egreg's answer here. Code: \documentclass{beamer} \usepackage{lmodern} \usepackage{booktabs} \usepackage{siunitx} \usepackage{xparse} \ExplSyntaxOn ...
3
votes
2answers
108 views

Count the number of elements of each size in a list

Comment: The following question is somewhat similar to "Position of largest element in a list" but I'm (unfortunately) not familiar what LaTeX 3 programming so I'm forced to ask. :( Code: Consider ...
11
votes
1answer
455 views

How will the LaTeX3 format look?

Can someone give me an idea (if it is at all possible) about how the document structure will be in the LaTeX3 format. Will it still start with a \documentclass and use \begin{document} ... ...
6
votes
1answer
44 views

LaTeX3, l3keys: Combining .choice and .default

With LaTeX3 and l3keys (included in expl3), is there a way to have a choice that includes a default value (or an empty choice)? \documentclass{minimal} \usepackage{expl3} \begin{document} ...
9
votes
2answers
96 views

expl3: How to remove the final comma in a clist mapping

I want to process a clist, and I can't use \clist_use:Nn as I have to some rather complicated things with the items. But how do you remove the final separator without to much fuss when using ...
12
votes
3answers
396 views

Position of largest element in a list

Consider the following: \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \ExplSyntaxOff \def\valueA{7} \def\valueB{19} \def\valueC{41} \def\valueD{31} ...
2
votes
0answers
62 views

Determine whether the macro/function is in subscript, in superscript, or neither

I would like to provide different formatting for an xparse command, depending on whether the command is expanded in superscript, in subscript, or neither. That is, I would like to know inside the ...
2
votes
1answer
59 views

Passing more arguments to mapping functions in LaTeX3

In LaTeX3, we may write these lines: \cs_new_nopar:Nn \module_main:nn #1#2 { \clist_map_function:NN \g_module_some_clist \module_mapping:n } \cs_new_nopar:Nn \module_mapping:n #1 { % ...
5
votes
2answers
114 views

How should I parse an ISO date in expl3?

Assuming date is ISO-formatted (YYYY-MM-DD), how can I parse out its individual parts into variables? \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \int_new:N \mytest_date_day_int ...
2
votes
0answers
56 views

How do I get the length of a type-set argument to a macro in latex3?

I would like to be able to decide how long a resulting character sequence is, in order to properly type set an expression. Consider an argument like \varepsilon or \mathscr{A} which both result in a ...
0
votes
0answers
33 views

Length of the inner-most plain-text argument (token sequence) in a nested macro expression (via expl3)

I would like to determine the length of the original token sequence passed to the inner-most macro as in \compl{\indexset{J}} where \NewDocumentCommand{\indexset}{m}{\mathsf{#1}} ...
6
votes
1answer
78 views

LaTeX3: Correct way to define a macro with :o

If I want to define a macro in LaTeX3 syntax with one-level expansion of its argument (:o), I figured that it is not enough to \cs_new it that way. Instead, I have to \cs_new it as :n and then create ...
4
votes
1answer
424 views

Why a `Missing = inserted for \ifnum` error for empty l3seq sequences?

I'm trying to use expl3 sequences in order to stored 0, 1 or more affiliations to 1 or more authors stored in a datatool database. The following MWE works nicely: \documentclass{article} ...
10
votes
2answers
132 views

Is \c_empty_box intended to be used instead of \mbox{}

At a first glance, I understood \c_empty_box as a replacement of \mbox{} but the following MWE (that points out a weird behavior of \c_empty_box: it is replaced by "æ") gives me serious doubts. ...
21
votes
2answers
525 views

Sum of finite series using LaTeX 3

Is it possible to calculate the value of a finite series, say, using LaTeX 3?
6
votes
2answers
159 views

Why does \msg_fatal: show a seemingly unrelated error?

\documentclass{article} \usepackage{expl3} \usepackage{everypage} \ExplSyntaxOn \AddEverypageHook { \sean_test: } \msg_new:nnnn { test } { message } { this ~ is ~ a ~ rubbish ~ message } { it's ...
4
votes
1answer
48 views

l3keys: how to store the value of a choice key more effectively?

I want to define with l3keys a choice key which also stores the value given to the key. That's easy enough: \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \tl_new:N \curmykey ...
2
votes
1answer
54 views

In expl3, how do I smuggle in a three arguments when threading sequences?

I've got some code which essentially works as in this MWE: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N \l_aellett_current_choice_tl \tl_new:N ...
7
votes
2answers
119 views

What are expl3 equivalents for various macros useful to debugging and a building private packages

When I'm writing my own private style packages, such as when developing them, I find it useful to use \typeout to help me see what I've currently created or figure out what line of code is the source ...
5
votes
2answers
70 views

LaTeX3 Expansion without \exp_after:wN

LaTeX3 reduces the need to use \expandafter/\exp_after:wN tremendously. But what is the LaTeX3 way for this problem? \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn ...
7
votes
1answer
105 views

How do I write an Expl3 equivalent?

I have a command that I can easily write using a mixture of resources from xparse, etoolbox, and pgffor. \documentclass{article} \usepackage{amsmath} \usepackage{etoolbox} \usepackage{xparse} ...
6
votes
1answer
48 views

More robust macro for ranges AND series of lines, measures, etc

Starting with @egreg's marvellous xparse answer to my question about a Macro for abbreviated ranges (pages, music measures), how to define a similar command that can also handle non-contiguous ...
5
votes
2answers
130 views

Difference between tokenlist and raw text in expl3

How to split token list by any char, like a raw document text? For example, i have a code to bold first word in macro argument. Macro is correctly works for direct using from code, like \bfirst{word ...
3
votes
1answer
53 views

Displaying verbatim content with \tl_to_str:*

\documentclass{article} \usepackage{expl3} \ExplSyntaxOn \begin{document} \tl_to_str:n { testing _ things } \par \tl_set:Nn \l_tmpa_tl { testing _ things } \tl_to_str:N \l_tmpa_tl \end{document} ...
11
votes
2answers
148 views

Reading in a conf file as a property list

I'm not worried about supporting sections, although a bounty would be given for doing so :) Here's what I have so far, but it produces strange output for #2: \begin{filecontents}{test} \Property ...
5
votes
1answer
45 views

Is it possible to tell l3docstrip to use another alias than @@?

The l3docstrip's main feature (replacing @@ by a module prefix) is very nice, except for those whose keyboards don't give a handy access to @ character (e.g. AltGr+0 on French keyboards). Is it ...