Skip to main content

Questions tagged [l3keys]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
-1 votes
3 answers
86 views

Key-Value pairs that define a position (x,y) for drawing [closed]

I want to draw triangles, and would like to pass Key-Value pairs that define positions such as (0,0), (3,0), and (1.5,2.6). Is there any mechanism to do such a thing ? That is, to pass three ...
Franklin's user avatar
3 votes
2 answers
64 views

Spaces removed in class option via l3keys

I define a class kv-option via l3keys, as example I use title. If I want to set the title via \documentclass[title = {My first title}]{Testing} it works but whitespaces are removed (Result: "...
Dave's user avatar
  • 327
-3 votes
1 answer
69 views

Passing keys to \lenest:nn

Is it possible to pass keys to \lenes:nn ? \documentclass[a4paper,12pt]{article} \ExplSyntaxOn \cs_new_protected:Nn \lenes:nn { \str_case:nn {#1} { {mig} { \geometry { ...
Bulldrive's user avatar
  • 161
0 votes
1 answer
44 views

passing a group of package(class) options in 1 key using l3keys2e in latex class

problem I want to writing a docuementclass, called it foo.cls in the following context. Assume there is a document class called bar.cls, which can accept the following key-value(options): \...
zpding's user avatar
  • 134
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
0 votes
2 answers
90 views

Changing tabular option with l3keys

In the following implementation I am using w{l}{\l_ditura_width_dim}, but I also want to have the option of using l instead. Could I just replace w{l}{\l_ditura_width_dim} with an l, or is it better ...
Bulldrive's user avatar
  • 161
3 votes
1 answer
76 views

Understand the workings of \keys_precompile:nnN

I do not really understand the workings of \keys_precompile:nnN. Does it run every time \l_kvi_adrs_reset_tl gets called ? \NewDocumentCommand {\ladrs} { s m } { \IfBooleanF {#1} { \...
Bulldrive's user avatar
  • 161
1 vote
1 answer
76 views

Using existing values in l3keys

How does the following print Heime Borgia 405 Hilgard Ave Los Angeles California 90095 United States Likku Cirillu 409 Hilgard Ave rather than Heime Borgia 405 Hilgard Ave Los Angeles California ...
Veak's user avatar
  • 1
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
1 answer
50 views

Passing commas to key-value pairs with l3keys

How can I pass commas to key-value pairs when using l3keys ? Have inserted double quotes but the quotes get printed as well, something I do not want to appear. \documentclass[a4paper,12pt]{article} \...
Veak's user avatar
  • 1
0 votes
1 answer
55 views

Resetting l3key values for starred version

I really do not understand the purpose of .initial:n. It is only useful for the first call to a command that does not have user-values, after that the current values are used. Would like to have the ...
Veak's user avatar
  • 1
2 votes
2 answers
95 views

Empty arguments without .initial:n

When the initial values are not set and the arguments are empty, the current values in the variables are used, not necessarily the .initial:n ones. .initial:n only sets the values once at point of use,...
Veak's user avatar
  • 1
0 votes
3 answers
107 views

Initial, Default and User defined Keys

I would like to pass user-defined keys. But when the user does not specify values, the default values are used. I need some explanation on what to do in the \setdimensions command. What does ....
Veak's user avatar
  • 1
5 votes
2 answers
175 views

Why can I not correctly reset a key in l3keys?

To help me learn l3keys I created two small demos. The first uses l3keys for a command and seems to work correctly as far as I can tell. % !TEX program = lualatexmk % !TEX encoding = UTF-8 Unicode \...
LaTeXereXeTaL's user avatar
0 votes
0 answers
112 views

expl3 in package

I've read in interface3.pdf that expl3 is natively supported in LaTeX2e since February 2020. However, I cannot make the following work: % test.sty \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{test} \...
Gargantuar's user avatar
  • 1,241
1 vote
1 answer
107 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. ...
User23456234's user avatar
  • 1,886
2 votes
2 answers
156 views

can l3keys process multiple 'submodule'?

I would like to know if I can use l3keys to process multiple submodules as pgfoption can do ? Here is a MWE to illustrate my question: a package file mypkg.sty (containing in comment the error I get ...
R. N's user avatar
  • 1,138
3 votes
1 answer
155 views

How to append options to an existing .meta:n l3key?

If I have previously set up a .meta:n key with \keys_define:nn { module } { key .meta:n = { … } } then it's easy to replace the key with new values by calling \kerys_define:nn with new meta options. ...
David Purton's user avatar
  • 26.4k
4 votes
1 answer
77 views

What is the correct use of .choices when using keys?

I try to create a key normanius in the following way: Each key is mapped to an own variable \l__normanius_*_tl so that I can use those variables in some subsequent code. \documentclass{article} \...
normanius's user avatar
  • 443
0 votes
0 answers
40 views

Modify the optional argument of sectioning commands to pass key val lists

Standard classes have sectioning commands with an optional first argument, that can contain an alt title to be used in the table of contents and running heads. If one needs to use a keyval interface ...
yannisl's user avatar
  • 118k
0 votes
1 answer
73 views

Expand a clist from l3prop keys

I have a key that takes a comma-separated list as its value, with entries coming from the keys of a property list. I would like the "default" (no-value-given) to apply the key to every key ...
mbert's user avatar
  • 4,541
2 votes
1 answer
134 views

How to turn a LaTeX3 package key fontsize value into a command?

I do not know how to search for this issue as backwards slash or \ in questions has not gleaned anything useful. How can I set a key-value and then use a font size value without having to use a ...
JamesT's user avatar
  • 3,201
6 votes
1 answer
109 views

Expansion in precompiled l3keys

I'm having some issues with expansion in precompiled l3keys. I'd like to define a command \NewThm{<name>}[<options>] that sets the displayed theorem name to be a titlecased version of the ...
mbert's user avatar
  • 4,541
0 votes
0 answers
47 views

Use of keys_define [duplicate]

I have encountered the following. What are keys about and how are they to be used, for what purpsose. Could I have some examples ? \keys_define:nn { feuds_teorema_keys } { name .tl_set:N = \...
Veak's user avatar
  • 1
9 votes
2 answers
199 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} ...
mbert's user avatar
  • 4,541
4 votes
1 answer
82 views

key property .notif is unknown

Following the example in The LaTeX Companion, 3rd edition, Part II, page 700, I'm trying the following .sty file and .tex file that loads it, but I get error: ./myfont.sty:8: LaTeX Error: The key ...
murray's user avatar
  • 8,692
5 votes
4 answers
233 views

Passing macro parameters with \DeclareKeys/\SetKeys

Just as an exercise I'm trying to make a keyval interface to amsthm's \newtheoremstyle in the manner of thmtools, but using the kernel's \DeclareKeys instead of keyval and kvsetkeys. Every argument of ...
mbert's user avatar
  • 4,541
4 votes
0 answers
81 views

About unknown keys caught by 'unknown' in 'l3keys'

Is there a way to catch with the key unknown all the unknown keys, including the keys of submodules? For instance, in the following code, the unknown key foo/bar is not caught by the key unknown. \...
F. Pantigny's user avatar
  • 43.2k
1 vote
2 answers
392 views

Good practice with \DeclareKeys

I'm trying to make a "one-off" theorem environment for theorems with custom names that shouldn't be numbered at all. The goal is to copy the behavior of thmtools \declaretheorem[thmbox=M]{...
mbert's user avatar
  • 4,541
2 votes
1 answer
41 views

expl3: wrong result with \l_keys_key_tl and \text_titlecase_first:n

The following code tries to process the argument as keys, and store the one unknown key's name into a token list. What is confusing to me is that, if, say, the argument is text, when I ask the macro ...
Jinwen's user avatar
  • 8,618
1 vote
1 answer
90 views

expl3: keys enabled under certain condition

In my package, there are options like: \keys_define:nn { crefthe-setting } { , variant .tl_set:N = \l__crefthe_variant_tl , nom .meta:n = { variant = ...
Jinwen's user avatar
  • 8,618
6 votes
1 answer
270 views

Variable naming inside l3keys

I have a question about naming variables. In expl3, the variable naming convention is the following: \<scope>_<module>_<description>_<type>. The <scope> can be l, g, or c,...
User23456234's user avatar
  • 1,886
1 vote
1 answer
88 views

How to prevent .initial:n from setting keys before \ProcessKeysOptions is called?

I am writing myself a package and I want to use imakeidx as a dependency. However, I don't want to make it a hard dependency, and so I was going to add a package option to disable to automatic loading ...
WBob's user avatar
  • 115
1 vote
1 answer
285 views

Using \DeclareKeys as a document author/designer

Say I want to use a package using l3keys for it options, e.g. I want to print numbers using siunitx's \num. I load it with my desired default options (e.g. just \usepackage{siunitx}) but have a ...
schtandard's user avatar
  • 15.4k
2 votes
3 answers
189 views

LaTeX3 keyval forwarding

Say I want to write a command igtest, which works identically as \includegraphics from graphicx, except that if the page number is given, e.g. \igtest[page=5]{someimg}, then the page number is ...
Yijun Yuan's user avatar
0 votes
1 answer
65 views

Why do I not get my custom error message in case of "unknown choice for a l3keys.choice"?

I'm trying to issue a custom error message in the case of an unknown choice for a l3keys .choice key. In the following MCE: I created a custom message Unknown~key~choice, I defined a key key which ...
Denis Bitouzé's user avatar
1 vote
0 answers
47 views

Is it possible for l3keys' key to contain a \long value?

In the following MCE, the key key (of .tl_set:N type) stores a ⟨value⟩ which is added, centered, at the end of the document. It works well, except if the ⟨value⟩ is \long (is multi-paragraphs). Okay, ...
Denis Bitouzé's user avatar
5 votes
1 answer
88 views

How to use the l3keys' .cs_set:Np key property?

The l3keys documentation says: .cs_set:Np ⟨key⟩ .cs_set:Np = ⟨control sequence⟩ ⟨arg. spec.⟩ Defines ⟨key⟩ to set ⟨control sequence⟩ to have ⟨arg. spec.⟩ and replacement text ⟨value⟩. But I don't ...
Denis Bitouzé's user avatar
3 votes
1 answer
107 views

expl3: How to make some keys required?

I have discovered the l3keys package and would like to use it. Here, specifically, I want to enforce that some keys are required. According to the documentation, the property "value_required:n&...
normanius's user avatar
  • 443
0 votes
1 answer
51 views

``key-one=value one'' versus ``key-one={value one}'' in l3keys or package options

I just noticed that key-one=value one and key-one={value one} seem equivalent as \keys_set:nn arguments but not as package options. In next minimal example, the same key-value argument is parsed as a ...
Jérôme LAURENS's user avatar
2 votes
1 answer
85 views

Attempting to forward select l3keys arguments from an outer environment to a tblr: "Unexpandable command inside column type"

I'm attempting to create an environment that takes its arguments as key-value pairs, uses some of them, and then forwards the rest on to a tblr environment from tabularray. This results in an "...
Ray's user avatar
  • 165
2 votes
0 answers
67 views

Best way to tell what a .meta:n l3key has been set to

What is the best way to tell what a .meta:n l3key has been set to? e.g., in the following MWE, how can I tell that keyc was set to true even if keya and keyb are subsequently set to false? The best ...
David Purton's user avatar
  • 26.4k
1 vote
2 answers
113 views

l3keys multichoice with value

I want a package using expl3 to accept a multiple choice list of key=boolean pairs to a parameter where each value is optional and defaults to false if not specified. I still find generic examples of ...
Doc Octal's user avatar
  • 369
4 votes
2 answers
336 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, ...
Betta George's user avatar
3 votes
0 answers
149 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 } { ... , ...
Jinwen's user avatar
  • 8,618
7 votes
3 answers
575 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, ...
L.J.R.'s user avatar
  • 11.3k
6 votes
1 answer
541 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 ...
Jinwen's user avatar
  • 8,618
5 votes
1 answer
149 views

Unused global option(s) warning with latex 2022-06-01-PL2

I was about to ask this question a few days ago, but at the time the site suggested this question to me and I thought that it is the same problem with mine. But now as PL2 releases, the problem in the ...
Jinwen's user avatar
  • 8,618
5 votes
4 answers
263 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 ...
L.J.R.'s user avatar
  • 11.3k