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.)

17 Answers 17


pgfkeys.sty, part of PGF/TikZ

Author: Till Tantau

|improve this answer|||||
  • I marked this entry up---it also counts for adding the other entries:-) – user10274 Dec 30 '11 at 9:23


Author: Heiko Oberdiek

Supports keyval processing of package/class options.



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.



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


Author: Hendri Adriaens

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


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: Heiko Oberdiek

|improve this answer|||||
  • 2
    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


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
  • @Ahmed — your comments should be additional answers on this page! – Will Robertson Jan 29 '12 at 21:04
  • 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


Author: Joseph Wright

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



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...

|improve this answer|||||


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
  • Is this package still needed or has it been integrated? – cfr Sep 21 '17 at 22:07
  • The two packages probably still differ I'd guess. Perhaps @JosephWright knows more? – Will Robertson Sep 22 '17 at 12:58


Author: Florent Chervet

|improve this answer|||||


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.



Author: Ahmed Musa

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



Author: Ahmed Musa

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



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


Author: Michael Downes

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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.