# 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 completing it.)

-
This should be converted to a TUGboat article. –  Martin Schröder Aug 28 '11 at 20:24
@Martin — as soon as we'd do that someone would write another one! :) –  Will Robertson Aug 29 '11 at 0:26
i'd second what @will says: i constructed a list, but in two months, two more (getoptk -- a slightly weird thing, and ltxkeys) have appeared. –  wasteofspace Aug 30 '11 at 21:14
Why are there (more than) 13 keyval packages anyway? –  You Dec 30 '11 at 8:43
See also the survey article tug.org/TUGboat/tb30-1/tb94wright-keyval.pdf –  Christian Feuersänger Dec 30 '11 at 11:04

# pgfkeys.sty, part of PGF/TikZ

Author: Till Tantau

-
I marked this entry up---it also counts for adding the other entries:-) –  Marc van Dongen Dec 30 '11 at 9:23

# kvoptions.sty

Author: Heiko Oberdiek

Supports keyval processing of package/class options.

-

# keyval.sty

Author: David Carlisle

The original and (probably) most widely used keyval package. Provides \define@key and \setkeys but all processing for special key-types must be done manually.

Removes one or two layers of braces around each "val".

Note: this package can have scope problems with nesting \setkeys. Nowadays I'd recommend a more modern alternative.

-
The keyval package strips off 2 levels of outer brace: one by using the space trimmer \KV@@sp@def and one in internal parsing. –  Ahmed Musa Dec 31 '11 at 1:54

# l3keys.sty, part of expl3

Author: Joseph Wright (through the LaTeX3 Project)

Inspired by pgfkeys.

Use l3keys2e to use it in options of LaTeX2e packages and classes.

-

# xkeyval.sty

Cannot be loaded before \documentclass.

Note: in the past controversial because it overwrites keyval's \setkeys macro and in some cases caused (long-standing) incompatibilities. But I believe any problems resulting from this are now fixed.

-
The xkeyval package strips off precisely 3 levels of outer braces in key values: one by using keyval’s space trimmer \KV@@sp@def and two in internal parsing. The keyreader package addresses this problem. Another problem with the xkeyval package is that its \setkeys command doesn't accept unbalanced conditionals. For example, \setkeys[KV]{fam}{key=\iffalse} fails. The next release of keyreader addresses this problem in its \krdsetkeys command. The selective sanitization scheme of xkeyval also appears unduly expensive when there are active commas and equals sign in key-vals. –  Ahmed Musa Dec 31 '11 at 2:05
Much of the reported incompatibility issue with xkeyval's \setkeys seems to have disappeared, even for keys defined by David Carlisle's original \define@key. kvsetkeys package later replaced its \setkeys with \kvsetkeys. –  Ahmed Musa Dec 31 '11 at 2:14
Is there any particular reason why it can't be loaded before \documentclass? –  kahen Mar 5 '12 at 17:48
Yes, by design. xkeyval needs to know the documentclass options for inheritance purposes. Not sure from a technical standpoint, though, why it can't pick them up along the way; haven't looked into the details recently. –  Will Robertson Apr 8 '12 at 2:05
xkeyval.sty (not xkeyval.tex) needs the \@classoptionslist macro for (1) filtering =<value> from the class options list and (2) for class and package options processing with \ProcessOptionsX*. The keyreader packages delays the search for \@classoptionslist and the actions mentioned at (1) and (2) above until \documentclass was instantiated later by the document. –  Ahmed Musa Nov 8 '12 at 15:06

# kvsetkeys.sty

Author: Heiko Oberdiek

-
kvsetkeys only sets keys; it doesn't define them. It strips one level of outer curly braces in key values. –  Ahmed Musa Dec 31 '11 at 2:20

# scrbase.sty

Author: Markus Kohm

It’s part of KOMA-Script and documented in scrguien.pdf (english) and scrguide.pdf (german).

I never used it my self so I can’t say more about it …

-

Author: Ahmed Musa

The package provides a robust interface to controlling keys in xkeyval, removing some of that package’s restrictions.

-
@AhmedMusa: done! –  Gonzalo Medina Jan 2 '12 at 17:33
Also, this page is supposed to be comprehensive. It makes no sense to remove an entry! I've added skeyval below. –  Will Robertson Jan 29 '12 at 21:09

# pgfopts.sty

Author: Joseph Wright

Allows pgfkeys processing to be performed on class or package options.

-
It's not really a keyval package :-) –  Joseph Wright Aug 28 '11 at 16:46
Counts for me :) –  Will Robertson Aug 28 '11 at 16:50

# keycommand.sty

Author: Florent Chervet

-

# pgfkeyx.sty

Author: Ahmed Musa

From the package description:

The package extends and improves the robustness of the pgfkeys package. In particular, it can deal with active comma, equality sign, and slash in key parsing. The difficulty with active characters has long been a problem with the pgfkeys package.

With any luck, this facility can be merged into the main code of pdfkeys directly. Unless this robustifying is too resource intensive, I supposed.

-
The integration of pgfkeyx with pgfkeys was suggested by the author of pgfkeyx. pgfkeyx is not any significantly more resource-intensive than the original pgfkeys. –  Ahmed Musa Nov 8 '12 at 15:15

# skeyval.sty

Author: Ahmed Musa

The skeyval package provides commands for compactly defining and initializing all types of key (ordinary, command, boolean, style, choice, etc). It attempts to combine the features of ltxkeys package (which has the syntax of the xkeyval package) and pgfkeys package. See Possibility to pass options to packages.

-

# keyval2e.sty

Author: Ahmed Musa

This was meant to be lightweight, with no facility for options processing.

-

# ltxkeys.sty

Author: Ahmed Musa

ltxkeys, unlike keyreader, is completely independent of xkeyval and provides many more features. It can be loaded before \documentclass.

-

# skeycommand.sty

Author: Ahmed Musa

Superceded by ltxkeys.

-
Much of the functionality of skeycommand has been moved to ltxkeys, as indicated in the sub-title of skeycommand documentation. But my recent experience shows that it's nearly impossible to abandon a package, once it has been released to CTAN. It will resurface somewhere someday. –  Ahmed Musa Dec 30 '11 at 8:31

yax.tex

Author: Paul Isambert

Part of the author's collection of plain tex/generic packages.

Looks nice, but I've never used the macros. Syntax highly eccentric, as viewed by a latex user...

-

# rkeyval.sty

Author: Michael Downes

Keyval syntax is restricted in a sense that options must always be surrounded by braces.

-