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

learn more… | top users | synonyms

4
votes
1answer
29 views

When are {} needed to surround a string in a keyval pair

I am using the package kvoptions and declaring various stringoption's. When do you need to embrace a string value when calling your package/class? E.g. In mypackage: ...
3
votes
3answers
56 views

Integer padding with something other than a zero

Consider the following example: \documentclass{article} \usepackage{siunitx,collcell} \sisetup{minimum-integer-digits=4} \begin{document} \begin{tabular}{S} {Header} \\ 1234 \\ 234 \\ 34 \\ 4 ...
7
votes
3answers
92 views

Defining default arguments for a macro?

Quick question, is there a way to define default arguments for a macro? For example, I have a page filled with these: \TextField[width=2cm,height=10pt,bordercolor=stuff]{Question 1} ...
3
votes
0answers
62 views

Beamer frame: add user options

I would like to add 2 more user options to \frame command. However, when calling \frame with both parameters at the same time in a specific order (the one with implicit value first), it generates an ...
1
vote
1answer
191 views

Unable to install keyval.sty

I have a minimal TeX Live installation in ~/texlive/2014. I was trying to install keyval.sty using tlmgr. So, I tried, tlmgr install keyval But it gives an error: tlmgr: package repository ...
1
vote
2answers
96 views

refstepcounter in tcolorbox option

I want to increment a counter and update the current label in the phantom key of the tcolorbox environment, but it is not working, as can be seen in the example below: \documentclass{article} ...
6
votes
1answer
58 views

How to pass figure position to keyval macro?

I want to wrap a macro around figure-env to make my document more readable. Here is minimal example of how it is now: \documentclass[10pt,a4paper]{article} \usepackage{keyval} \makeatletter ...
4
votes
1answer
46 views

pgfkeys computed (i.e., dynamically defined) key

I would like to perform some simple simulation in latex/tikz (in order to produce dynamical graphs). Say something like cellular automata, Ising model, etc. I need to store somewhere the value of ...
0
votes
0answers
51 views

Prepend and append options to options list in environment

I need to define a macro superenv that expands to the usage of an environment which accepts key-value options. superenv should have three arguments: the environment name, the list of options, and the ...
2
votes
0answers
35 views

Filtering key-value options

I want to define a new environment whose implementation depends on another environment. The first environment should accept a list of key-value options. Some of these options are for use only on this ...
3
votes
1answer
40 views

Accessing sub/keys with l3keys

I'm not sure if I'm taking it too far, but I think I've seen something like this around. This gives an error: \documentclass{scrartcl} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand \RULE {} ...
3
votes
1answer
52 views

How to add another optional option to the “printglossary” command?

I'm using the glossaries package to introduce my terms in my book. Now I want to add another option to the printglossary command named "column" as below: ‎‎‎\printglossary[‎‎column=X]‎% which X is ...
7
votes
1answer
202 views

Reading - and effect - of (default) tikz/pgf keys?

Consider the following MWE: \documentclass[varwidth,tightpage,border=1bp]{standalone} \usepackage{tikz} \pagecolor{yellow!15} % ignored with preview, but not w/ varwidth \begin{document} ...
2
votes
1answer
212 views

Backward compatibility of Beamer problem - Keyval error

I'm stuck with a problem for compiling a "not so old" beamer document I've made last year, and it seems that there is a big problem of backward compatibility between my new version of beamer (3.33) ...
5
votes
2answers
132 views

How can I force lstlisting to expand an argument?

I'm trying to use the listings package with a variable language (it's actually for a package). However, I can't seem to pass a macro as the value half of a key-value pair. Here's a simple example: ...
1
vote
2answers
588 views

Package keyval Error: sorting undefined

Even at the risk of being this question closed as too localized or a duplicate of this, I feel that it is relevant for people like me, using XeLatex and Biber for the first time... I am using Adrien ...
5
votes
3answers
235 views

\newcommand for tabular entries using keyval

