{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

6
votes
2answers
111 views

How do I get a token list with an end-of-line character in it?

The context of this question is that I have a command defined using xparse that slurps in a verbatim argument which can be long. I want to do a replacement on the resulting token list, but the token ...
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: ...
6
votes
2answers
154 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 ...
3
votes
1answer
88 views

l3doc in combination with minted

The following question is related: How to add listings environment to DTX files I want to use the document class l3doc in combination with minted. However I am not able to get a nice result. If I ...
5
votes
2answers
130 views

Can I refer to key value in general code?

Related: keyreader: How to save choice key value to a macro. I’m using l3keys2e, but I suspect this might not be the ideal way to go about what I’m trying to do. I’m building a private package ...
5
votes
1answer
87 views

Entering infinite loop when defining command with a weird argument

I thought that I was following the model offered in Splitting delimited token list argument. The only difference is that I did not see the need for using the lower case trick. \documentclass{article} ...
7
votes
2answers
139 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 ...
4
votes
2answers
83 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 ...
13
votes
1answer
133 views

How do I remove the next token from the stream in LaTeX3?

I want to remove a token from the stream from within a command (ignoring spaces). The next token will be a { (actually, I've just thought that it might not be ... but I'll continue as if it were). ...
4
votes
1answer
128 views

How to output sequence elements and total in expl3

Suppose, I have a sequence of numbers: {1,2,3}. I want to output it like this: 1 + 2 + 3 = 6 I created this code: \documentclass{article} \usepackage{xparse} \usepackage{expl3} ...
3
votes
2answers
124 views

How to use a local variable inside a macro in expl3

I extended egregs answer by defining a macro, that creates and initializes an fp value in 1 line. Then put the variables into a sequence and printed the sequence: \documentclass{article} ...
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} ...
4
votes
1answer
81 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} ...
6
votes
2answers
69 views

Inline Mapping Bug?

The enclosed document creates a sequence variable and then uses inline mapping to attach a sequence number to each item. The inline map then outputs the result and places it into a token list variable ...
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 ...
9
votes
3answers
164 views

Test whether last letter of a string is upper case or not

I would like to define a command that will behave according to the nature of the last character fed it. But I'm having difficulty just getting the components of my command to work. I thought I could ...
13
votes
1answer
133 views

How do I register the prefix of my expl3 package?

This question needs an easy to find answer here, so: I was told that I can and should register prefixes of my macro names in my expl3 using packages. How do I do that?
7
votes
2answers
145 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} ...
8
votes
2answers
164 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 ...
8
votes
2answers
333 views

PDF keywords from Expl3 clist

I’m trying to add PDF keywords to my résumé. In the custom class file, I have these lines: \clist_new:N \jcsres_keywords_clist \NewDocumentCommand \keywords {m} { \clist_gset:Nn ...
3
votes
1answer
83 views

Expl V-type argument no fully expanding as I expected

This is related to an earlier question of mine. I'm posting my own interpretation of what's happening hoping that if I'm wrong, someone will chime in an explain why. The issue with xparse's ...
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} ...
4
votes
2answers
82 views

“hiding” \par from a tabular

I want to use a macro to write a line of a tabular. As part of this macro, there is an argument that isn't set in the tabular, but is saved for later use. This unused argument should be allowed to ...
8
votes
1answer
129 views

Sorting a clist in LaTeX3

I have a clist that I'd like to bubble sort. I'm sure this is a simple matter of something like \clist_bubblesort:N or something, but I don't know what the appropriate incantation is. A quick google ...
6
votes
2answers
79 views

l3prop - getting an entry inside a macro fails

I the following example I defined two new macros \UseLength and \xUseLength. Both macros shall put back the stored value of the key in the input stream. The macro \UseLength works as expected. The ...
5
votes
1answer
65 views

How to redefine \str_if_eq:xxTF for backward compatibility

I just updated all the packages for TeXLive 2012 today and it appears that \str_if_eq:xxTF has been deprecated. How do I define a macro so that I can use the latest TeX Live but still be able to run ...
4
votes
2answers
131 views

Can't generate a tikz matrix, using expl3

