{key-value} is about packages and macros using the `key=value` syntax for named parameters instead of numbered parameters.
33
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 ...
25
votes
3answers
1k 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]{}
18
votes
1answer
1k 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 ...
11
votes
3answers
1k 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:
...
...
7
votes
3answers
458 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
...
5
votes
2answers
1k 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 ...
4
votes
2answers
750 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 ...
8
votes
2answers
154 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?
...
11
votes
1answer
203 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?
8
votes
3answers
204 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 ...
5
votes
2answers
127 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 ...
3
votes
1answer
43 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 ...
8
votes
3answers
163 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
308 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 ...
4
votes
1answer
148 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 ...
3
votes
2answers
240 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 ...
2
votes
2answers
113 views
How to assign a key of a package a key value of another package?
Scenario 1
Actually I can do like this:
In mylistings.sty, I define
\def\tabsize{3}
\RequirePackage{listings}
\lstset{tabsize=\tabsize}
and in mytable.sty, I define
\RequirePackage{mylistings}
...
1
vote
1answer
37 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]------\/
...

