{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
1answer
2k views

Latest MiKTeX-Update broke XeLaTeX with fontspec

I updated MiKTeX a few days ago and since then I cannot compile XeLaTeX with fontspec anymore. \documentclass{article} \usepackage{fontspec} \begin{document} Hello world! \end{document} When I try ...
107
votes
5answers
9k views

LaTeX3 versus pure Lua

Reading this site for the last nearly two years I've learned a lot about LaTeX3 (which I had previously understood to be a defunct pipe dream) and LuaTeX (of which I was previously totally unaware). ...
28
votes
2answers
791 views

Moving to LaTeX3 for package authors

I would like to write a package using as much of LaTeX3 stuff as possible (in particular expl3, xparse and xtemplate). What should I read to learn these? In particular: I know that there are good ...
16
votes
2answers
766 views

Where can I find the LaTeX3 manual?

Few month ago I saw a big pdf-manual of all LaTeX3-packages and the new syntax. I think it was bigger than 300 pages. I can't find it on the web. Does anyone have a link?
35
votes
2answers
607 views

What do ExplSyntaxOn and ExplSyntaxOff do?

Related to the question What do \makeatletter and \makeatother do? for LaTeX2e, here related to LaTeX3 What do \ExplSyntaxOn and \ExplSyntaxOff do?
18
votes
4answers
537 views

How do I get a value out of a group?

I've just recovered from my first real foray into LaTeX3 programming. It was ... an experience. Not a completely unpleasant one and once I'd gotten used to the syntax then I found it a lot easier ...
9
votes
2answers
160 views

Text within ExplSyntaxOn/Off

As below, I would like to test whether a user has input some custom text, and if not, then to display default text. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N \l_empty_tl ...
6
votes
3answers
476 views

\NewDocumentCommand with constructed csname

In the spirit of my previous questions Defining \xthinspace: Thin space only if not followed by certain characters and Ellipses & Correct Space Factor, I’m trying to define a generic \xspace-like ...
15
votes
3answers
630 views

Will LaTeX3 have proper support for hooks? Does LuaTeX?

Tex has powerful support for extensions triggered by events happen in generating output, by running one of six token lists appropriately: \everycr \everydisplay \everyhbox \everymath \everypar ...
7
votes
2answers
148 views

How to document a expl3 macro using dtx

I am writing the documentation to a package implemented in expl3 using ltxdoc, and the relevant part would look like % \begin{macro}{\conteq_args_once} % Some explanation % % \begin{macrocode} ...
6
votes
1answer
203 views

luacode and ExplSyntaxOn/Off

I'm trying to build some sort of an interface to a lua matrix module. I've navigated a few issues and arrived at something that I felt like I could probably modify to work. Anticipating the need for ...
4
votes
1answer
161 views

Extra line in a tabular using expl3 syntax

I'm having trouble using (the amazing) expl3 package with a tabular environment. Specifically, I'm getting a full extra row in my tabulars when creating rows using \seq_map_inline. I can avoid this ...
0
votes
1answer
975 views

TeX Live manager 2011 database corruption?

TeX Live 2011, up to date, on Windows XP. Example: \listfiles \documentclass{article} \usepackage{fontspec} \begin{document} A \end{document} LuaTeX first error: LaTeX Warning: You have requested, ...
36
votes
2answers
593 views

How “safe” is it to use LaTeX3 (l3packages, l3kernel)?

Are l3kernel and l3packages present in most of the LaTeX distributions? Are they "stable enough"? I am asking this because I am preparing a .tex document for a client. I have found convenient to use ...
11
votes
2answers
257 views

aliasing vs variants — preferred practices?

This is somewhat related to a question I asked earlier here. I'm trying to split a token using a delimiter. However, the delimiter is stored in a token. Looking at the most recent documentation, I ...
5
votes
2answers
189 views

Splitting delimited token list argument

I wrote a little piece of code (function \getfirst:w) that splits its delimited argument at the first embedded :. The code works well if used standalone, but I am unable to place it into the .code:n ...
16
votes
4answers
695 views

Is this branching code I wrote a bit obfuscated?

I've been away for a while and I forget if this sort of question is appropriate, but here goes. Recently I wrote some code (in expl3 but I hope it's clear enough) and in hindsight I wonder on its ...
9
votes
1answer
269 views

Store results of a calculation automatically under a new macro name

As I am now accessing values from tables via a macro to make dynamic references in the text (see here) and make calculations with it, I need a way to make the resulting variables under which the ...
8
votes
2answers
167 views

Can I store sequences in sequences with expl3

The documentation for l3seq states LaTeX3 implements a “sequence” data type, which contain an ordered list of entries which may contain any balanced text . but for many programming tasks it ...
5
votes
1answer
41 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 ...
3
votes
1answer
887 views

TeX Live, Ubuntu - Update expl3 to l3kernel problem

I'm a noob with LaTeX. Trying to get my import package to work, I came across a dependency on the ExplFileVersion macro. Googling this issue, I realized I need to update my l3kernel package. The ...
19
votes
2answers
458 views

Usage of \lastbox

As part of our LaTeX3 work, we provide a consistent interface to TeX programming through the expl3 package. We've recently been discussing the TeX primitive \lastbox, which is used to inspect or ...
14
votes
1answer
978 views

How to transpose a table in expl3

