All Questions
36 questions
4
votes
2
answers
130
views
How to define a .meta:n key preserving hashes?
I have a command that sets some keys, does stuff with the keys, and defines a new "meta" style with those keys to be called later with inherit-style=<style name>. This works fine using ...
2
votes
1
answer
130
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 ...
1
vote
1
answer
109
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 ...
1
vote
1
answer
117
views
Braces in l3keys
In many cases, the braces surrounding values to keys in l3keys are omitted when defining keys, even when the keys themselves have n-,c-, or e-type arguments, which normally require braced arguments. ...
4
votes
1
answer
99
views
How to use similar package and command keys, should they be separate or the same variable?
I am writing a expl3 package for typesetting amino acid residues and I am still getting to grips with LaTeX3 and the interfaces documentation. I have looked at the nicematrix annotated code for ...
9
votes
2
answers
210
views
l3keys equivalent of pgfkeys' .code 2 args
What is the recommended way to emulate pgfkeys' /.code 2 args (or more generally /.code n args) handler with l3keys? For example, with pgfkeys one can do
\documentclass{article}
\usepackage{pgfkeys}
...
1
vote
0
answers
124
views
Use of xparse macro and expl3 key-value pairs [closed]
I'm trying to set up a family of key-pairs to be used in a \NewDocumentCommand. The goal is to have a function with two key-pairs. I want to be able to get the values of the two keys within the macro, ...
0
votes
1
answer
72
views
Can't make a list of keys work
I am trying to make my own chapter-heading formatting command, using a key=value approach:
\coolchap[
chapstyle=<chapter-word formatting>,
titlestyle=<chapter-title formatting>,
befchap=&...
4
votes
2
answers
358
views
Is there a way to reset all l3keys keys to their initial value?
This is a general and documented feature of latex3, but I shall still provide an MWE in order to illustrate the problem, see below.
Suppose I have a function which uses the l3keys key-value interface, ...
0
votes
1
answer
90
views
keyval being picky about empty options
I am trying to automate the generation of beamer handouts, with the help of \pgfpagesuselayout. I want them with 2 slides on 1 page, my colleagues with 4 in landscape orientation. So we generate both ...
3
votes
0
answers
157
views
Unknown options fail to pass with new expl3 method [closed]
Recently I switched my packages to use the new \ProcessKeyOptions method for processing package options. However, I just found out that with
\keys_define:nn { projlib-theorem }
{
...
, ...
7
votes
3
answers
609
views
How to define new key properties in l3keys
Related Meta Question
From interface3.pdf, we can see l3keys has provided several key properties such as .code:n, .tl_set:N, .usage:n. But I don't know how to define a new key property.
At this time, ...
6
votes
1
answer
601
views
As of 2022, how should one build class/package options without l3keys2e? [duplicate]
In a comment of this question,David Carlisle wrote:
[l3keys2e] should be considerd legacy now, the new built in option code is based on the same core expl3 code but extended and improved so hopefully ...
5
votes
4
answers
281
views
What is the best way to expand macros inside keyval input in expl3
I think LaTeX packages rarely use macros as key names. And some users expect macros inside the keyval input will be expanded recursively first. But l3keys in expl3 doesn't provide this functionality ...
4
votes
2
answers
119
views
Appending a token list keeps referring to it instead of copying
I actually had some workarounds and overcame my issue. But I still cannot understand some points.
I'm trying to write a command to draw a table. I started with this:
\documentclass[10pt]{article}
\...
3
votes
2
answers
368
views
How to distinguish "no value" from "empty value" when setting `l3keys`?
I'm trying to create an option with l3keys such that, if it receives a value, even if an empty one, it gets added to a property list, but if it receives no value, it gets removed from the property ...
1
vote
2
answers
80
views
What is the correct usage of the inline key-val parser?
I assumed \keyval_parse:nnn absorbed its third argument, yet it is inserted in the input stream, why?
\documentclass{report}
\usepackage{xparse}
\begin{document}
\ExplSyntaxOn
\noindent%
\...
1
vote
1
answer
63
views
Fill spreadtab with key value command
In this question, there are three answers to build a tabular from a key value command.
How to build a spreadtab with the same key value in order to be able to sum up columnwise (with a tag to reuse ...
4
votes
3
answers
359
views
Forward list of key-value-pairs to other command in expl3
I would like to pass a list of key-value pairs to another command/environment. In this MWE to tcolorbox, but it should work in general (e.g. pass parameters to \LoadClass[params]{article}).
\...
2
votes
2
answers
154
views
ocg: problem using keyval
Trying to build expandable macros using ocg layers, I am facing quite disturbing issue that I am not able to figure out and so turn here for some help of specialists...
I am using a macro to insert ...
3
votes
2
answers
552
views
Automatically shake questions and answers for a test created with LaTeX after the compilation
We suppose that we have 30 question to solve a text for students instead of 2 as this MWE:
\documentclass[leqno,11pt,landscape,a3paper]{extarticle}
\usepackage{multicol,mathtools}
\usepackage[T1]{...
1
vote
1
answer
164
views
Keep a key locally passed from multicols to enumitem using xparse
I have a small problem when trying to keep a key=val locally defining using xparse to pass multicols to enumerate (enumitem package). I have redefined the environment enumerate to accept the columns=...
1
vote
0
answers
54
views
Right expl3 data type and method to store and pass key-value style options to a LaTeX2e macro? [duplicate]
How can I store comma separated options in an expl3 data type and then pass those options to a LaTeX2e macro?
Something like this (doesn't have to be a clist—I'm not sure what is the best data type ...
21
votes
1
answer
2k
views
What's the correct way to define package options in expl3?
For writing a package it's usually important to be able to define package options. Since the package I'm writing is in expl3 I wondered whether there's a l3ish way of defining key-value-package-...
4
votes
1
answer
363
views
How can I save key-value options which include key-value options in expl3?
I have a command which uses a key-value syntax. For example, it includes an image with various options, if desired.
I am using expl3 key-value processing.
I would like to save the key-value ...
5
votes
1
answer
119
views
How can I pass a list of values generated in expl3 as a single value for a key to a macro such as \includepdf?
This should probably be obvious but it is not. Or not to me right now, anyway.
I want to generate a list of values (e.g. page numbers and empty values) and then pass that list as a value of a key (e....
11
votes
1
answer
223
views
Does expl3 key-setting syntax have an equivalent of TikZ/PGF's .cd?
This question has the following form: 'I know how to do X using Y. I can also do X using Z but not so elegantly as using Y. Can I do X using Z in the same way that I can do X using Y, for a more ...
11
votes
2
answers
754
views
Misunderstanding from l3keys documentation
Based on the interface3 documentation and a nice article in TUGboat, Volume 31 (2010), No. 1 called Programming key–value in expl3 by Joseph Wright (available here), I have been trying to put together ...
6
votes
2
answers
317
views
user-defined markup aliases with l3
I would like to write a package providing semantic markup for scholarship in the humanities (loosely following TEI-XML). In the source code, users would use macros like \term for a foreign term or \...
5
votes
1
answer
692
views
Accessing sub/keys with l3keys
I'm not sure if I'm taking it too far, but I think I've seen something like this around. This gives an error:
\documentclass{scrartcl}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand \RULE {}
...
6
votes
1
answer
619
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 ...
10
votes
1
answer
308
views
How to dynamically give key names with expl3?
I have a property list which associate names with values
name 1 -> value 1
name 2 -> value 2
...
I want to use names from the property list to dynamically create keys. The following code
\...
12
votes
1
answer
242
views
What are best practices when augmenting and building on the keys provided by someone else's package
The situation is one where I'm developing my own commands and environments which build on the commands and environments provided by another package: for ease of talking let's call this other package ...
7
votes
2
answers
416
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 with ...
8
votes
2
answers
636
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
\...
6
votes
2
answers
178
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 ...