Skip to main content

Questions tagged [expl3]

{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.

Filter by
Sorted by
Tagged with
3 votes
0 answers
23 views

Small bugs with a lightweight xcoffins-based mdframed alternative

I've recently tried to add page-break support to a lightweight xcoffins-based mdframes alternative I've made that started off with Put an xcoffin around an environment's content It essentially ...
tecosaur's user avatar
  • 1,083
1 vote
2 answers
69 views

How to create a command to plot a series of square lattices on a given line?

As the figure below, for a fixed line on a square-lattice layer with the scale of 30*30, it y-coordinate is 12, then I'd like to plot squares on the x-coordinates of 1,6-13,21,28-30, 13 square dots in ...
Meiu's user avatar
  • 558
2 votes
1 answer
108 views

Why would anyone use `\obeyedline`, what meaning should it have in the latest textlive distirbution?

Can anyone check with a grep (sorry I am on windows) what packages use obeyedline? I picked up a strange bug with l3doc and some code of mine which I cannot provide a minimal, as the code is really ...
yannisl's user avatar
  • 118k
1 vote
2 answers
124 views

Uppercase & abbreviation dot in a field - string manipulation

I use a custom driver that contains the nameaddon field. Below a wme: \begin{filecontents}[overwrite]{\jobname.bib} @customa{test, author = {Author}, nameaddon = {nameaddon}, title = {Title}, } \...
matteofg's user avatar
  • 175
2 votes
2 answers
62 views

Supplying data to hyperref's pdfauthor: different command types give different results

The hyperref package allows a list of authors to be assigned to the pdfauthor option. For example, this works for me \hypersetup{ pdfauthor={Me, Bobby McGee} } The two authors are recognised in the ...
Blair's user avatar
  • 407
1 vote
0 answers
22 views

Rounding dimensions to specific decimal places [duplicate]

In How to typeout dimensions in mm?, a custom command is suggested to typeset dimensions in a given unit. Sometimes, it is desirable to typeset the length to one or two decimal places I want an output ...
Al-Motasem Aldaoudeyeh's user avatar
1 vote
0 answers
52 views

Recreate the functions environment from the l3doc class file

I am reviewing the l3doc.cls class file and I was very interested in recreating the functions margin environment as shown in the diagram below: Note that I am only interested in the section that says ...
azetina's user avatar
  • 29.1k
1 vote
2 answers
67 views

Count sections inside collected environment

Here's what I'm trying to do: I am trying to write an environment to conditionally hide its contents if a global bool is set. Sections inside the environment should still increase the section counter, ...
d8xa's user avatar
  • 110
1 vote
1 answer
100 views

LaTeX3: detecting default command inputs once stored in sequences

I don't understand how to identify elements in a sequence that have a default value assigned by a document command. For example, \documentclass{article} \ExplSyntaxOn \seq_new:N \l_blair_person_seq \...
Blair's user avatar
  • 407
5 votes
2 answers
259 views

Expand a `.cs` defined by key inside the function

I have a prop list in which I save items using the \addtoprop command and then loop through the prop list and print it with the \foreachinprop command. The \foreachinprop command has several keys, but ...
Pablo González L's user avatar
1 vote
2 answers
68 views

Function to output array in itemize

I tried to create a single function that would output inline and function return arrays represented as clists in itemize. I didn't succeed to create such function, only separate ones. This function ...
Intolighter's user avatar
2 votes
1 answer
111 views

Add `.meta` key to existing keys (l3keys)

I have two list environments called myenv and myenv* where only the first one has four levels, the keys for the first one are stored in { mymodule / level-1 }, ...,{ mymodule /level-4 } and for the ...
Pablo González L's user avatar
3 votes
2 answers
196 views

Creating a property list. I'm new to expl3

I try to learn expl3. I try to create a property list. The values should be numbered sequentially, but somehow I always save only the last value. I would expect as output: Test [1][2][3][2][1] (One,1)...
Viggo's user avatar
  • 65
3 votes
1 answer
84 views

Customize minipage to support spaces below it

I'm trying to create a custom minipage environment that allows spaces above and below it. I manage to control the spaces above using the @minipage shitch, but I can't find the modification to achieve ...
Pablo González L's user avatar
2 votes
1 answer
91 views

expl3 \seq_set_split:Nnn in a \foreach loop

I'm trying to run \foreach over a nested list. For each iteration the value of the loop variable will be a list separated by semi-colons. To split the values I'm using \set_seq_list. It works when not ...
user1850133's user avatar
  • 1,028
4 votes
1 answer
172 views

Latex3: why are spaces consumed before regex matches

I am trying to extract parts of a string using regular expressions. For example, from a string input John Smith (role: proof reader) I would like to extract John Smith and proof reader. Here's my ...
Blair's user avatar
  • 407
1 vote
1 answer
79 views

How to pass a tl or seq containing & to a function?

I am using CSVsimple to make a catalogue of products, each having a variable sized table with different header. So first I scan the file for header-names, save these in variables and then later feed ...
Fibecker's user avatar
2 votes
1 answer
115 views

Is it possible to modify a \cs_new_protected:Nn function using hooks?

A user of one of my classes exceptionally wants to modify something that is hard-coded in a \cs_new_protected:Nn function. I can give her the means to redefine this function using \cs_set_protected:Nn ...
Denis Bitouzé's user avatar
0 votes
1 answer
44 views

Help with automatic text formatting in class files!

I'm relatively new to LaTeX (within a year or so). I found an attempt at a legal document file online, and have been modifying it to work as I'd like, and attempting to change the functionality around....
LaTeXLawyer's user avatar
2 votes
2 answers
110 views

hyperref warning: Token not allowed in a PDF string - macro Refactoring as a fix

I have a macro that takes a comma-separated list of lists and applies some formatting to it. The list consists of the first and last names of the document's authors. I managed to create a macro - \...
Mycroft_47's user avatar
9 votes
0 answers
115 views

lists, peek operations and microtype trouble

LaTeX's peek operations are a bit of a black box for me and I'm struggle to get microtype protrusion to behave in a custom list which has a peek operation at the beginning of it. The following silly ...
David Purton's user avatar
  • 26.4k
0 votes
1 answer
29 views

How to print comma symbol as part of clist value

This is what I tried: \clist_new:N \g_conclusions_clist \clist_set:Nn \g_conclusions_clist { Value\, value\, value!, another value! } \clist_item:Nn \g_conclusions_clist 1 I escaped commas ...
Intolighter's user avatar
2 votes
1 answer
66 views

How to properly expand expl3 Macros within tblr environment (from tabularray package)

I've been working on a macro that takes a comma-separated list of lists and converts it into a table that spans the full width of the page, with specific text formatting applied to certain columns. ...
Mycroft_47's user avatar
1 vote
0 answers
44 views

Issues with Misplaced Alignment Tab Character and Table Width in tabularray Environment [duplicate]

I've adapted the code below from this answer to switch from the tabular environment to the tblr environment from the tabularray package. While the original code works perfectly with tabular, I'm ...
Mycroft_47's user avatar
1 vote
1 answer
135 views

Creating LaTeX Macros to Generate Tables from Predefined Variables

I've been struggling for the past two days to create macros for populating a thesis title page, as I'm planning to share it as a template with my colleagues. As you all know, thesis title pages have ...
Mycroft_47's user avatar
3 votes
1 answer
74 views

Robustness of \peek_analysis_map_inline:n with changed catcode

Background Following my previous question I try to make compatible the redefinition of the circumflex ^ catcode with the active prime ' defined in vanilla LaTeX or by the package unicode-math. The ...
jlab's user avatar
  • 3,986
1 vote
1 answer
104 views

Adapt and extend a command for key-val parse (l3keys)

I have a parser for the environment keys and command of a package and it works very well. For MWE purposes I have two environments myenv and myenv*, both represent list environments, but only the ...
Pablo González L's user avatar
1 vote
1 answer
83 views

LaTeX3 programming layer documentation on website not working [closed]

The LaTeX3 programming layer documentation on website is not working. Could this be fixed ? The LaTeX3 programming layer (which is part of the LaTeX format) is documented in The L3 programming ...
Bulldrive's user avatar
  • 161
1 vote
2 answers
91 views

Macro copy, add/remove last token

Suppose I have a macro with only argument that has such a structure \def\foo#1{% {\textbf{#1}}{aaa}{bbb} } I need to create two copies: \bar that is \foo but withouot the last token: \...
antshar's user avatar
  • 4,652
7 votes
2 answers
200 views

Custom multiple \str_case:nn — expl3

I'm trying to create a custom more advanced function with a structure similar to \str_case:nn {⟨test string⟩} { {⟨string case1⟩} {⟨code case1⟩} {⟨string case2⟩} {⟨code case2⟩} ... {⟨string ...
antshar's user avatar
  • 4,652
1 vote
1 answer
70 views

Expl3 commands in \NewDocumentCommand

It has been stated that commands executed by \NewDocumentCommand are intended to use expl3 commands. For instance, using \keys_set:nn {kvi_adrs} {#2}. Then, why is it that on starred argument \...
Bulldrive's user avatar
  • 161
0 votes
1 answer
41 views

Type of output from \cs_new:Nn

I wonder what the output from this function would be. Is it a string ? \cs_new:Nn \align_adrs:n { \str_case:nnF {#1} { {l} {left} {L} {left} {r} {right}...
Bulldrive's user avatar
  • 161
0 votes
1 answer
60 views

Weird error when redefining \msg_info_text:n and using fontspec package

I am still experimenting with LaTeX3 to get a better understanding. I follow the L3 manual for this. Now to my problem: I want to redefine \msg_X_text:n like explained in 11.3. Everything works ...
Dave's user avatar
  • 327
5 votes
0 answers
74 views

Cross-reference expl3 integers with cleveref

Suppose I implement numbered document elements using expl3 integers. Suppose further that I would like to cross-reference these elements using cleveref. What is the best way to do this? I came up with ...
cfr's user avatar
  • 208k
2 votes
1 answer
51 views

How to trim spaces without expanding what is inside in expl3?

Consider the following pattern: \NewDocumentCommand{\mycommand}{m}{ \myinternalcommand:n{#1} } \cs_new:Nn \myinternalcommand:n{ \tl_if_single:nTF{#1}{TRUE}{FALSE} } and let's say that I want ...
Vincent's user avatar
  • 5,327
3 votes
4 answers
139 views

Alternating page count when attempting to ensure page numbers are a multiple of four

I would like to ensure that my page count is a multiple of four. If it isn't a multiple of four, I would like to add \newpage\begin{center}\textbf{BLANK PAGE}\end{center} until I reach the page count ...
Runxi Yu's user avatar
4 votes
5 answers
320 views

Convert control sequence with a variable number of undelimited parameters into a token list

In expl3, I can translate a token list \l_greet_tl into a control sequence \greet that takes two parameters as follows: \tl_new:N \l_greet_tl \tl_set:Nn \l_greet_tl { Hello,~#1!~How~is~#2~doing? ...
Witiko's user avatar
  • 1,006
3 votes
1 answer
84 views

How to know for certain in expansion-contexts the moment when the result of a fully expandable expl3-function is there?

There are a lot of functions provided by the expl3 programming environment that in interface3.pdf are marked with a black asterisk (fully expandable) or with a white asterisk (restricted expandable). ...
user avatar
2 votes
1 answer
119 views

\cs_new:Npn causes illegal unit or measure error while \let doesn't

In the MWE: \documentclass{article} \setlength{\fboxsep}{0pt} \begin{document} \ExplSyntaxOn \cs_new:Npn \foo:nn #1#2 { \makebox[#1][s]{#2} } % \cs_new:Npn \bar:nn #1#2 { \foo:nn #1#2 } \let \...
Stephen's user avatar
  • 4,494
3 votes
1 answer
89 views

expl3 expansion error when using pdflatex

Looking for an answer to this question I got with pdflatex an error related to the expansion of \$ with expl3. For example : \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\test}{ m } { ...
jlab's user avatar
  • 3,986
4 votes
3 answers
278 views

Tutorial for expl3 regular expressions, specific question for non-numeral deletion from string

Question: Given a string of ordinary text characters, delete anything that is not a numeral. Save it as a macro for further processing. The remaining numerals must be in order written, and must have ...
user avatar
6 votes
2 answers
206 views

How to set a colon when using ExplSyntax

I can't believe I'm the first person to ask this, but is there a better way to set a literal colon (:) within Expl syntax than \str_use:N\c_colon_str? That's pretty clunky for things like writing a ...
OpenAI was the last straw's user avatar
5 votes
3 answers
415 views

Treatment of expl3 variables - registers versus macros

In expl3 some variables are implemented as TeX registers (dim, skip, muskip, int) while others are implemented as macros (tl, str, clist, fp, bitset, etc.) (Relevant: interface3.pdf section "...
User23456234's user avatar
  • 1,888
3 votes
1 answer
143 views

LaTeX3 regex not working

I have a very strange bug and I guess I am not using LaTeX3 regexes as they are supposed to be used. My current document looks like this: \documentclass{standalone} \ExplSyntaxOn \regex_new:N{\...
Vincent's user avatar
  • 5,327
0 votes
3 answers
60 views

In Latex3, how to test if all tokens in the input verify a test (for example \token_if_letter or \token_if_space)?

In Latex3, I would like to write a function that checks if every token of an input verify a predicate. Basically I would like the multitoken version of this command: \NewDocumentCommand{\mychecksingle}...
Vincent's user avatar
  • 5,327
2 votes
2 answers
86 views

The timing of defining new macro and reading its value from the aux file

I would like to define two commands: \RecordTagText{tag}{text} which stores to each unique tag some text, and \ShowTagText{list of tags} which prints the text corresponding to the given list of tags, ...
Jinwen's user avatar
  • 8,618
2 votes
1 answer
44 views

Correct way to set expl3 sequences in the aux file

Consider the following example, in which it (globally) adds an element TEST to the sequence \g__mymodule_test_seq in the .aux file. Then if it is asked to show the sequence content immediately in the ...
Jinwen's user avatar
  • 8,618
1 vote
3 answers
84 views

Create alphanumerical hash string based on an input string

This question is close to my question here but in this case I want to create an alphanumerical hash string (0-9, A-Z, only capital letters) of 4 digits (in best case adaptable) depending from an input ...
PascalS's user avatar
  • 750
0 votes
1 answer
102 views

Resetting key-value pairs

I want the ability to reset the values of adr_keys to blank values. What type of function should I construct? I will be using \tl_if_blank:VF \l_dwlg_tl { \tl_use:N \l_dwlg_tl \\ } to print the ...
Veak's user avatar
  • 1
0 votes
0 answers
40 views

Leave blank lines in expl3 packages for better code clarity

Leaving empty lines in the code of a package is usually not recommended. But for packages written with expl3 new lines, as spaces, are ignored. So, could blank lines be safety used to aerate the code ...
jlab's user avatar
  • 3,986

1
2 3 4 5
31