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

learn more… | top users | synonyms

0
votes
0answers
22 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
217 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
46 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 ...
1
vote
2answers
849 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} ...
2
votes
0answers
26 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} ...
39
votes
4answers
2k views

How to create a command with key values?

I am trying to create a command that the user can enter keys for values. How can I create one, for example: \myparbox[width=50,height=10,color=blue, align=left -10px]{}
3
votes
1answer
46 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 ...
5
votes
1answer
106 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
89 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
56 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
30 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
55 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 ...
4
votes
1answer
126 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 ...
6
votes
0answers
58 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
100 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} ...
5
votes
1answer
61 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
92 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
68 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
78 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 ...
17
votes
2answers
223 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 ...
4
votes
0answers
61 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 ...
8
votes
2answers
113 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 ...
4
votes
3answers
936 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
0answers
75 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 ...
5
votes
2answers
120 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 ...
6
votes
2answers
107 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
217 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
74 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 ...
5
votes
2answers
771 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 ...
4
votes
1answer
53 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} ...
3
votes
1answer
112 views

Passing arguments to a .sty-file - a specific case

After having plowed through (i.e. read and trimmed down the given examples in an attempt to apply them to my case) these documentations and guides: Implementing key-value input: An introduction The ...
11
votes
2answers
217 views

How can I define a new minted environment with optional arguments?

I have the following mwe: % arara: pdflatex: { shell: true } % arara: pdflatex: { shell: true } \documentclass{article} \usepackage{minted} \usepackage{listings} \usepackage{caption} ...
9
votes
1answer
108 views

Expandable, very specific keyval processing

I am having a hard time trying to come up with an fully expandable keyval parsing macro which deals only with specific keys/values. I wouldn't even attempt this in full generality, that's way beyond ...
3
votes
1answer
57 views

Add key for new Listings environment

I'm trying to add a new key to a custom listings environment. I have tried to modify this example. My problem is that the value I am attempting to pass through in the document for the key does not ...
5
votes
1answer
87 views

Keycommand package - \commandkey{mykey} doesn't expand

UPDATED, see edit history for completeness I'm trying out the keycommand package but it's not working as expected. There seems to be some incompatibility with tables, but I've read and re-read the ...
21
votes
4answers
357 views

Does the order of specified key-values matter?

The following screen shot shows how the order of specified key-values affects the output. When using dx=\psPiH,xunit=\psPi. When using xunit=\psPi,dx=\psPiH. Minimal Working Example ...
1
vote
1answer
84 views

How to expand keyval options immediately

I am trying to build up a macro that creates other macros depending on kvoptions' options. But then, the outcoming macros are dependent on the actual state of the options instead of their state at the ...
8
votes
2answers
372 views

Pass named arguments to macro

I notice that includegraphics takes what seems to be named arguments: \includegraphics[width=50,height=25,trim=1 2 3 4,clip]{an_img.png} I'd like to wrap a number of my includegraphics calls in a ...
6
votes
1answer
127 views

Forcing macro expansion with keyval

While trying to provide an answer to this question, I've run into a stumbling block that I can't seem to get over. The listings package (like many others) uses keyval to handle configuration. What ...
2
votes
1answer
114 views

xkeyval's \presetkeys

Please is there a way to avoid xkeyval package bombing out in endless loop, as implied by the following simplified case? \documentclass{article} \usepackage{xkeyval} \makeatletter ...
26
votes
1answer
2k views

How can I make a package that accepts an optional argument?

I am writing a package that has a bunch of values that are going to be the same most of the time, but that I might want to change in select cases. I want to do this by giving this package an optional ...
3
votes
1answer
142 views

Filter exercises according to their difficulty

This is somehow a follow-up question after this question. I came across this problem when writing the answer, but I was wrong when I thought I would easily be able to get this to work later. Shame. ...
3
votes
1answer
209 views

How to define package options in a command (for reuse)?

I need some options of the listings package several times in my document. I am thus wondering if one can define (and later change) these options once somewhere in the preamble via a command/macro, for ...
1
vote
0answers
45 views

How can I pass class/package options with spaces in values? [duplicate]

Possible Duplicate: Spaces in pfgopts options I have read Joseph Wright's excellent article on key-value systems, as well as questions on this site about how to pass arguments to class ...
7
votes
2answers
230 views

Filtering options with pgfkeys

I am looking for an example of how to get pgfkeys to split a list of options so that: (1) some of the options are processed now, and (2) the rest of the options are passed to a second macro for ...
41
votes
17answers
2k views

A big list of every keyval package

I lose track of all the different keyval packages. Can we maintain a list here? (Community wiki, one package per answer with a brief description of scope. I've started things off but need help ...
8
votes
3answers
177 views

More complicated key definitions in loops/for each statements

While writing a package with a key-value interface, I had a lot of repetitive key definitions. Naturally, one would like to express these definitions with a loop. When the definition contains ...
7
votes
1answer
195 views

Choice keys and exception handling

Recently, I switched a self-written "bundle package" from using xkeyval to keyreader. One reason for this, beside the backward compatibility, was that the definition of keys is more convenient in ...
3
votes
1answer
416 views

beamerposter custom style with keyval definition

I'm creating a beamerposter style accordingly to my department specification. I would like to create a theme where the definitions of the blocks can vary accordingly to a keyword in the calling of the ...
13
votes
3answers
2k views

A package template using xkeyval?

I would like to write a package offering a number of commands. The package should accept options, and some of these options should be available as command options. Usage should be as follows: ... ...