Skip to main content

Questions tagged [key-value]

{key-value} is about packages and macros using the key=value syntax for named parameters instead of numbered parameters.

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
2 votes
2 answers
50 views

PGF keys are setting individually but not as a key list

Using the TeX Works AppImage with a local installation of TeX Live (texlive-full, 2021.20220204-1), I'm having trouble getting "pgfkeys" to work with a key list. Setting each key ...
user182238's user avatar
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
0 answers
43 views

Making keys global or reference them outside scope

I made this code to be used as an answer here: Efficient "macro" for adding second (x-)axis to pgfplots and more generally. \documentclass[tikz, border=1cm]{standalone} \usepackage{pgfplots} ...
hpekristiansen's user avatar
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
3 answers
91 views

Unexpected behavior of \g@addto@macro in class definition

I am implementing a new class for a journal. Withi this class, I defined the command to insert the authors of an article. I anticipate that everything works perfectly in the basic form, that is, if ...
TrAmA's user avatar
  • 17
10 votes
1 answer
384 views

Moving from pgfkeys to latex3 key-val system to handle package options

I have been advised in this question to move from pgfopts to latex3 to handle package options. I would like to do that but I must admit that I am a little lost. Examples with the patterns I'm using ...
Vincent's user avatar
  • 5,327
1 vote
2 answers
190 views

What is the most general form of key-value pairs for options?

Strange question I know. I know that it is possible to have options, to be more precise option keys, consisting of letters, but there seem to be possible more. some option keys seem to have a value ...
user2609605's user avatar
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
0 votes
1 answer
61 views

Can't pass choices option to package

I am trying to make a custom package to contain all my personal macros and a custom class for my personal style. I wanted to pass a keyword argument notation which can take a value of math or physics ...
Shai Avr's user avatar
  • 909
8 votes
2 answers
383 views

Weird error in custom package instead of the error I tried to throw?

I am making a custom package for all my personal commands, and I am trying to pass some keyword arguments to the package as described in section 4.4 of clsguide. My use case is that I take math and ...
Shai Avr's user avatar
  • 909
4 votes
3 answers
204 views

tikzset style - use a command to generate multiple key-vals

When creating a style with args using \tikzset, I have no problem creating "aliases" with args, as long as those args appear in the value part of a key=value, like xshift=#1. What I want to ...
likethevegetable's user avatar
3 votes
2 answers
137 views

Expand key-values with \def of \newcommand?

I have multiple repeated \begin{enumerate}[label=A\alph*), ref=A\alph*] and I want to reduce code duplication. I would also like to avoid creating new environments if possible. I just want a simple ...
Edoardo Fiocchi's user avatar
1 vote
1 answer
104 views

Unable to find error in my latex code

