{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

4
votes
1answer
34 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
92 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
72 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
69 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
88 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
103 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
442 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
40 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} ...
8
votes
2answers
92 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
390 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
58 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
55 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
109 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
53 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 ...
4
votes
1answer
338 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
514 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
157 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
45 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
53 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
115 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
64 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
102 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
126 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
50 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
145 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 ...
5
votes
1answer
57 views

Token replacement within a group

A comment below has clarified my problem, it has nothing to do with lua. In the code snippet below: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \cs_new_protected:Npn ...
6
votes
1answer
95 views

LaTeX3's \GetIdInfo: how is its argument automatically populated?

The l3bootstrap's documentation says \GetIdInfo extracts all information from a SVN field. But I have no idea where this field comes from. So I'd like to know how \GetIdInfo does work and if it is ...
5
votes
1answer
89 views

LaTeX3: Peek for spaces

I don't get space-observing look-aheads right. What am I doing wrong here? \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \cs_new_protected:Npn \testInNormalLaTeXSyntax #1 ...
5
votes
2answers
88 views

LaTeX3: tl_map with spaces

Is there a version of tl_map that does not ignore spaces that are part of a token list? \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \tl_new:N \l_token_tl \tl_set:Nn ...
8
votes
1answer
82 views

SplitArgument on colon doesn't work under expl3 syntax

\documentclass{article} \usepackage{xparse} \DeclareDocumentCommand\TestA{>{\SplitArgument{1}{:}}m}{% \Example #1 } \ExplSyntaxOn \DeclareDocumentCommand\TestB{>{\SplitArgument{1}{:}}m}{ ...
8
votes
2answers
171 views

Workaround how to use expl3 functionality in tikz

What I want to do I want to create a command \planfigur{<edges>}{<angles>} which draws a triangle using TikZ. \planfigur should have 2 mandatory arguments, which let me specify edges ...
2
votes
2answers
135 views

LaTeX3: If next in input stream is command X or environment X, do Y else Z

Because I write my own document class (okay, I try to ...), this question bothers me for weeks as there are many situation, in which I need something like this. Is there a way to test, if the next ...
10
votes
1answer
148 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?
3
votes
1answer
53 views

Accessing sub/keys with l3keys

I'm not sure if I'm taking it too far, but I think I've seen something like this around. This gives an error: \documentclass{scrartcl} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand \RULE {} ...
2
votes
0answers
42 views

Looking for (some) l3box equivalents of graphics' \resizebox variants

AFAIK, the box resizing functions of the l3box module are implemented using the LaTeX2e graphicspackage. However, some of the \resizebox variants don't have an expl3 counterpart. The available ones ...
1
vote
0answers
330 views

ubuntu installing l3kernel and l3packages

I apologize for this very basic question. I've downloaded the current versions of l3kernel.zip and l3packages.zip, but have no idea how to install them. As far as I can tell, there is no ...
9
votes
2answers
263 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} ...
6
votes
1answer
100 views

How can I give active characters definitions with expl3?

It's very much glossed over in texdoc interface3… \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand \Digits { m m }{ \group_begin: \char_set_catcode_active:N ; ...
2
votes
1answer
103 views

How can I avoid the need for global variables here?

Consider the following example: \documentclass{article} \usepackage{xparse} \usepackage{longtable} \usepackage{multirow} \usepackage{hyperref} \ExplSyntaxOn \int_new:N \g__ioiooiioio_args_int ...
3
votes
1answer
61 views

Expanding expl3 counter test at the right moment

I'm trying to get a counter to work, called \l__ioiooiioio_args_second_int in the example below, and I've declared to increment at each loop through \int_incr:N \l__ioiooiioio_step_int, but apparently ...
6
votes
1answer
106 views

Use choice key with choices setting booleans

When defining choice keys with l3keys2e there are two possible ways and I use the one with sub-keys in a new package. When defining watch each value should do interface3.pdf says that I can use .code ...
6
votes
1answer
349 views

Reading Arbitrary Text into a table format

Another file question from Latex; this time I'm trying to read in data from a single text file and put it directly into a table. The file reads something like: something | data | stuff | bacon ...
3
votes
1answer
55 views

Getting the current value of a global variable into a prop list

This is a more or less direct follow up to this question. The problem there was to get the current value of a global variable into a LaTeX3 prop list. The trick was to use the V variant to get the ...
3
votes
1answer
80 views

How can I have (or emulate) 'normal' behavior with \ParallelPar when working across pages (on a spread)?

The parallel package is able to set parallel columns and align them at \ParallelPar tokens: \documentclass{article} \usepackage{parallel} \usepackage{mwe} \begin{document} ...
4
votes
3answers
253 views

Problem with ExplSyntax

I'm trying to define a flexible "delimiter styling" command. I tried it in a package, and \str_case:nnF returned Undefined Control Sequence, whereas using \str_case:nnn went further and caused a ...
10
votes
1answer
90 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: ...
5
votes
1answer
76 views

How can I combine \seq_use:Nn and \seq_map_inline:Nn?

The following 'naïve' solution throws the error: ERROR: Misplaced \omit. --- TeX said --- \multispan ->\omit \@multispan l.13 } \\ --- HELP --- From the .log ...