{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

7
votes
2answers
75 views

user-defined markup aliases with l3

I would like to write a package providing semantic markup for scholarship in the humanities (loosely following TEI-XML). In the source code, users would use macros like \term for a foreign term or ...
5
votes
1answer
29 views

Usage of \seq_map_inline:Nn and/or \tl_clear:N

I trust the code below is commented sufficiently well to obviate further explanations. The macro defined in the MWE does not produce the expected result. My reading of \seq_map_inline:Nn \params_seq ...
1
vote
1answer
31 views

How to \clist_set in \msg_new?

Is it possible to process a comma separated list within a LaTeX3 error message? For example I want to define a message for unknown values to a .choice key like in the following example. I use \test ...
2
votes
1answer
34 views

Line breaks introduced in database export as extra lines in table

I am automating the producing of tex files using an access database with many different types of fields. One, a memo field that will contain an itemized list i.e. visible tex including \begin{itemize} ...
2
votes
1answer
85 views

Combine code from two LaTeX 3 answers

I'n trying to combine the code from the answers "Sum of finite series using LaTeX 3" and "Reducing fraction using LaTeX 3" to automatically calculate a finite sum as either the numerator or ...
4
votes
1answer
28 views

l3fp keeping trailing zero in math calc

I would like to keep the trailing zeros when the data, used for internal calculations with l3fp, are printed. For example: \documentclass{article} \usepackage{siunitx} \usepackage{expl3} ...
3
votes
3answers
106 views

Expl3: Constructing command sequences from macro arguments

In my LaTeX laboratory I am doing weird experiments with expl3 (just started to use it some days ago, so regarding l3 I am complete newbie) I am trying to generate command sequence within of another ...
6
votes
1answer
72 views

Does expl3 have arrays?

There is \seq_item:Nn to get an arbitrary item from a sequence. As far as I understand, this works by iterating the sequence items, discarding until the requested item is found, which seems not very ...
7
votes
1answer
124 views

How can I iterate over a newline-delimited text file?

Would I need to use a token list? For the purpose of removing confusion, let there be two delimiters: input delimiter (what LaTeX reads as input) output delimiter (what is seen on paper) I would ...
3
votes
1answer
44 views

Undefined control sequence at definition

Why would I be getting an error that the control sequence is undefined while I'm trying to define it? ! Undefined control sequence. <argument> * \cs_set:Nn \obj_this:n ...
23
votes
5answers
1k views

Reducing fraction using LaTeX 3

Consider the following: \documentclass{article} \begin{document} \noindent Can I make \LaTeX{} reduce a fraction automatically?\\[\baselineskip] For example, I would like the fraction \[ ...
4
votes
0answers
44 views

problem with \ProcessKeysOptions / l3keys2e in texlive 2015

In my example the keys seems not to be processed ... here is file test.cls : \NeedsTeXFormat{LaTeX2e}[2001/06/01] \RequirePackage{l3keys2e} \ProvidesExplClass {test} {2013/12/23} {1.0} {Ceci est ma ...
3
votes
0answers
36 views

How can I efficiently create variants of a conditional?

Say I have the following: \prg_new_conditional:Nnn \sean_cond:n { T,F,TF } { \prg_return_false: } How can I efficiently create the following? (This list is arbitrary.) \sean_cond:nT \sean_cond:nF ...
8
votes
1answer
61 views

expl3: \keys_set_groups:nnn and unknown keys

I'm using \keys_set_groups:nnn to process only subsets of key lists. The problem is that unknown keys doesn't raise an error in this case and so typos can be overlooked easily. I can get around it ...
5
votes
1answer
35 views

Can I mark an internal function or variable as 'not documented' in l3doc?

There are several internal variables I use that I do not see a need to document in the user-interface section, but I want to explain in the implementation. I'd really like to remove the warnings ...
8
votes
1answer
69 views

LaTeX3 l3msg best practices

The LaTeX3 module l3msg provides some nice functions for messaging, errors, warnings and the like and is truly flexible. The workflow is different from what we have been using for LaTex2e packages. ...
7
votes
0answers
69 views

Table of contents with xtemplate (expl3)

Every time I typeset some book or articles, I start to renew sectioning commands (\part, \section, some \@-commands and so on), \maketitle, \tableofcontents commands by copy-pasting it to my class and ...
3
votes
2answers
77 views

Is there a 'good' way to make 'local' changes outside of a group in expl3?

I have the following function: \cs_new_protected:Nn \termmenu_prompt:NN { \__termmenu_write_out:N #1 \group_begin: \ior_get_str:NN \c_term_ior \choice \tl_gset_eq:NN #2 \choice \group_end: ...
4
votes
1answer
59 views

When is it appropriate to use scan marks?

From the documentation: Scan marks are control sequences set equal to \scan_stop:, hence will never expand in an expansion context and will be (largely) invisible if they are encountered in a ...
5
votes
1answer
68 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 ...
13
votes
2answers
188 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 ...
7
votes
1answer
79 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
67 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
34 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
59 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
59 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. ...
5
votes
2answers
63 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
92 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
64 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 ...
4
votes
2answers
65 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
61 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
75 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 ...
4
votes
0answers
73 views

Memoir: put heading in margin using Expl3 or xcoffins

In the memoir class manual, there is the following code for putting section headings in the margin: A less traditional style is to put the whole heading into the margin. I have done this here ...
10
votes
0answers
95 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
65 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
55 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
65 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
119 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
46 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
103 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
40 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
102 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
81 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
91 views

Immutable functions in latex3? [closed]

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 ...
5
votes
1answer
96 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
128 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
483 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
51 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
106 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
420 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} ...