Hello LaTeX Community, I was working on a template and almost finished it, but there was a glitch in my code and I was unable to find it. While rendering the code, the \textbf{Question \questionnumber:...
IamK's user avatar
  • 33
10 votes
3 answers
561 views

Avoid spurious warnings in a parasitic class with key-value options (LaTeX3 \DeclareKeys)

This is a modified version of "Unused global options(s)" when using arguments in options of class. The question is how to create a parasitic class (i.e. one which loads another) which ...
cfr's user avatar
  • 208k
4 votes
1 answer
97 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 ...
JamesT's user avatar
  • 3,201
0 votes
1 answer
52 views

LaTeX3 package option .initial:N is not being respected and used in a command

I asked a question earlier that was helpfully answered by Skillmon but have ran into an issue when relying on the .initial:N value of a package option e.g. \usepackage[superscript-fontsize=large]{...
JamesT's user avatar
  • 3,201
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,531
1 vote
1 answer
89 views

Strict version of \keys_set_groups:nnn

Here's a little code where the key-value allowed by the macro is an unwanted feature : for example, single[both = OK, only = KO] doesn't give any error as I'd hoped. But on the other hand, I would ...
projetmbc's user avatar
  • 13.4k
2 votes
2 answers
46 views

Setting beamer label from xparse option

I want to write a custom environment that handles some layouts that default beamer slides aren't designed to do. I use xparse's \NewDocumentEnvironment to achieve this, but have problems passing down ...
fhred's user avatar
  • 43
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,531
0 votes
1 answer
70 views

Multilange support - need some help in xkeyval

I'm trying to do some improvements in the multiaudience package. In particular, I would like to have one latex document containing multiple languages. For simplification reasons the texts of the ...
Georg's user avatar
  • 51
1 vote
2 answers
391 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,531
1 vote
0 answers
118 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, ...
user1850133's user avatar
  • 1,028
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
1 vote
1 answer
54 views

How to find out available key-value pair for CircuiTikZ

I'm using CircuiTikZ and I came across this issue frequently: every time I want to tweak some options using tikzset, there is no documentation for the available key-value pairs. For example, if I want ...
Yiyang Yan's user avatar
1 vote
1 answer
79 views

\SetKeys (ltkeys): property '.default' is unknown?

Reading 'source2e.dtx' suggests that the 'l3keys' property '.default' should be available. The following MWE doesn't work as I expected though: \documentclass[a4paper]{article} \usepackage{color} \...
Daniel Flipo's user avatar
  • 2,204
0 votes
1 answer
109 views

Handling "family=" and "given=" within the "author" field

My zotero+BetterBibTeX has exported some citations like this @article{abduMagneticDeclinationControl1981, title = {Magnetic Declination Control of the Equatorial {{F}} Region Dynamo Electric Field ...
Rubem Pacelli's user avatar
0 votes
1 answer
65 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=&...
Vincent Krebs's user avatar
1 vote
2 answers
102 views

Define custom keys for graphicx

I would like to define some shorthand keys for includegraphics[]{} like so: fullwidth -> width=\textwidth, halfwidth -> width=0.5\textwidth etc. What is the best approach for this?
likethevegetable's user avatar
0 votes
1 answer
70 views

Loop in a specific list to define class options

I have a class beamer-rl to create beamer presentation for RTL languages (like persian) and I need a way to include RTL language as a class option like this \documentclass[persian]{beamer-rl} So class ...
Salim Bou's user avatar
  • 17.1k
2 votes
0 answers
61 views

Options passed to babel with article class and not with beamer

In this example using article class options arabic-ma and provide=* are passed to babel, but when changing to beamer class options are not passed to babel. Is there an explanation? \documentclass[...
Salim Bou's user avatar
  • 17.1k
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
1 vote
1 answer
66 views

Pgfkeys associated with macros lead to unexpected results

Consider the following class: % CLASS % Preamble \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesClass{myclass}[2022/10/11] \LoadClass[varwidth]{standalone} \makeatletter % Pgfoptions \RequirePackage{...
Vincent's user avatar
  • 5,327
0 votes
1 answer
82 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 ...
ysalmon's user avatar
  • 1,160
0 votes
1 answer
64 views

Split nested and simple comma lists the same way

\documentclass{article} \usepackage{kvsetkeys,kvdefinekeys} \makeatletter \def\Process@Split#1{% \if@tempswa \edef\ST@LastName{\comma@entry}% \typeout{* LastName:\ST@LastName}% \@...
rolfn's user avatar
  • 949
0 votes
2 answers
122 views

Taking in optional boolean flags in a macro without expl3

I want to create a macro \verticalStep which will produce a vertical skip of fixed length, and take two optional arguments, negative and small. So for you could use \verticalStep for a standard ...
Atai Ambus'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
1 vote
1 answer
126 views

Is it safe to use \globaldefs for setting global pgf key-value pairs?

With the help of this post (Is there a way to set a *global* key value using `pgfkeys`?), I found a simpler way to implement a solution to my own question (How can I create commands using multiple ...
frankieee's user avatar
0 votes
3 answers
158 views

How can I create commands using multiple arguments with pgfkeys in custom environments with tabulars? [duplicate]

I am trying to create my own template package. In this package, there are several custom environments defined. One of those environments starts and ends a table, i.e: \newenvironment{customenvtab}{\...
frankieee's user avatar
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
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
1 vote
2 answers
91 views

pgfkeys strips braces from argument

This is most likely a dupe of pgfkeys overeager in stripping away my braces If I pass {[[To]], [[From]]} to a macro as the value of an optional argument using pgfkeys, the outermost bracket is ...
Faheem Mitha's user avatar
  • 7,838
0 votes
1 answer
102 views

How can I define this new math mode environment with comma-separated keyval options?

My MWE using LuaLaTeX: \documentclass[oneside,DIV=12]{scrbook} \usepackage{scrhack} \usepackage[automark]{scrlayer-scrpage} \usepackage[english]{babel} \usepackage[babel]{microtype} \usepackage{...
Farrel Ahmed's user avatar
1 vote
2 answers
72 views

pgfkeys - is choice + value pass to graphicx

I'm trying to implement a macro which is a wrapper over the graphicx \includegraphics command (because I'd like to pass the parameters for cropping in a key-value fashion). While doing so, at first I ...
atticus's user avatar
  • 587
1 vote
1 answer
112 views

listings lstdefinestyle not work with custom defined command

I defined a new command named '\showLineNo', and used in '\lstdefinestyle', got an error: Package Listings Error: Numbers none unknown. \lstset{style=customstyleone} sample code: \documentclass{...
Art Journey's user avatar
0 votes
2 answers
48 views

keyval first pair not shown

How to change the following so the name1 and caption1 is also used - not only the second pair of keys: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{keyval} \makeatletter \define@...
guest's user avatar
  • 1

1
2 3 4 5 6