{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

29
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{...
0
votes
1answer
43 views

expl3 2016 .dtx files to .sty

I have a very similar problem to this old one, closed for being too specific: File expl3.sty not found when trying to compile a *.tex file with XeLaTeX But I have read a few people having it with no ...
0
votes
0answers
23 views

How to write some data to an auxiliary (.aux?) file of a .tex file and read this data from another .tex file?

I'd like to write some data, say: \newcommand\somedata{foo} or, in a LaTeX3 way: \ExplSyntaxOn \tl_const:Nn \c__some_data_tl {foo} \ExplSyntaxOff to an auxiliary file of a test1.tex file and be ...
6
votes
1answer
98 views

Sorted and compressed output from a clist

I have a clist with the content, {9.8,5.1,10.1b,1.3,1.4,5,5.1.1,8a,9.7,9.9,10.1a,10.1c,1.2,8b,8c}. How can I generate sorted and compressed output from this using expl3 which might look like: 1.2--...
1
vote
1answer
24 views

xparse error: “kernel/missing-colon” when defining a new command using cs_new:Nn

I'll simply show what happens: The documentclass definition is elsewhere on the file. I'm using TeXnicCenter, so interactive mode is not an option.
3
votes
1answer
28 views

How to use pageref with expl3?

I think there is something I have not understood about global variables. The following MWE does not work to display the total page number in the footer : \documentclass{article} \usepackage{expl3} \...
2
votes
1answer
33 views

In expl3, how to use normal spaces instead of ~ in a portion of text?

In a previous question, I learned that \ExplSyntaxOn and \ExplSyntaxOff should be put around a command because of the order in which expansion works in TeX. Suppose now that I want to put things at ...
4
votes
1answer
32 views

Use expl3 inside a LaTeX2e macro

I would like to redefine the \section macro in my document and I found that LaTeX3e was one of the easiest way to make integer operations inside it. But I get a "Missing $ inserted" error when I ...
3
votes
1answer
42 views

Counting the number of strings stored in array

I stored a list of strings (command strings) in an array following the answer here: http://tex.stackexchange.com/a/215571/61517 . Now I wanted to access them randomly, and therefore I added a random ...
2
votes
1answer
44 views

Can I temporarily clear the file search path in LaTeX3?

I'm using the following code to search for a file using LaTeX3: % List of known image extensions: \clist_new:N \l__htmv_grext_clist \clist_set:Nn \l__htmv_grext_clist {png,PNG,jpg,JPG,jpeg,JPEG,gif,...
16
votes
1answer
112 views

Is there a correct way to prevent a galley cutout from repeating later without modifying the body of the document?

Consider the following FMWE (Fairly Minimal Working Example): \documentclass[a4paper]{article} \usepackage{kantlipsum,xgalley} \usepackage[scale=.8]{geometry} \pagestyle{empty} \ExplSyntaxOn \...
4
votes
1answer
131 views

Good examples of \tl_case:Nn(TF) and \str_case:nn(TF)

While learning expl3, I'm having a hard time in using \str_case:nn(TF) and \tl_case:Nn(TF). I failed to find good examples online. (E.g., the ones in unravel are too complicated for me.) Could you ...
16
votes
4answers
222 views

\tl_replace_all:Nnn recurse subgroups

Suppose I had a token list variable containing abc{ab{abc}c}. I want to replace every occurrence of b with d. As you can see there are subgroups containing b which I also want to have replaced, so ...
6
votes
2answers
69 views

Latex3 equivalent csname endcsname

I would like to know how to create dynamic named macros (in a loop) in Latex3. Everythings ok in LaTeX2e. I look to something equivalent to that code with expl3 \stepcounter{N} \expandafter\def\...
12
votes
2answers
214 views

Best way to wrap text around figures in expl3

As remarked in another question from today, I am trying to find a more flexible way to get text wrapped around figures than standard solutions like wrapfig or manual use of \parshape, and my eyes are ...
6
votes
1answer
76 views

Save an active colon from within expl3

Is there a preferred way to realize the following without having to leave expl3 syntax? \documentclass{article} \usepackage{expl3} \usepackage[french]{babel} \begin{document} \ExplSyntaxOn % suppose ...
3
votes
1answer
45 views

How to make \tl_upper_case:n in section's argument bookmark compliant?

Thanks to recent revision of the coverage of UTF-8 input for pdfTeX and accents with the expl3 (see updated answer of http://tex.stackexchange.com/a/286703/18401), the following code works nicely: \...
4
votes
2answers
78 views

What is the correct way to stack two coffins so that the vertical spacing between their contents is as it would be if they were set in one coffin?

Consider the following Minimal Working Example (MWE): \documentclass{article} \usepackage{xcoffins,kantlipsum} \begin{document} \NewCoffin \MyCoffin \NewCoffin \YourCoffin \SetVerticalCoffin \...
9
votes
2answers
85 views

\ref with macro as parameter

I would like to write a macro (using Latex3/expl3) that can automatically refer to say plot using several key-value parameters. Here is what I currently have: \keys_define:nn{label}{ Re .tl_set:N ...
5
votes
2answers
182 views

Create a sequence using space as delimiter

expl3 swallow spaces but I wonder to build a sequence using space as a delimiter. So if I want to print '!' after each item the output should be 'A!simple!sentence!has!only!one!clause!'. The current ...
23
votes
1answer
1k views

How can I clean my coffin?

Seriously, the name is a goldmine. I have a coffin that I'd like to 'clean up' and keep only the default poles. For example, here's a coffin I built using an auxiliary coffin: Size of coffin \...
7
votes
1answer
51 views

How can I generate precisely one warning within a tabularx environment?

I realise this is an unholy mix of expl3 and LaTeX-2e, but most of my code is like this at the moment, unfortunately. I want to be warned when I fail to set a particular variable. More specifically, ...
4
votes
1answer
43 views

tcolorbox as a style

I’m using a tcolorbox to mark some keywords. I want to control when these keywords have to be marked. So I created a Boolean variable \l_style_bool. The instruction \bool_set_true:N \l_style_bool ...
6
votes
1answer
78 views

xgalley breaks memoir and ntheorem

Another question from me about the experimental expl3 package xgalley: This time, simply loading the package causes problems with memoir and ntheorem. Consider the below MWE. When I load xgalley, the ...
1
vote
1answer
52 views

Vertical break of a tcolorbox

I’m using an example from the tcolorbox manual (v 3.91) to highlight some text. The problem is that line breaking is not allowed. So I tried to use a tcolorbox for each word of the highlighted text. ...
12
votes
1answer
79 views

Why does an empty \textwidth coffin lose width when joined with another?

I'm trying to understand coffins. Well, actually, I'm trying to use them. Trying to understand them is a purely instrumental goal. I wanted to create one coffin of width \textwidth and one of a bit ...
4
votes
2answers
99 views

Labelling confusion in expl3: (public, private) Vs (global, local)

The expl3 manual shows that LaTeX3 is based on conventions. Among them conventions to correctly label variables and functions. They could be public/private or global/local. If there is someone who ...
5
votes
2answers
40 views

\clist and hyperref

using package xparse I stored the author of a certain paper in a \clist in the following way \NewDocumentCommand\addauthor{m}{% \clist_put_right:Nn\l_allauthors{#1}% ...
4
votes
1answer
44 views

Modify contents of environment using l3regex and then write to file

I want to define an environment (in a class file, as it happens) the contents of which are both displayed on-screen as they are written, but they are also modified (e.g. using the l3regex package) and ...
4
votes
2answers
116 views

Spurious `.pdf' added to the first argument of \href if inside \ExplSyntaxOn/Off

The following MWE shows that a spurious ".pdf" is added to the URL given in the first argument of \href if (and only if, AFAICS) the latter is used inside \ExplSyntaxOn/\ExplSyntaxOff (it also shows ...
14
votes
3answers
12k views

How do I get expl3 from CTAN?

My real problem is that I am trying to use a package which depends on siunitx, and it complains on compiling with the following error: (/usr/share/texmf/tex/latex/siunitx/siunitx.sty ! Package ...
16
votes
0answers
130 views

Globally assigning a coffin

There is no macro \vcoffin_gset:Nnw. How can I achieve that result? MWE \documentclass{article} \usepackage{expl3}\ExplSyntaxOn \usepackage{mwe} \newcommand\typesetit {\coffin_typeset:Nnnnn\...
8
votes
2answers
117 views

Write LaTeX3 variable to aux file and recover it

I was wondering how to write a LaTeX3 variable to an aux file and read it in at the very beginning of a document. The motivation of this problem is that I would like to get rid of my LaTeX2 counters ...
50
votes
3answers
1k views

LaTeX3-sensitive editors

I'm starting to embed LaTeX3 code in my custom classes and packages -- and enjoying it more the further I learn about it --, but at least to me it would make for an even better experience if, as it is ...
0
votes
0answers
29 views

TeX Live: xsparse and l3kernel. [duplicate]

My Tex Live installation is up-to-date. I ran tlmgr update --all today (2016-03-31). However, I get many errors on documents that used to compile just fine. It seems to boils down to xsparse.sty ...
9
votes
1answer
94 views

real colons in a expl3 context

I'm fighting to find a good way to use colons in an expl3 context. The example uses tcolorbox for a demonstration but I ran into the problem also in other places where a colon was used to delimit an ...
1
vote
0answers
47 views

siunitx: Problems with xparse after update on 2016-03-31 [duplicate]

Dear community members, after today's (2016-03-31) update of packages via TexLive Utility severe problems with siunitx showed up on Mac OS 10.10.5 + TexShop. siunitx calls xparse, which then outputs ...
4
votes
1answer
455 views

xeCJK l3-too-old

I started using XeTeX and whenever I use the xeCJK package I get the following error: ! Critical xeCJK error: "l3-too-old" ! ! ! Support package 'expl3' too old. ! ! Please update an up to date ...
5
votes
3answers
137 views

Create tabular depending on counter

I want to create a tabular with i+2 many columns where i is a counter. The tabular should have the following layout: ------------------------------- | 1 | 2 | ... | i | foo | bar | -------------------...
5
votes
1answer
94 views

LaTeX3 string with umlaute

I was wondering how to properly use LaTeX3 strings. Consider the following code: \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \tl_new:N \l_foo \tl_set:Nn \l_foo {\"a} \...
3
votes
1answer
58 views

How can I set the PDF TrimBox dynamically (with a macro) and compiler independent?

Introduction At the moment I’m preparing a custom class which is likely to be compiled with XeTeX or LuaTeX. It is for a book layout that should be professionally printed and therefor I want to set ...
8
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 ...
2
votes
1answer
43 views

expl3 property lists and expansion

Trying to keep this simple. Given that the following, what is wrong with the commented out code (neither one works unfortunately), and what is an alternative way to do that? "That" being access a ...
6
votes
1answer
51 views

l3doc adds unwanted backslash in margin box of {function}

I'm using l3doc for documenting some packages (I know it is not officially stable, but I like it …). I came to the problem that {function}{<list>} adds a backslash for every item in <list> ...
5
votes
1answer
68 views

expl3 par and sequences

Having been exploring expl3 I have been updating some of my code to it, and I ran into a interesting issue that I was not predicting. I get a strange error that I think is from trying to store ...
5
votes
1answer
85 views

How can I use a tl variable in TikZ options

Im setting up a command with some options via l3keys. One of the options is tikz-options and it should take a list of TikZ options and pass them to a {tikzpicture}. \documentclass{article} \...
4
votes
1answer
53 views

XParse: Command, which creates a command

SE, lately I'm playing around with expl3 and xparse a little and I encountered following problem: I want to create a command which creates a new command -- similar to this post. This is not as hard, ...
7
votes
1answer
67 views

How can update this code for print number with different colors?

I have this code for highlight the diagonal, the first row and the first column with different colours! (This code has been build from egreg on this community :-D in a past question) \documentclass{...
3
votes
1answer
39 views

Why do I need \fp_to_dim:n in my dimension expression?

I’m trying to use an expel floating point variable (\l_@@_last_machine_row_x_fp) inside a calculation of a dimension (\l_@@_bar_width_dim). In the following code \BarA works (with a solution from this ...
4
votes
1answer
43 views

expl3 empty token list

Im sure this must be something very simple but it is eluding me. The following code outputs F. Shouldn't it output T? \documentclass{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \...