Questions tagged [l3keys]
The l3keys tag has no summary.
150 questions
3
votes
2
answers
190
views
how to define an expandable key-value command?
As shown in the code below, in order to use the result of \testSet{a=400, b=900}, I have to declare a global variable \g_test_result_fp and define a \testGet command. Can I directly use \fpeval{\...
8
votes
1
answer
145
views
Why is \l_keys_choice_tl a token list instead of a string variable?
Question: Why is \l_keys_choice_tl in l3keys a tl instead of a str variable?
My understanding is that key names are stored as strings using \tl_to_str:n. For choice keys, each choice is implemented as ...
3
votes
1
answer
110
views
keytheorems + tcolorbox: accessing tcbkeys in the optional argument of an already declared theorem
Desired Outcome
Taking inspiration from muzimuchi Z's answer to my question on making tcolorbox's 'connect', I want to define \newkeytheorem's (e.g. theorem) with the resultant syntax
\begin{theorem}(&...
2
votes
3
answers
202
views
Use of l3keys to collect optional arguments of `\NewDocumentCommand`
I am trying to understand how to use xparse to specify arguments to \NewDocumentCommand.
I need need to make a command which accepts a bunch of optional arguments in addition to a mandatory argument.
...
3
votes
1
answer
136
views
Simplify syntax for command that adds .meta key to existing keys (l3keys)
At the moment I have a command to add meta keys taken from the
answer given by @Skillmon in Add .meta key to existing keys (l3keys)
which works perfectly, but I would like to simplify the input syntax
...
3
votes
1
answer
105
views
\sys_get_shell:nnNTF with errors defined in \keys_define
Based on my previous question, consider the following files:
test.cls
\ProvidesClass{test}
\ExplSyntaxOn
\keys_define:nn { test }{
git .code = {
\sys_get_shell:nnNTF {git rev-parse HEAD} {}...
8
votes
1
answer
137
views
`.initial:n` leads to an error when after `.inherit:n`?
This code originally from Inheritance of keys in expl3:
\documentclass{article}
\begin{document}
\ExplSyntaxOn
\keys_define:nn { a } {
A .tl_set:N = \l__A_tl
}
\keys_define:nn { } {
b ....
4
votes
3
answers
344
views
Why l3keys don't expand key-values?
The question raised from this MWE:
\documentclass{article}
\def\myzihao{5}
\usepackage[zihao=\myzihao,fontset=fandol]{ctex}%failed with not expansion
% \usepackage[zihao=5,fontset=fandol]{ctex}% work
...
3
votes
1
answer
94
views
Defining private keys using l3keys
I recall reading somewhere (sorry, can't remember where) that keys defined using l3keys can be made private by naming convention (although of course TeX doesn't strictly enforce this) similar to how ...
1
vote
1
answer
120
views
Set up default key behaviour expl3 even when it is not called
In a macro, how can I create a key that executes a given piece of code if it is not called?
For example, if the keys are set to be the first (optional) argument of a macro, I would do \tl_if_in:nnTF { ...
0
votes
1
answer
77
views
Expanding Key Value Options
Consider the following MWE:
\documentclass{article}
\usepackage[vmargin=3cm]{geometry}
\usepackage{l3draw}
\usepackage{lipsum}
\ExplSyntaxOn
% User key interface
\keys_define:nn { shc/notepad }
{
...
2
votes
1
answer
63
views
Dynamic Key Values for Assessment Data
Consider the following MWE:
\documentclass[letterpaper]{article}
\usepackage{l3keys2e}
\usepackage{mathtools,amssymb}
\usepackage{array}
%---------------------------------------------------------------...
3
votes
3
answers
158
views
Can I set a group for the unknown key handler?
I am working on an extension to the exam class, and would like to add optional arguments to the \question command. Currently, the command takes one optional argument, the number of points the question ...
2
votes
1
answer
83
views
mu unit not working in l3keys... "Illegal unit of measure (pt inserted)"
I am writing a package in expl3 that defines custom spacing for logical formula. I recently swapped all of my spacing commands from hspace to mkern and mskip (after learning they were what was ...
4
votes
1
answer
163
views
default values for l3keys
clsguide.pdf §4.4 gives a short overview of how Latex3 style options could be used without using \ExplSyntaxOn. It seems logical that .store properties could be accompanied by an .initial or .default ...