Suppose, I want to generate a matrix of nodes: \documentclass{article} \usepackage{expl3} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \matrix [ row ...
3
votes
1answer
111 views

How to use a macro inside \tl_set:Nx

This code works: \documentclass{article} \usepackage{expl3} \usepackage{color} \setlength\parindent{0pt} \begin{document} \ExplSyntaxOn \tl_new:N \_text \tl_set:Nn \text {1} \tl_set:Nx \text ...
3
votes
1answer
82 views

expl3 outputting sequence of plists

Suppose, I have a sequence of 2 plists: ( { 1 => 2, 3 => 4 }, { 5 => 6, hello => 8 } ) I am traversing through the sequence and want to output only plists, ...
35
votes
2answers
596 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?
6
votes
3answers
375 views

How to use data structures in TikZ?

I created a foreach statement, using expl3 and TikZ/pgf: \documentclass{article} \usepackage{tikz} \setlength{\parindent}{0cm} \usepackage{expl3} \ExplSyntaxOn \cs_new:Npn \Counter #1 \Stopper { ...
9
votes
2answers
156 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 ...
7
votes
1answer
363 views

Wrapper for siunitx' \SI macro to automatically split number and unit

Problem I use the siunitx-package to typeset numbers and units with correct spacing etc. There is a command \SI{<number>}{<unit>} for that. However, it would be much easier to write ...
4
votes
1answer
144 views

Search specific entries in database

I have written a command, which takes five arguments to interpolate between two points. Now I tried to get the two points from an csv file. \documentclass{article} \usepackage{expl3} ...
8
votes
1answer
168 views

Working with clist indices in LaTeX3

Friends, I'm trying to port an old code of mine to a LaTeX3 implementation. Thanks to egreg, Joseph and David, I made a good progress! But then, I got stuck. From the link above, I'm porting my ...
3
votes
1answer
64 views

How do I create an expandable conditional with a loop inside?

I need to create an expandable conditional that uses a loop (that is, a ..._map_function:). It should either return true from inside the loop, or return false otherwise. In a 'normal' programming ...
4
votes
1answer
116 views

Writing macros on file defined at compilation time

This is a follow-up to this question. I have a LaTeX3 code that reads a file formatted as follows: <numberA> "<nameA>" <numberB> "<nameB>" <numberC> "<nameC>" ...
1
vote
0answers
74 views

Conflict between expl3.sty and breqn [duplicate]

I've encountered some problems using the breqn-package. I've allready read most of the topics on this forum about breqn but didn't find a solution. When I use the breqn-package, the log-file produces ...
3
votes
0answers
870 views

miktex 2.9, l3kernel installation fails [closed]

I freshly installed 2.9 I tried to compile a XeLatex document, which works fine on my work computer. I got the following error: expl3.sty missing. It tries to install l3kernel starting package ...
14
votes
2answers
342 views

LaTeX3: How to get reliable control over the level of expansion?

Say you want to write LaTeX3 code that manages user data. Sometimes you want to process that data, but other times you just want to store it, move it around and return it unchanged (when developing a ...
3
votes
1answer
72 views

List Version of \str_if_eq

I am using \str_if_eq:xxTF{\A}{\Target}{<true>}{<false} to execute the <true> or <false> code if \A=\Target. What is the list version equivalent of this? So I am looking for ...
14
votes
1answer
366 views

Is there a LaTeX3 approach to \ignorespaces?

The following code works as I would like it to: Given the state of the boolean, certain content is to be printed or not. If it's not printed, then I run the risk of creating extraneous whitespace. ...
6
votes
2answers
156 views

How do you signal an error from within an expandable function?

I would like to do some error checking from within an expandable function. But my attempts at signalling an error are not processed correctly, but rather returned to the input stream---contrary to my ...
2
votes
1answer
95 views

Unexpected hung latex compilation with property list retrieval

This is very closely related to a previous question of mine. From the comments to this previous question, I understand that my approach here is completely wrong headed. So why bother post a ...
4
votes
1answer
112 views

key values getting improperly passed through a property list getter function

I'm creating rather complicated diagram and would like to put all the controls all in one easy to find location and not scattered throughout the document. To do this, I've created setter and getter ...
15
votes
1answer
426 views

Guidelines: when is LaTeX3 too much LaTeX3?

This morning I found myself writing a document where essentially the same text is repeated several times. Because I've been mucking around a lot recently learning LaTeX3, it took absolutely no ...
2
votes
1answer
238 views

LaTeX complaining about illegal parameter number

Inspired by a question yesterday, I thought I'd try my hand at a LaTeX3 solution which would show how to convert base 10 numbers into any other base of the user's choice. Yesterday I wrote a nice ...
8
votes
1answer
145 views

printing the value of a boolean to terminal without stopping latex

I'm trying to debug some LaTeX3 code. To do so I would like to write the value of an internally generated boolean to the terminal, but I don't want to stop the work-flow of the LaTeX run. For the ...
11
votes
2answers
256 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
188 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 ...