2022 Developer Survey is open! Take survey.

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
0 votes
1 answer
49 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{...
user avatar
1 vote
2 answers
31 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 ...
user avatar
  • 393
1 vote
1 answer
29 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{...
user avatar
0 votes
2 answers
45 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@...
user avatar
  • 1
3 votes
1 answer
75 views

How can I parse a clist into a keyval prop?

I'm trying to store a comma-separated list into a key-value property to use it later, but I can't get it to work properly. I don't really understand how latex parses a keyval parameter but my guess is ...
user avatar
  • 35
0 votes
2 answers
61 views

Check if key is set in xkeyval

I am working with the xkeyval package. Sometimes I want to check by hand if a key is contained in a list of keys. That is, I want a if-command like the following: \contains@key{<family>}{<key ...
user avatar
  • 83
0 votes
1 answer
49 views

Changing some options in \newgeometry while retaining all others by default

I have a document whose preamble says something in this style: \RequirePackage[a=3,b=7]{geometry} Later in the document I want to temporarily change one parameter, i.e., in pseudocode: \newgeometry{...
user avatar
1 vote
1 answer
39 views

Class with keyval option consisting of lists of keyval pairs

I'm trying to figure out how to write a class that would allow for a key-value option where the key is called people, which would take a list of grouped key-value pairs (e.g., name, title, and role) ...
user avatar
2 votes
4 answers
51 views

How to pass the value of a command for a key (xticklabels and yticklabels of an axis environment for pgfplots)

I have a square matrix plot with identical x and y ticks and tick labels, for which I hope to use a pre-defined command to avoid repeating xticklabels and yticklabels with the same value "{A, B, ...
user avatar
  • 21
4 votes
2 answers
97 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} \...
user avatar
3 votes
2 answers
110 views

Conditional title in tcolorbox: not equivalent to an untitled box when empty

Consider the following code : \documentclass[10pt]{article} \usepackage{ifmtarg} \usepackage{xcolor-material} \usepackage[most]{tcolorbox} \makeatletter \newcommand{\makeboxtitle}[1]{\@ifmtarg{#1}{}{\...
user avatar
  • 4,263
1 vote
1 answer
27 views

Passing a command as option in pgfkeys

I want to pass a command as an option, so that the command is applied to the argument, something like \PrintSomething{opt = \makebox[5cm]{\textbf{\sffamily #1}}}{Hello} which should produce the word ...
user avatar
1 vote
1 answer
75 views

Get one value from a pgf/tikz style

Considering \pgfkeys{ A/.style={ key=value, key2=value2, } } how do I retrieve "value" from "A" and "key"? After some experiments, next seems to work for at ...
user avatar
3 votes
1 answer
57 views

Using definitions for key-val arguments

I'm making a \logo command like the \title command used for the title page. By default, I would like to use the graphbox smash key-val arg to be tl. But later on (depending on a users choice, say by ...
user avatar
3 votes
1 answer
77 views

Getting the package options as a lua string, and allow arbitrary package options

I am making a lualatex-based class, which will be a thin wrapper around a lua library. I would like to use the luakeys package to process my options in lua, and would like to avoid declaring options. ...
user avatar
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 ...
user avatar
  • 11.1k
0 votes
1 answer
90 views

Is there an equivalent of datatool's \DTLifhaskey for value?

I'm looking for a way to test if a (non-key) value in a column does exist. I basically want to check if \DTLfetch{db name}{col1 name}{col1 value}{col2 name} is giving me a value from the db or an '...
user avatar
1 vote
1 answer
159 views

noframenumbering in Metropolis' standout frames

I would like to make it optional to exclude the standout frames from the beamer theme Metropolis from the frame count. This works as long as I write my frame options as noframenumbering, standout. But ...
user avatar
  • 558
0 votes
1 answer
72 views

Is it possible to define key macros without the equality sign (i.e., [keya=value])

I was wondering if the xkeyval package allows for defining key macros which do not include an equality symbol. For instance, I wish to create a package based on the geometry package with the following ...
user avatar
  • 335
2 votes
0 answers
75 views

The 'inverted' attribute is not recognized if a \DefineName abbreviation is used in an AMSRefs \bib entry

In Section 8.1 of the AMSRefs package documentation, it is explained that to properly typeset author names that are to be written with the family name first, one should set the attribute inverted on ...
user avatar
0 votes
2 answers
41 views

Entering ten authors in an AMSRefs \bib entry using \DefineName abbreviations throws an rkeyval error

I am using the commands \DefineName, \DefineJournal and \DefinePublisher to use abbreviations in my bibliography along the lines mentioned in Section 8.4 of the AMSRefs package documentation. Now, I ...
user avatar
0 votes
3 answers
91 views

How to construct a macro with key=value by \pgfkeys

I just learn \pgfkeys, but don't quite understand how to use it for making a macro with key=value options. I'd like to give the following simple example as a practice to show my idea. \documentclass{...
user avatar
  • 2,213
1 vote
2 answers
43 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% \...
user avatar
  • 1,868
1 vote
1 answer
40 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 ...
user avatar
  • 3,469
3 votes
1 answer
108 views

How to pass key=value pairs expanded from a defined macro to a keyval-based macro?

I would like to define a simpler alias for \includegraphics using this synthax : \Img[width x height][other_opts]{filename} ...wich would be equivalent to : \includegraphics[width=width, height=...
user avatar
  • 259
6 votes
3 answers
157 views

Fill a tabular from a key value command

I'd like to build a tabular from a command with keys/values, values being themselves a set of keys/values (or a list). If the key is not defined, no entry added in the tabular. For now here is what I ...
user avatar
  • 3,469
0 votes
1 answer
40 views

Using passed value as the name of a control sequence with pgfkeys

I have the following family of options \pgfkeys{ /opts/.is family, /opts, name/.store in = \@@Style@Name, property/.code = { \expandafter\gdef\expandafter\csname @@Style@ \@@...
user avatar
2 votes
2 answers
142 views

Why does pgfkeys .initial not work in these cases?

I think I finally have a reasonable understanding of pgfkeys, but initializing a key with or without the .initial handler is giving me trouble. I do understand the distinction between .default and ....
user avatar
1 vote
2 answers
165 views

Is this a correct way to handle Boolean options?

In trying to get a better understanding of kvoptions I have the following minimal example package and document. In the package, I construct a new macro command based on the logical states of three ...
user avatar
3 votes
3 answers
150 views

Improve a keycommand macro

My question is about how to improve an already working macro via the keycommand package. The small inclusion shows my efforts so far: \documentclass{article} \usepackage[margin=0.95in]{geometry} \...
user avatar
  • 1,473
0 votes
1 answer
65 views

Can keyval and pgfkeys produce identical results?

I've spent about five hours (!) studying How to create a command with key values? (and other resources) and trying to understand how to implement key values and it's been extremely confusing. I have ...
user avatar
0 votes
3 answers
139 views

kvoptions not working in a package setup command

I have a short demo using kvoptions to provide package options at load time. I wanted to experiment with a package setup command and found that removing the options from the \usepackage{kvtest} ...
user avatar
1 vote
1 answer
69 views

pgfplots: Boolean key for a style does not work

I trièd to insert a Bool Title=true|false: \pgfplotsset{ %/pgfplots/.cd, % no effect Title/.is choice, Title/.style={title={A title.}}, } Why does Title, Title=true and Title=false not work ...
user avatar
  • 6,217
0 votes
0 answers
57 views

Use a simplekv variable with a newline inside makecell

MWE: \documentclass{standalone} \usepackage{makecell} \usepackage{simplekv} \usepackage{tabularx} \setKVdefault[test]{ kv1 = {Test 2 \\ Test 3}% } \useKVdefault[test] \begin{document} \begin{...
user avatar
  • 618
2 votes
1 answer
86 views

genealogytree: How to save database keys in a common key

Normally at a genealogytree node I have to say p[]{name=Jane, birth={2-2-1888}{somewhere}} How can I create a key, like persdata=JaneID which expands to name=Jane, birth={2-2-1888}{somewhere}, so ...
user avatar
  • 6,217
4 votes
3 answers
187 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}). \...
user avatar
1 vote
1 answer
58 views

pgfkeys: Different output depending on a keyword

I need an output like \cmd --> "S0" (output) \cmd[] --> "S0" (output) \cmd[map] ----> "S1 S2 S3" (output) \cmd[map=true] ----> "S1 S2 S3" (output) \...
user avatar
  • 6,217
1 vote
1 answer
104 views

Keyvalue-command: Add option for boolean key

I have a boolean key map that produces TikZ-stuff (right column) like I would like to have an additional key-option like map=red with which I can access the TikZ options, in the sense of \node[text=...
user avatar
  • 6,217
1 vote
1 answer
57 views

keyvalue-command: A Key changes Another

I have a keyvalue-command \cmd[map] that produces Now I need another key stepstrokes=true, that produces That means: Text of 'map' is gray now and the 'stepstrokes' overlay (and 'startpoints' or '...
user avatar
  • 6,217
1 vote
1 answer
73 views

expkv: Different output depending on a keyword

I need sth. like \cmd[map] ---> "S1 S2 S3" (output) \cmd ---> "S0" (output) or equivalently \cmd[map=false] ---> "S0" (output) Is this a key , boolTF ? What ...
user avatar
  • 6,217
2 votes
2 answers
99 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 ...
user avatar
2 votes
2 answers
60 views

Set value of \geometry keys from a macro

I am trying to set parameters of the geometry package via macros. For example \def\xxx{false} \geometry{twoside=\xxx} However the above command, nor \expandafter\geometry{twoside=\xxx} seem to work; ...
user avatar
0 votes
1 answer
59 views

Map multiple different key-value pairs to the same behaviour

I've been typesetting a competition paper using the exam class, which has options for nice headers and cover pages. Now, this competition has two different age categories, 'Junior' and 'Senior', and ...
user avatar
  • 488
6 votes
4 answers
207 views

Simple key-value example

I try to make just a very minimalist example of pgfkeys — or other keystyle parameters package —, with a command like this one: \mycommand{title="The new book", author="John Doe"} to get a behavior ...
user avatar
  • 2,080
1 vote
1 answer
151 views

How to use keyval option processing

I'm trying to make a command/environments with a view key value options similar to many other popular packages. I found description on how to use key value but the examples don't work. Anyway can ...
user avatar
  • 205
6 votes
2 answers
260 views

Trying to understand keyval.sty (specifically \KV@@sp@def)

I'm confused by the following macro definitions in keyval.sty (Version from 02/2020, Lines 65ff): \def\@tempa#1{% \long\def\KV@@sp@def##1##2{% \futurelet\KV@tempa\KV@@sp@d##2\@nil\@nil#1\@nil\relax#...
user avatar
0 votes
2 answers
225 views

apabackref error because of keyval (after updating to biber 2.14 and biblatex 3.14)

It seems that apabackref is in conflict with biblatex (version 3.14). I updated from 3.7 or so, where I had no problems. Probably the error is due to biber (version 2.14; if formerly used 2.7, I ...
user avatar
  • 89
0 votes
0 answers
924 views

Package keyval Error: number undefined

I am getting the following error in overleaf: /usr/local/texlive/2018/texmf-dist/tex/latex/geometry/geometry.sty, line 1007 Package keyval Error: number undefined. See the keyval package ...
user avatar
4 votes
1 answer
139 views

How to add more key to enumerate package

beamer class loads enumerate package that allow us to use key 1,a,A,i,I. In my purpose, I want to add two more keys called m and k for Khmer (Cambodian) numeral and alphabet respectively. My attempt ...
user avatar
  • 1,673
0 votes
0 answers
369 views

arXiv upload issue: Emergency stop [duplicate]

I see that there are a ton of posts related to this topic but none seem to address the issue I'm having. Apologies if I overlooked the post I should be looking at. As the title says, I'm uploading a ...
user avatar
  • 249

1
2 3 4 5