I've been very impressed with xparse and expl3, and have written a wonderful document command using \ProcessList that takes a comma separated list and turns it into a (basically) 1 column table. ...
11
votes
1answer
147 views

Is it reasonable to expect an expl3-compatible release of TikZ/PGF in the future? / Workarounds for using TikZ under expl3 syntax

Keeping in mind: TikZ uses space tokens significantly, and expl3 syntax completely disregards whitespace and will only become more prevalent, is it reasonable to expect a future version of TikZ ...
10
votes
1answer
77 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: ...
9
votes
2answers
132 views

Emulating \@ifnextchar in expl3

I would like to write an expl3 version of the following. \documentclass{article} \makeatletter \def\ie{i.e\@ifnextchar.{}{.\@{} }} \makeatother \pagestyle{empty} \begin{document} \noindent \ie ...
8
votes
1answer
68 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
1answer
98 views

How do the \xx_case: functions work?

In the process of answering expl3 switch for booleans: Is there a \bool_case:Nnn?, I tried to make sense of the various \xx_case: functions Expl3 provides. Here, for example, is \tl_case:Npn: ...
8
votes
1answer
454 views

How do I use the sin function in LaTeX3

I am exploring some of the LaTeX3 routines and syntax. How do I get to use functions such as sin etc. I get an error with the sin function in the following (please uncomment sin function to view the ...
7
votes
1answer
68 views

Confusion about Data Retrieval from a LaTeX3 Stack

I'm trying to perform a very simple processing task in LaTeX3, namely, defining a series of functions named in terms of the token lists retrieved from a clist as a stack. Each function will set ...
7
votes
2answers
139 views

How to count the frequency of a token in a token list

Is it possible to count the number of a token in a token list? \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \tl_new:N \tobi_list_tl \tl_set:Nn \tobi_list_tl {foo~bar~baz} ...
7
votes
2answers
143 views

Generate l3keys meta key from subkey

I’ve created a simple package with options settable via l3keys2e. I was able to figure out how to make the syntax \usepackage[format = international]{phone} work, but I’d like to make the syntax ...
7
votes
1answer
94 views

Use expl3 variable decimal representation outside of expl3 block

Suppose, I have a floating point value inside expl3 block. Can I use it's decimal representation outside of expl3 block? This doesn't work: \documentclass{article} \usepackage{expl3} ...
7
votes
1answer
369 views

LaTeX 3 read/write to file like toc

I tried to reimplement some kind of a toc facility. I write wouts argument into a file and try to reinclude this. So the Problem is, that \ior_str_gto:NN seems to stop at linebreaks. Please consider ...
6
votes
2answers
145 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 ...
6
votes
1answer
93 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
67 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 ...
6
votes
2answers
156 views

expl3 switch for booleans: Is there a \bool_case:Nnn?

There's \int_case:Nnn, \tl_case:Nnn, \str_case:Nnn, but I can't find something like \bool_case:Nnn. I know I can write: \bool_if:NT \l__<mymodule>_<nameA>_bool { ... } \bool_if:NT ...
5
votes
1answer
82 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
1answer
68 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 ...
5
votes
1answer
236 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[ ...
5
votes
1answer
58 views

Is there any way to add a key to a sub/module in l3keys?

I need to loop through a comma-separated list, creating them all as keys for a data structure. I can't think of a way to loop through the keys inside \keys_define:nn, so the only other option I see is ...
5
votes
2answers
197 views

How can I use `catchfile` package to gobble first characters on a line

When using the fancyvrb environment Verbatim, you can gobble the first n characters of each line before printing it out. I'd like to be able to do something similar, but not via verbatim. In the ...
5
votes
2answers
127 views

Expl variable assignments not behaving as I expect

I don't get what I'm doing wrong here. Neither of the commented lines work as the uncommented version does. \begin{filecontents}{silly.tex} This is just a test. \end{filecontents} ...
5
votes
1answer
159 views

Commands from xparse inside functions created by \cs_new:Npn?

Is it okay to put commands from xparse inside functions created by \cs_new:Npn instead of \NewDocumentCommand? Would that be a confusion of programming levels? The example below works but I was ...
5
votes
1answer
453 views

7-2012 l3kernel & l3packages updates | 'broken'?

After installing recent updates to l3kernel and packages (both packaged 2012-07-19) on my MikTeX 2.9 system, several things seem to have broken: docs relying on unicode-math no longer compile ...
5
votes
2answers
129 views

Using Expl3 token-list variables where token lists are called for

The code below illustrates the trouble I’m having. It seems I cannot directly use a token-list variable where a token list is called for, but why, and how can I get the result I want? ...
4
votes
1answer
120 views

I need a fully expandable function to expand in an “f” type argument

I really hope that I'm asking the correct question. What I'm actually working on if far more convoluted than what's happening in the MWE here. I think I've narrowed down things to real problem. I ...
4
votes
2answers
84 views

Optional argument not getting set to \makebox through expl3 key assignment

The basic idea that I wanted was to create a key to pass a value that would inform \makebox how the contents of the box should be aligned. Big fail here. The intended contents of the \makebox are ...
4
votes
1answer
83 views

How to format expl3 floating point number using siunitx

Code \documentclass{article} \usepackage{expl3} \usepackage{siunitx} \setlength\parindent{0pt} \begin{document} \ExplSyntaxOn \fp_new:N \mynumber \fp_set:Nn \mynumber{5} \fp_div:Nn \mynumber{2} ...