{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
0answers
71 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
71 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
134 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 ...
3
votes
1answer
75 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
38 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
87 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
714 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
134 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. ...
6
votes
2answers
161 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
52 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
55 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
122 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
74 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
106 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
52 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
138 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
58 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
161 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
47 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
63 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
108 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
92 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
93 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 ...
9
votes
1answer
103 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}{ ...
9
votes
2answers
190 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 ...
3
votes
2answers
151 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
157 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
70 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 {} ...
6
votes
1answer
204 views

\edef in LaTeX 3?

Is there a version of \DeclareDocumentCommand (in LaTeX 3) which performs like \edef? I.e. where the argument is evaluated at the time of definition as opposed to the time the macro is called? For ...
2
votes
0answers
48 views

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

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
446 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
269 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
106 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
66 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
128 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
438 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
57 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
88 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
389 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
101 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
83 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 ...
7
votes
1answer
43 views

Built arguments not getting properly passed

I've got some rather complicated arguments that I must build gradually and then pass to another macro. The MWE is greatly simplified. Here's my attempt using expl3. The problem is that no matter ...
8
votes
1answer
90 views

Why is \str_if_eq_p:nn not evaluating to true?

In the following MWE, \str_if_eq_p:nn is not evaluating to true when \l_aepoly_presentation_style_tl is set to ABC. Why? \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N ...
4
votes
2answers
164 views

Manipulate a LaTeX2e counter with LaTeX3

I have some expl3 code where I want to manipulate a counter which is defined by a package using LaTeX2e code. If I want to manipulate the counter foo, I could either mixing up LaTeX2e code with ...
6
votes
1answer
81 views

Is there a way to pad zeros to the end of a rounded number with Expl3?

I've been able to put a table of trig values together using expl3. However, I would like to pad zeros to the end so that all values have four decimal places. Is there a straight-forward way to do ...
9
votes
1answer
147 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 ...
7
votes
3answers
547 views

Command that changes its definition the nth time it's used

I need a command to behave differently the first time than the next times it's called. Right now I use \newcommand\foo{First\gdef\foo{Next}}, that is, it redefines itself the first time. Moreover, I ...
5
votes
1answer
316 views

Scientific Notation Only For Large Numbers — with uncertainty

I've been using Betohaku and Bruno Le Floch's answer to Scientific Notation Only For Large Numbers to turn scientific notation of as follows: \documentclass{standalone} \RequirePackage[ ...
6
votes
1answer
118 views

LaTeX3: tokens for curly braces

I use a clist of delimiters to define functions that enclose text within the said delimiters. Here is a MWE: \ExplSyntaxOn \clist_new:N \l_delim_clist \clist_put_right:Nn \l_delim_clist { {paren, ...