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

learn more… | top users | synonyms

3
votes
1answer
67 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 ...
1
vote
1answer
99 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 ...
9
votes
2answers
557 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 ...
7
votes
1answer
151 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 ...
5
votes
1answer
103 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 ...
2
votes
1answer
146 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 ...
3
votes
1answer
200 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
234 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
49 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
247 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 ...
7
votes
1answer
216 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
565 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 ...
8
votes
3answers
183 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 ...
8
votes
2answers
189 views

How to pass a macro as a value for a key?

I want to pass a macro to a showgrid key. The macro can be redefined later. Its possible values are top, bottom, false, true. The following MWE produces a blank page. How to fix it? ...
21
votes
4answers
372 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 ...
3
votes
1answer
281 views

Extract key-value pairs from a string

I want to extract key value pairs from a string. I need this to define a new glossary style and want to pass some additional information through a existing parameter. \newglossarystyle{meinglossar}{% ...
2
votes
1answer
328 views

newcommand key value

This is a completely noob question for LaTeX package writers. Could somebody share a piece of code or a MWE for the following situation. I would like to define a newcommand which will depend on the ...
7
votes
3answers
424 views

How to define a key=value that has an equivalent boolean value key

Assume you're defining a key=value align for some environment realign that you'll use in the following way: \usepackage{xkeyval}% http://ctan.org/pkg/xkeyval \newenvironment{realign}[1][] ...
9
votes
2answers
241 views

Key Value option in package

I trying to write a package, and I'd like to specify whether there should be colour or not. I'd like to do: \usepackage[color=false]{foo} and have this set \RequirePackage[color=false]{hyperref} ...
14
votes
2answers
387 views

PGF Keys differences between .initial and .default

I am not too sure just by reading the manual as to the subtle differences between the .initial and .default PGF key types. Can someone explain and demonstrate the differences with a minimal example?
3
votes
1answer
200 views

Iterate over all defined PGF keys

Is there a way to iterate over all PGF keys that have been defined previously? My idea is to capture the value of all keys in order to do Proper nesting of tikzpicture environments: Reset all PGF ...
6
votes
1answer
739 views

Using a macro as value of addtotoc in \includepdf

I would like to include pages from an external PDF file into my document, using the pdfpages package. The following works for me: \documentclass{article} \usepackage{pdfpages} \begin{document} ...
4
votes
1answer
70 views

How to make xkvview record keyreader defined keys?

Since keyreader is based on xkeyval i wonder if it’s possible to make it wokr with xkvview which comes with xkeyval. \documentclass{scrartcl} \usepackage{xkvview} \usepackage{keyreader} ...
2
votes
1answer
70 views

How to encapsulate a package to rename keys defined in it?

I use pst-eucl package and I am not so happy with the names defined for its keys (because the names are difficult to remember). I want to rename some of the keys for my own purpose by creating a new ...
4
votes
2answers
792 views

Environment in \NewEnviron style, with key-value parameters

I want to define an environment that read its content before processing (like \newEnviron from the package environ) but also that allows key-value parameters (like \newkeyenvironment from the package ...
3
votes
3answers
133 views

Set font with keyreader as package option

Im developing a package an use keyreader to define it’s options, but I fail to set a font as an option. \begin{filecontents}{myfonts.sty} \ProvidesPackage{myfonts} \usepackage{keyreader} ...
1
vote
1answer
265 views

keyreader: How to save choice key value to a macro

Why does a choice key not save it’s value to a macro as a cmd key and as the corresponding xkeyval \define@choicekey do? In the following example I have to define my@key manually by using the ...
1
vote
1answer
43 views

kprefix in \krddefinekeys seems to be not optional

Maybe I misunderstood something but the following example doesn’t compile with out a optional argument defining the kprefix \documentclass{article} \usepackage{keyreader} % [KV]------\/ ...
6
votes
2answers
152 views

Writing a macro with parameters

I'm trying to write a macro which should be able to do several different yet somewhat similar things. I thought that instead of writing different macros for every thing, I should be able to write just ...
2
votes
1answer
171 views

pgfkeys-values only in list of possible values

In the following example, the key formatting has the initial default value apmep. \pgfkeys{ /test/.is family, /test, formatting/.initial = apmep } I would also like that the value of the ...
2
votes
1answer
390 views

The definition of key default value by keyval package

For a key keya defined by \define@key{fam}{keya}[\def\y#1{#1}]{\def\x##1{##1x#1}} the keyval package uses \def\KV@def#1#2[#3]#4{% \begingroup\toks@{#3}% ...
1
vote
1answer
274 views

keyvalue with kvoptions and switch structure

I am using kvoptions for a key-value syntax. However I need a switch syntax for the evaluation. Since boolexpr is problamatic (see here) I use now the other solution of this question. However the ...
3
votes
1answer
175 views

difficulty with datatool + keyval

I want to define a command with key arguments, which stores something in a table with help of the package datatool. My attempt is : \documentclass[12pt]{scrartcl} \usepackage{keycommand} ...
4
votes
2answers
799 views

fontsize setting with newcommand and newlength

How do I set a \newcommand so that the field #1, which is calculated to be 1.2*#2 Optional? Something similar to the following commands, but that did not work. \documentclass{article} ...
3
votes
1answer
221 views

Font size as a key-value pair using pgfkeys does not work

I want to define a new environment whose contents can be typeset using a specific font family and size optionally specified as key-value pairs. For handling the key-value pairs I am using pgfkeys. Why ...
8
votes
3answers
819 views

How to write a class that accepts an optional key-value pair?

a user-defined class: \ProvidesClass{preview}[2012/12/15 v 0.01 class for creating a tight PSTricks diagram] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions\relax ...
4
votes
1answer
183 views

How do I use \ifcommandkey , or how do I check if a key was given?

I'm trying to create a keycommand with optional arguments, but I can't get it to work. I looked at Comparing an argument to a string when argument is a result of a command with etoolbox and although ...
46
votes
4answers
3k 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]{}
8
votes
3answers
225 views

How to use named variables with one environment

Just after there is one code which has been proposed to me in this site. Instead of using \begin{MyFrame}[1.5cm][2pt][1.3cm][blue][2][8ex], I would like to use something more friendly like ...
10
votes
1answer
2k views

Use \setkeys{Gin} to set default scale value doesn’t work

I’d like to make all my graphic a little smaller and tried to set the scale-value of \includegraphics globally with \setkeys{Gin} but while changing width works fine scale has no effect. ...
4
votes
2answers
368 views

Pass several comma separated TikZ options to a single keyval key

I'm still improving my answer to Need help creating a 3D cube from a 2D set of nodes in TikZ. One of the options should be to emphasize the edges of the cuboid. This would mean e.g. \draw[red, very ...
7
votes
1answer
432 views

How to access the value of a biblatex package option/key

Is it possible to access a value which is given as a bibliography option. For example if I have \usepackage[somekey=foobar]{biblatex} can I get the value (foobar) of somekey as a macro like ...
43
votes
17answers
3k 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 ...
7
votes
2answers
2k views

How to control enumitem's description list via leftmargin and labelwidth keys

I am trying to learn how to use enumitem's keys to adjust a description list. In this case, I would like to have my list items and description text both left aligned, but the description text should ...
1
vote
2answers
133 views

What are the advantages and disadvantages between these coding styles?

Some people use the following style setting { a=1 ,b=2 ,c=3 } and the other ones use the style below setting { a=1, b=2, c=3 } I use the latter style but I wonder ...
3
votes
1answer
137 views

LaTeX3: problem with .generate_coices:n after l3kernel update

I'd like to report an issue I encountered with the l3keys sub-package of l3kernel (Hope it is ok to be done here). The test code at the end produces the error ! Undefined control sequence. ...
0
votes
1answer
1k views

Help! How to get the PDF-File? Error & Warnings lead to no pdf-file

I have a big problem. I am writing my phd thesis and started to use latex recently. I developed some basic skills that helped out me most time. But at the moment I dont know how to solve the problem. ...
6
votes
2answers
1k views

TikZ: Track the bounding rectangle of created nodes (Storing values?)

In the main part of the tikzpicture I'd like to simply create blocks. So I need somewhere in theirs' style definition to perform tracking of their common bounding rectangle. I've tried to access ...
7
votes
1answer
811 views

Building keyval arguments using a macro.

I try to create the arguments for a package which uses keyval, with macro, but this does not work: Here is the demo code: \documentclass{minimal} \usepackage{listings} \lstset{language=Pascal} ...
15
votes
3answers
3k 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: ... ...