I am trying to define a command for tabular entries using keyval. \documentclass{article} \usepackage{keyval} \makeatletter \define@key{tabularEntryKeys}{a}[\dots]{#1 & } ...
6
votes
1answer
92 views

Use choice key with choices setting booleans

When defining choice keys with l3keys2e there are two possible ways and I use the one with sub-keys in a new package. When defining watch each value should do interface3.pdf says that I can use .code ...
9
votes
1answer
137 views

xkvltxp gives keyval error in case of biblatex's options on multiple lines

A keyval error arises if both: xkvltxp is loaded biblatex is loaded with options on multiple lines. The following MWE shows this strange behavior: \documentclass{article} % \usepackage{xkvltxp} ...
3
votes
1answer
77 views

Error while using 'author' option in 'todonotes' package

I am trying to use the author option in the \todo command provided by todonotes package. This is clearly mentioned in its manual. Following is the code snippet and the error it produces: Snippet: ...
2
votes
1answer
123 views

How can I change the syntax of showexpl's graphic key?

I'm trying to rewrite the option graphic from showexpl package, I have reviewed the source code showexpl.sty but, fail to find the modification, the package use keyval (or xkeyval) and listings for ...
1
vote
0answers
932 views

basic beamerposter example, keyval error

I found a beamerposter example at this url: http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php The content suggests that a number of packages may be required, therefore, I use the ...
17
votes
2answers
242 views

Can I turn a collection of optional parameters into a macro?

I currently have several environments from mdframed that have a large number of options that are shared between them. The situation looks like \newmdtheoremenv[options0,options1]{env1}{Environment 1} ...
4
votes
1answer
93 views

Unrecognized key-values

I try to implement a personnal class using key-value options (I am a beginner in that field). For exemple, I would like to specify the language (for babel package) with an option "langue=xxx" with ...
2
votes
0answers
36 views

Remove key from style

Is it possible to create a key handler with the pgfkeys package that removes a key from a style? Here's a minimal working example: \documentclass[preview,margin=10pt,convert]{standalone} ...
3
votes
1answer
79 views

How to define a function with optional key-value arguments [duplicate]

I have setup a function called quickfigure which has the purpose of inserting a centered image with a one-line command: \newcommand{\quickfigure}[2] { \begin{figure}[H] \centering ...
6
votes
1answer
172 views

Key value options in combination with TikZ

I'm trying to create some TikZ commands that use key value options. Using the following link: How to create a command with key values? I was able to declare some commands, but now I'm stuck. As a MWE ...
9
votes
1answer
131 views

Working with keys instead of \def

I have looked around on TeX.SX and I have learnt a lot of things. One of the things I have not yet mastered is how to use the key=value function that packages like keyval or xkeyval offer or even ...
6
votes
0answers
121 views

Appending options to hyperref

I am trying to append options to hyperref inside a package (say append.sty) I'm writing. More precisely, in the package I load the hyperref package and I tune it: ...
2
votes
1answer
49 views

Mix value and key/value with xparse

Following an earlier question I switched to xparse. Now I am sitting in a compatibility trap and try to allow old and new stuff at the same time. The point of origin is the infamous macro with two ...
5
votes
1answer
90 views

pass to \geometry{} options using a macro - keyval error

MWE: \documentclass{article} \usepackage{geometry} \newcommand{\GeomOpts}{a4paper,vmargin={3cm,3cm}} \geometry{\GeomOpts} \begin{document} \end{document} Because of the braces in \GeomOpts its ...
8
votes
1answer
100 views

How to mimic LINQ's query method for macro's key-value?

Inspired by LINQ's query method, such as deck.Take(randomCount) .Where (card => card.Suit == "Hearts") .Skip(2) .Take(5) .OrderBy (card => card.FaceValue); The deck which is ...
5
votes
1answer
163 views

Forcing the first choice of an newtcblisting environment

I have created a new environment based on "tcblisting" from package "tcolorbox" is code (MWE) is as follows: \documentclass[10pt]{article} \usepackage{tcolorbox} ...
4
votes
1answer
135 views

How to hijack a key assignment to raise an event that triggers its event handler?

Whenever I invoke \degrees the definition of operator au (angle unit) will be updated. It is easily done by redefining the \degrees with \let and \renewcommand. So far so good. Now I want to create ...
5
votes
1answer
100 views

How to pass comma in value of a (xkeyval) comma separated list of values at \documentclass level?

At \usepackage level, xkeyval allows us to insert commas in value of a comma separated list of values: it is enough to enclose in braces the values containing commas. For instance, the following MCE ...
10
votes
1answer
100 views

How to dynamically give key names with expl3?

I have a property list which associate names with values name 1 -> value 1 name 2 -> value 2 ... I want to use names from the property list to dynamically create keys. The following code ...
5
votes
1answer
74 views

How to choose between arguments and keys when defining a macro

I would like to know if there are guidelines for package writers regarding the interface preferred for passing arguments to macros. Suppose I am writing a package for typesetting a titlepage. There ...
4
votes
2answers
112 views

Keyword command parameters with table (tabular)

I am trying to make a command with named (key-value) parameters to produce a table row. The reason is that table has more than 9 columns (command parameters) that will have position changed, be ...
1
vote
2answers
2k views

package keyval error: compat2 undefined

I am using MiKTeX 2.9, geometry v5.6. I am getting the following error package keyval error: compat2 undefined. The LaTeX code is attached here: \documentclass[phD,synopsis,a4paper]{iitmdiss} ...
4
votes
0answers
78 views

Difficulty getting pgfkeys to set my fontsizes as I want

I apologize that this isn't particularly short. I'm going through old code and refactoring. In the process, I'm running into various bugs in how I've written things. In this particular example, the ...
17
votes
2answers
294 views

When to use a regular .initial key or a .store in key?

The excellent pgfkeys package provides, among others, two kinds of keys: regular "value-centric" keys that can be declared with /.initial, and "macro-centric" keys are declared with /.store in. Here ...
8
votes
2answers
121 views

Is there a way to define starred variants for a keyvalue system?

I've created an environment for which various parameters are set through key values. Instead of creating a hornet's nest of various booleans, I would just like to have a slight variant form for some ...
5
votes
0answers
89 views

What are best practices when augmenting and building on the keys provided by someone else's package

The situation is one where I'm developing my own commands and environments which build on the commands and environments provided by another package: for ease of talking let's call this other package ...
4
votes
3answers
2k views

DeclareDocumentEnvironment: missing control sequence inserted — \inaccessible

I'm setting up a skeleton CV package for a friend for him to customize, and I'd like to make it as user-friendly as possible. To effect this, I'm using keyval and xparse. ...
5
votes
2answers
130 views

Can I refer to key value in general code?

Related: keyreader: How to save choice key value to a macro. I’m using l3keys2e, but I suspect this might not be the ideal way to go about what I’m trying to do. I’m building a private package ...
7
votes
2answers
143 views

Generate l3keys meta key from subkey

I’ve created a simple package with options settable via l3keys2e. I was able to figure out how to make the syntax \usepackage[format = international]{phone} work, but I’d like to make the syntax ...
8
votes
2answers
370 views

xparse and key value arguments

I'm trying to learn how to do macros. I want to use xparse as it seems the most powerful tool. I also want named arguments, as numbered arguments make me, as a programmer, uncomfortable. I had some ...
4
votes
2answers
84 views

Optional argument not getting set to \makebox through expl3 key assignment

The basic idea that I wanted was to create a key to pass a value that would inform \makebox how the contents of the box should be aligned. Big fail here. The intended contents of the \makebox are ...
4
votes
1answer
56 views

Bad interaction between keycommand and environ?

I suspect the keycommand and environ packages are not playing nicely together, because the following code gives an error. Can anybody explain what's going on? \documentclass{article} ...
9
votes
2answers
1k views

Simple example of pgfkeys

I'm struggling to get my head around the pgfkeys package. I currently use the keycommand package, which I find very easy to understand: it's just ordinary LaTeX commands with named rather than ...