Questions tagged [l3keys]
The l3keys tag has no usage guidance.
69
questions
2
votes
1
answer
32
views
l3keys: Synonymous keys not working
In the key-value interface of one of my commands, there is a key name style, and I have defined an alternative name for it as follows:
, name-style .meta:n = { name~style = #1 }
, name-...
0
votes
1
answer
38
views
l3keys: how to "generate" `.inherit:V` variant of `.inherit:n`
From the documentation,
⟨key⟩ .inherit:n = {⟨parents⟩}
Specifies that the ⟨key⟩ path should inherit the keys listed as ⟨parents⟩.
Because may parents are collected in \l_MY_parents_clist, I would ...
0
votes
0
answers
33
views
l3keys: clear the corresponding macro when the option is not given
Suppose there are several keys defined as:
\keys_define:nn { mymodule-mykeys }
{
, optionOne .clist_set:N = \l__mymodule_mykeys_optionOne_clist
, OptionTwo .tl_set:N = \...
1
vote
1
answer
31
views
How to define synonym or opposite keys with l3keys2e?
In my package, there are several bool-valued options that are interrelated. How should I reflect the relations in \keys_define?
Take a concrete example, with the following code, does it define the key ...
0
votes
2
answers
64
views
Requiring arguments to \NewDocumentEnvironment
I've defined an environment similar to what appears below, and I want two of the arguments to be required. My impression from the interface3 document is that saying .value_required in the keys_define ...
0
votes
0
answers
51
views
Presetting keys in l3keys
As far as I am aware, there is no mechanism in l3keys to preset keys like the xkeyval supports.
I explicitly do not mean the .default:n specification in l3keys, since this is invoced if the key is ...
1
vote
2
answers
52
views
why the \tl_gset:Nn or .tl_gset:N not work when token list out of \keys_define:nn?
I want to write my own package, when I use my package, I want to give some paper size option. but whatever I try, \g__zztj_paper_size_tl is invalid when out of \key_define:nn. the MWE is:
% sty file
\...
0
votes
4
answers
92
views
Define global function within \begingroup ... \endgroup
I have a command that accepts optional arguments as key-value pairs, handled by the l3keys package. I use \begingroup and \endgroup to \keys_set:nn the keys in order to process set options only for ...
2
votes
2
answers
145
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
0
answers
30
views
expl3/l3keys/\keyval_parse:nn - What is the reason for order of appending <key> and <value> to <code2>?
In interface3.pdf, released 2021-07-12, section "26.8 Low-level interface for parsing key–val lists" you find:
\keyval_parse:nnn ✩ New: 2020-12-19 Updated: 2021-05-10
\keyval_parse:nnn {⟨...
0
votes
0
answers
40
views
Use a code when one special package option value is used
I have missed something with the definitely M(not)WE code below.
When the option auto is used, I would like to achieve the action in the "funny" macro \babellang that makes me feel ashamed. ...
2
votes
0
answers
104
views
Macros: From Arguments to Keys, with Expl3: Optional Arguments
When declaring a new command with multiple optional arguments next to each other, e.g.
\NewDocumentCommand{\mycmd}{ o o o }{}
one is implicitly excluding the option of passing a value for #2 without ...
2
votes
2
answers
80
views
Process Comma Separated List from Key Value (expl3)
I'm trying to \SplitList / \ProcessList a clist set in a wrapper command's argument as the value of a key.
Unfortunately, it seems that the original command (\mycmd below) doesn't recognize the input ...
0
votes
0
answers
86
views
how to insert keys from token list in command
When i try to insert in command variable with keys,i get an error:
LaTeX3 Error: The key '__tag/mc/\g__last_mc_tl' is unknown and is being
(LaTeX3) ignored.
I understand, why this happen. It ...
0
votes
1
answer
56
views
key_define option
Consider the following MWE:
\documentclass[letterpaper]{article}
\usepackage{l3draw}
\ExplSyntaxOn
%----------------------------------------------------------------------------------------
% ...
2
votes
1
answer
100
views
Key values using l3keys (pencil symbol)
Consider the following MWE:
\documentclass[letterpaper,11pt]{article}
\usepackage{l3draw}
\ExplSyntaxOn
\dim_new:N \l__pencil_dim
\fp_new:N \l__pencil_linethickness_fp
\cs_new_protected:Nn \...
2
votes
1
answer
99
views
Class options don't work if class and document files are in different directories
I have the following directory tree:
.
├── foo
│ └── foo.tex
└── testcls
└── testcls.cls
where foo.tex is
\makeatletter
\def\input@path{{../testcls/}}
\makeatother
\documentclass[hyperref=true]...
1
vote
0
answers
24
views
use of .bool_set_inverse:N doesn't seem to match its definition [closed]
Here is an mwe
\documentclass{article}
\ExplSyntaxOn
\cs_new:Nn \en_direct: { beginning }
\keys_define:nn { test }
{
direct .bool_set:N = \test_direct_bool,
indirect .bool_set_inverse:N = \...
1
vote
2
answers
73
views
Weird behaviour with expl3's keys
Consider the following MWE:
\documentclass{article}
\usepackage{amsthm}
\usepackage{xparse}
\newtheorem{theorem}{Theorem}
\newtheorem{definition}{Definition}
\ExplSyntaxOn
\tl_new:N \...
0
votes
1
answer
72
views
How to reset key values in LaTeX3
In the MWE below, how can I reset the value of the title key, assigned to \l__lecture_title_tl, so that the third instance of \lecture doesn't print A title?
\documentclass{article}
\usepackage{...
0
votes
1
answer
57
views
parse known keys, store unknown key=val pairs for later use
I'm new to expl3 syntax and can't get it to work properly. I'd like to get the values of known keys into variables but leave unknown pairs untouched for later use e.g. to be used in a document command ...
0
votes
1
answer
59
views
Store the value of `\c@page` with l3props
I am trying to store the first page that an environment starts in in an l3props store.
I have tried
\let\current_page_int\c@page
\cs_generate_variant:Nn \prop_gput:Nnn {Nne}
\prop_new:N \...
1
vote
2
answers
90
views
xparse: \NewDocumentCommand using a set of predefined keys
I would like to understand what makes the following not work, and how to fix it in order to get the desired output as given under each call of the command \myQFormat.
\documentclass[addpoints]{exam}
...
2
votes
1
answer
92
views
Custom arguments in an environment xparse
Is it possible to create an environment with required arguments that would represent some changes in the environment using only xparse package without environ?
To be more specific I'd like to make an ...
0
votes
1
answer
101
views
Generating an error message for unknown keys
The code below outputs:
ERROR: Package Foo Error: Unknown key, \l_keys_key_tl
Why does \l_keys_key_tl expand at Hook 1, not Hook 2?
\documentclass{report}
\usepackage{xparse}
\ExplSyntaxOn
\...
2
votes
2
answers
77
views
Handle (default) key-values for nested commands
If one defines a command with a key-value argument, say \ket[<key=value>]{<stuff>}, one gets the wrong output when nesting it (in my opinion). E.g. \ket[delim = |)]{ \ket{\psi} } changes ...
2
votes
1
answer
167
views
keyval_parse for dummies
This example compiles forever. I must be misusing keyval_parse
\documentclass{report}
\usepackage{xparse}
% Relevant doc:
% http://www.texdoc.net/texmf-dist/doc/latex/l3kernel/interface3.pdf#part.21
...
1
vote
0
answers
80
views
What is the correct way to place keys and messages without repeating too much code (expl3)
I am trying to put error messages for invalid keys in a package, some keys are available for the package, others can be accessed with the command \mypkgset and others are only available as options of ...
1
vote
1
answer
170
views
How to set a key in "module" and pass the rest of the keys to "module/subgroup" in l3keys?
I'm trying to create a key to pass the rest of the keys to /subgroup based on a boolean condition. That is to say that something like this works:
[key in <module>, rest of keys pass to <...
0
votes
1
answer
223
views
Problem passing a key=color (separated by commas) from l3keys to tikz
After a good time searching the forum I gave up (I thought I could do it by myself), I have a problem passing a key from l3keys (separated by commas) to tikz.
I've created a command that accepts ...
0
votes
0
answers
126
views
key={v,a,l} argument separated by commas in xparse [duplicate]
I'm trying to create a command to show the distributive property of multiplication (for school effects) using tikzmarks and xparse. So far so good, the code is a bit long and I would like to know if I ...
2
votes
1
answer
88
views
Problem with font commands as `l3keys2e` values
I'm setting some fonts and font-related commands using l3keys, and that works just fine—but it seems there's an issue when setting the same keys via l3keys2e. Is this expected behavior? Is there a way ...
4
votes
2
answers
103
views
Strange behaviour in l3keys
Consider the following code which uses \keys_set_known:nnN:
\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
\keys_define:nn {empty_module} {}
\keys_define:nn {module1}
{key1 .code:n = {\...
0
votes
2
answers
357
views
l3keys2e's option with accent: \UseTextAccent... \@curr@enc error
The following expl3 class, that provides an option (mykeyword) thanks to l3keys2e, works like a charm:
\begin{filecontents*}{myclass.cls}
\RequirePackage{l3keys2e}
\RequirePackage{expl3}
\...
0
votes
0
answers
177
views
l3keys2e: best practices to pass options from class to package
I moved part of the code in a class to a new package. This package can handle a couple of options defined using l3keys and processed with l3keys2e (one option being multichoice). My problem is that I ...
7
votes
2
answers
191
views
Code hook after variable setting actions in l3keys
I am trying out l3keys for the first time and I am encountering the following issue. I have some boolean keys (true/false). For them it looks nice to use .bool_set:N so that I can get automatic ...
3
votes
1
answer
218
views
Extend book class with options of multiple values
I am writing a class based on book.cls, to which I want to have an option that is a list, so I can do
\documentclass[languages={french, english}]{testops}
I have define the key using l3key2e. But it ...
5
votes
2
answers
222
views
Store unknown key in l3keys
Is there a good way to store the key of an unknown key-val in expl3? I can get \l_keys_key_tl, but it gets overwritten before it's expanded. I suppose I need to expand it when I store it, but I'm ...
2
votes
0
answers
170
views
Pass a list of package-options to a self-written documentclass using l3keys2e
I am writing a documentclass which loads several packages as default. I want to give the user the possibility to pass options to these packages using an documentclass option. Because most packages ...
7
votes
2
answers
163
views
How can I recover option values with the current l3keys2e?
Minimal-Compiling-But-Not-Working Example:
\begin{filecontents}{\jobname.cls}
\ProvidesClass{\jobname}
\RequirePackage{l3keys2e}
\ExplSyntaxOn
\keys_define:nn { job / doc }
{
doc~name .tl_set:N =...
3
votes
1
answer
161
views
How to use choice keys in l3?
I want to create some shortcuts for constants and I want to use these shortcuts for
calculations (without units) for example with \fpeval
with one or two different units
I tried the following code, ...
0
votes
0
answers
182
views
LaTeX3 choice keys that set other choice keys
I'm trying to set up choice keys that can implicitly set other choice keys. In both the "parent" and "dependent" keys, the set of choices have the same values.
The code below does more-or-less what I ...
4
votes
1
answer
285
views
Setting default values for LaTeX3 keys
I've written the following code for setting values of a key as part of a package I'm working on, and for some odd reason the default doesn't seem to work. When the package this is part of is specified ...
4
votes
1
answer
144
views
Use value of token list at time of \keys_set:nn
I'm trying to set up a macro \MyCommand{#1}{#2} which takes two inputs, one being a key-val list and then creates a token list which is named based on the input and the key name, having the value ...
4
votes
2
answers
2k
views
Key property is unknown
i just updated my Linux distro (Linux Mint 17.3 -> Linux Mint 18) and from TeX Live 2014 to 2016. I have a (large) selfmade documentclass writte in LaTeX3.
Now I tried to compile a document using my ...
2
votes
0
answers
454
views
Reason not to use a specific key val package [closed]
According to the very nice list of packages concerning this topic (A big list of every keyval package)
I am confused which package I should use now to be prepared for the future.
Any ideas which ...
6
votes
1
answer
303
views
How can I use a tl variable in TikZ options
Im setting up a command with some options via l3keys. One of the options is tikz-options and it should take a list of TikZ options and pass them to a {tikzpicture}.
\documentclass{article}
\...
11
votes
1
answer
197
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 ...
2
votes
1
answer
149
views
How to properly parse [...]{...} with expl3?
What would be the more efficient way of parsing [...]{...} with expl3, that is to get the content inside the brackets in one variable and the content inside the braces in another one?
This question ...
4
votes
0
answers
79
views
Is it possible to label (tag) a value of a (l3keys) key-value in order to reuse it elsewhere easily?
I have a command (\people[⟨options⟩]{⟨name⟩}) for entering people. Its optional argument lets the user specify possible people's (possibly multiple) attribute(s) with a (l3keys) key–value system: ...