{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

1
vote
1answer
339 views

ERROR: You can't use a prefix with `\begingroup'

Here is a minimal example of a document which does not compile. \documentclass{report} \usepackage[francais]{babel} \usepackage{expl3} \usepackage{appendix} \usepackage{multicol} \usepackage{...
3
votes
1answer
68 views

Producing expandable environments with only optional arguments with LaTeX3 syntax

I am trying to create a new document environment to complete the assembly of a table (simplified for MWE) but I am having a problem combining an expandable environment with an optional only argument. ...
0
votes
0answers
21 views

MiKTeX - broken package combination fontspec / expl3 [duplicate]

I have some problems after installing the latest 64bit-MiKTeX as well as the latest packages through the package manager. It seems that there is a problem with the combination of fontspec and expl3 ...
10
votes
2answers
166 views

Misunderstanding from l3keys documentation

Based on the interface3 documentation and a nice article in TUGboat, Volume 31 (2010), No. 1 called Programming key–value in expl3 by Joseph Wright, I have been trying to put together a MWE that will ...
3
votes
1answer
52 views

In expl3, how to reset a seq variable when content is placed in footer or float?

This answer explains how to use expl3 to store a seq variable to place content later in a document. I'd like to write a command that: Writes the first argument to the main flow of the page. Writes ...
5
votes
1answer
86 views

Is \int_step_inline:nnnn inserting something after it finished?

The following snippet \RequirePackage{xparse} \documentclass{article} \usepackage{tabu} \ExplSyntaxOn \NewDocumentCommand\trop{}{ \int_step_inline:nnnn{0}{1}{3}{ a & b & c & ...
6
votes
1answer
58 views

How can I transform a sequences by mapping?

In Lisps, I can usually say (map some-function [some list here]) and this will be the same as [(some-function some) (some-function list) (some-function here)] Note that I'm giving map a sequence ...
0
votes
0answers
96 views

media9 consistently gives an error when trying to include an mp4 file

I'm trying to insert an mp4 video into a presentation I'm making in Beamer. However, I'm having some difficulty; it keeps giving me an error when trying to compile the document. The error I'm getting ...
4
votes
1answer
68 views

Why is it impossible to format items of a LaTeX3 comma list?

Trying to adapt the 1st code of this answer in order to format (say in bold) items of a LaTeX3 comma list, I stumbled upon an unexpected error: the following MWE works like a charm: \documentclass{...
7
votes
1answer
115 views

Has LaTeX3 syntax possibly changed since this question was last answered

I am adapting the LaTeX3 answer in this question: http://tex.stackexchange.com/a/61603 But I can't get the original MWE answer to compile using xelatex. I have renamed the variables, but the error ...
2
votes
0answers
55 views

Access xparse's \BooleanTrue via latex3 expl3

I'm implementing a command with xparse's boolean token processing \NewDocumentCommand{\op}{s o t' t. t^ g}{ % Here I need to check for % (#3 || #4 || #5) && !(#3 && #4 &...
4
votes
1answer
48 views

creating an alias for existing key

In there an easy way to define an alias for an existing key which does exactly the same, but without the need to duplicate the code of the existing key? That is, something like: \keys_define:nn { ...
1
vote
0answers
36 views

Error interception

The code in the MWE allows \myMacro to process either a tokenlist, integer, or floating point item by setting the appropriate optional #2 parameter. My question at the outset was going to be: (1) ...
7
votes
2answers
106 views

how to space after LaTeX3 commands

I am trying to define a message that includes a computed number. \RequirePackage{expl3} \ExplSyntaxOn \int_set:Nn \l_tmpa_int { 42 } \msg_new:nnn { package } { message } { The~number~ \int_use:N \...
1
vote
0answers
20 views

Looping through elements in a sequence [duplicate]

In a follow up of Highlighting words only the first time they appear it was suggested to use \seq_use:Nn to display the content of a sequence. It works really nice but it concatenates the items with a ...
10
votes
1answer
147 views

Translate \typeout to LaTeX3

The command \typeout{argument} expands its argument and writes the result to the log and the terminal. Writing l3build tests, I sought for an equivalent command in LaTeX3, but only found \iow_log:x ...
2
votes
2answers
65 views

Strange behaviour of \tl_if_eq:NNTF

In the MWE below NewDocumentCommands \myComparison and \myNewComparison both use a control sequence \cookbook_Compare:nn which is fed two tokenlist parameters to be compared. These parameters are ...
2
votes
1answer
44 views

How to use \makebox in \tl_map_function?

While trying to answer LaTeX for music I came to the problem that I can’t use a \makebox inside the function for a \tl_map_function:NN call. The problematic line is commented out in the following code....
3
votes
1answer
98 views

Saving a value between successive macro calls

I want to save a variable value between calls of a macro, the intention being not to have to repeat a whole lot of parameters in successive calls. It all works as intended if in textmode. If I invoke ...
5
votes
1answer
99 views

How can the knots TikZ library be used with current l3 (e.g. TeX Live 2015)?

The knots library for TikZ seems to be incompatible with the current l3 packages as provided, for example, by TeX Live 2015. The following example, taken from the library's documentation compiles ...
17
votes
1answer
261 views

Patching commands in LaTeX3

Is there some facility in the LaTeX3 kernel to modify existing commands like etoolbox's \preto \appto and \patchcmd do?
8
votes
2answers
170 views

'Missing \begin{document}' when using the \lowercase trick

Mostly for fun, I'm trying to make % comments manipulatable using the \lowercase trick. For some reason, I'm getting a strange (to me) error: ERROR: LaTeX Error: Missing \begin{document}. --- TeX ...
1
vote
0answers
49 views

LaTeX3 \clist_sort:Nn — How has this function been implemented? [closed]

I have recently read in the documentation of package l3sort about the usage of \clist_sort:Nn to sort lists. I would like to know how and where \clist_sort:Nn has been implemented. In l3sort.dtx I ...
3
votes
1answer
62 views

\seq_push and \seq_pop functions behaving badly, undoubtedly due to misuse

For my own good reasons I am loading \param_seq with an array of parameters, then want to transfer the content of \param_seq to \aux_seq by popping \param_seq, storing the popped item temporarily in \...
7
votes
2answers
106 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
43 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
38 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
85 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
113 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
59 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} \pagestyle{...
5
votes
3answers
142 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
88 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
139 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
59 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 ...
28
votes
5answers
1k views

Reducing fractions automatically using LaTeX 3

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

problem with \ProcessKeysOptions / l3keys2e in texlive 2015 [closed]

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
41 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
70 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
39 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
89 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. ...
8
votes
0answers
93 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
86 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
61 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
85 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
239 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
123 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
75 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
36 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
68 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 ...
3
votes
1answer
80 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. ...