Please do not use this tag for general LaTeX questions. {latex3} is about the new material being developed by the LaTeX3 project. This includes the expl3 programming language along with higher-level concepts such as xparse and xtemplate.

learn more… | top users | synonyms

22
votes
2answers
580 views

Sum of finite series using LaTeX 3

Is it possible to calculate the value of a finite series, say, using LaTeX 3?
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 \[ ...
3
votes
3answers
92 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 ...
4
votes
2answers
70 views

How to change a \NewDocumentCommand-based \cite command to accept biblatex-style arguments?

Over at How to quote encyclopedia articles differently from books, magazines, etc. with Biblatex?, I was greatly helped with a macro which solved the question as it was asked. I'd now like to change ...
6
votes
1answer
153 views

What is the difference between \NewDocumentCommand and \DeclareDocumentCommand?

These commands are part of the LaTeX3 Project xparsepackage. This question is to satisfy curiosity… From xparse documentation released on 25 Nov 2014: \DeclareDocumentCommand will always create ...
7
votes
1answer
121 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 ...
4
votes
0answers
114 views

“Undefined control sequence” error with fontspec

As a result of updating the l3kernel, l3packages, and l3experimental, a XeTeX document I'm working on no longer compiles. I've narrowed down the problem to fontspec failing to find a control sequence ...
1
vote
1answer
69 views

How can I apply a regex (l3regex) on items in a sequence? [LaTeX3]?

I am trying to apply a regular expression to a string item from a sequence in LaTeX3. Example Compiles with error, but only by pressing return many times. ! Missing control sequence inserted. ...
4
votes
1answer
33 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 ...
9
votes
1answer
140 views

Is there LaTeX3's analog of \providecommand?

Suppose that one has two definitions \seq_new:N \l_input_seq % declare a list (seq) variable shared by 2 macros \NewDocumentCommand. Is there a way to check if \l_input_seq is already defined? ...
40
votes
4answers
2k views

Has the time come for a LaTeX3 successor to 'listings'?

I'm currently looking for a nice and challenging open-source project to work/collaborate on after my thesis. I don't have a Comp. Sci. background, but I'd like to learn more about compiler ...
3
votes
1answer
74 views

How do I get the length of a type-set argument to a macro in latex3?

I would like to be able to decide how long a resulting character sequence is, in order to properly type set an expression. Consider an argument like \varepsilon or \mathscr{A} which both result in a ...
8
votes
1answer
68 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
1answer
220 views

What exactly is latex3/xor?

The LaTeX3 source contains a folder xor which contains, among other things, xo-grid, which is supposed to provide LaTeX3 with grid support. To quote Joseph Wright, Getting to grips with xor is one ...
39
votes
2answers
808 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?
5
votes
1answer
234 views

Parse a file with a regexp and return first match

I need to write a command that searches a file for a string that matches a certain regexp, and inserts that string. I know how to parse a string of text using a regex with \usepackage{l3regex} ...
6
votes
1answer
117 views

LaTeX3: tokens for curly braces

I use a clist of delimiters to define functions that enclose text within the said delimiters. Here is a MWE: \ExplSyntaxOn \clist_new:N \l_delim_clist \clist_put_right:Nn \l_delim_clist { {paren, ...
6
votes
1answer
202 views

\edef in LaTeX 3?

Is there a version of \DeclareDocumentCommand (in LaTeX 3) which performs like \edef? I.e. where the argument is evaluated at the time of definition as opposed to the time the macro is called? For ...
6
votes
1answer
86 views

LaTeX3: Correct way to define a macro with :o

If I want to define a macro in LaTeX3 syntax with one-level expansion of its argument (:o), I figured that it is not enough to \cs_new it that way. Instead, I have to \cs_new it as :n and then create ...
0
votes
0answers
38 views

Length of the inner-most plain-text argument (token sequence) in a nested macro expression (via expl3)

I would like to determine the length of the original token sequence passed to the inner-most macro as in \compl{\indexset{J}} where \NewDocumentCommand{\indexset}{m}{\mathsf{#1}} ...
7
votes
1answer
75 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 ...
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 ...
5
votes
2answers
565 views

latex3 complaining about Undefined control sequence. But it is defined!

I've tried pairing this down, but each time I do that I'm either correcting my mistake or something. So here's a slightly unwieldy MWE. In a nutshell, what I'm trying to do is.... I'm writing a ...
4
votes
1answer
58 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 ...
4
votes
0answers
62 views

How can I apply actions to specific items or after specific items in a sequence in LaTeX3?

Let's say I have a sequence of items. I would like to allow for the user to provide a key (here named "mainitems") that equals a number (default 1 as there is always at least 1 main item). Special ...
8
votes
4answers
280 views

LaTeX3 Create environment around token list variable

LaTeX3 has some great concepts and functions. One is the ability to replace text in a token list. This opens up possibilities to create templates in a way that html templates are used for example by ...
36
votes
4answers
1k views

Using LaTeX3’s xtemplate

Relevant are the answers to Moving to LaTeX3 for package authors and What new bits have already been implemented in Latex3? Will my current documents (with many packages) still compile with Latex3? ...
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 ...
3
votes
2answers
52 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 ...
10
votes
0answers
91 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 ...
15
votes
2answers
545 views

Learning LaTeX3

In my attempt to venture in the realm of LaTeX3 coding, I was wondering if a list of answers, in LaTeX3, can be made? That is, a list of links to answer in which users here at TeX.SX have used such ...
4
votes
1answer
58 views

How can I use the ampersand (&) as a delineator for tabs in LaTeX3 (expl3)/xparse syntax?

This idea evolved from the question: How can I get a count of the optional arguments with xparse? Problem I cannot get the ampersand to function as a delineator (for tab stops) inside the ...
6
votes
1answer
65 views

LaTeX 3 token list varables, mapping functions, differences between mapping inline and functions

I am looking for a good explanation of the differences and use cases, between the tl_map_function:nN and tl_map_inline:Nn. I provide a MWE for the inline which also appears to be the fastest. ...
5
votes
1answer
100 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 ...
12
votes
1answer
929 views

A LaTeX 3 macro to typeset chemical compounds?

Out of curiosity, I wonder how would a macro coded in expl3 that does the basics of mhchem (as in section basics in the mhchem manual) looks like? I have found examples in TeX and LuaTeX in ...
90
votes
4answers
13k views

Why is LaTeX3 taking so long to come out?

I feel as though I have been hearing about the LaTeX3 project for a very long time. Why is it taking so long for it to come into fruition? Are there major technical difficulties, or is it purely a ...
1
vote
1answer
80 views

A clean interface for hooking into sectioning commands

Is there an easy way to hook LaTeX's sectioning commands, short of the good ol' \let + \def (or, with xparse, \let + \RenewDocumentCommand{s O{} m})? I'm looking for something in the spirit of ...
3
votes
0answers
90 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 ...
11
votes
2answers
705 views

How to change operator symbols in truth table

I need to type truth tables for my computer architecture classes. Until now I was using a manually typed tabular but today I've found this answer from Scott H. which provides a command called ...
45
votes
1answer
2k views

What new bits have already been implemented in LaTeX3? Will my current documents (with many packages) still compile with LaTeX3?

I do know that LaTeX3 is a long term project, but I'm interested to find out what's new in LaTeX3 and have there already been any big advancements and backwards incompatible changes.
11
votes
1answer
476 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} ... ...
5
votes
2answers
87 views

Strange behave of index and l3regex

I am experimenting with LaTeX3 features and get a strange behaviour in a combination from index and l3regex. I try to replace all occurrences of :<space> with the exclamation mark sign, so that ...
7
votes
1answer
112 views

Does LaTeX3 have something for patching (or appending code to) commands?

Item #12 of http://tex.stackexchange.com/a/148734/18401 suggests that LaTeX3 maybe has something for patching (or appending code to) commands, à la etoolbox or xpatch. Is it the case?
2
votes
0answers
70 views

Determine whether the macro/function is in subscript, in superscript, or neither

I would like to provide different formatting for an xparse command, depending on whether the command is expanded in superscript, in subscript, or neither. That is, I would like to know inside the ...
6
votes
1answer
78 views

Define \keys_filter:nnnN without modifying core functions

I would like to define a function \keys_filter:nnnN which would do the very same thing as \keys_set_filter:nnnN but without the setting. I realized that the setting is realized by a core function ...
2
votes
1answer
80 views

Define an expandable function for comparing a token list to a string in LaTeX3

In LaTeX3, I could define a function for comparing a token list to a string \cs_generate_variant:Nn \tl_if_eq:nnTF { V } \cs_new_nopar:Npn \module_compare:n #1 { \tl_if_eq:VnTF \g_some_tl { #1 ...
10
votes
1answer
191 views

Penalty-enhanced approach to float placement in LaTeX3

This question is quite related to Penalty-enhanced approach to float placement, but here I am focusing on the situation for LaTeX3. The LaTeX2e float placement algorithm does not look backward ...
15
votes
2answers
433 views

“Hobby” library stopped working after updating to TeXLive 2014

After upgrading to TeXLive 2014 compiling my TikZ pictures prepared with the hobby library stopped working. Consider the following MWE: \documentclass{article} \usepackage{tikz} ...
3
votes
1answer
138 views

Write/Read values of the LaTeX commands (like \title, \ author etc) in file using Lua

This problem relate with other my question here . I found a solution with pdfpages package thanks to TX.SX: \documentclass[]{scrbook} \usepackage{authblk} \usepackage{pdfpages} ...