A guide to key-value methods

I have a second draft for TUGBoat on the go at the moment: an article on implementing key-value input. These are widely used in LaTeX packages, but are also usful in plain TeX. As well as the original keyval package, we have xkeyval, kvoptions and kvsetkeys for managing key–value input. However, actually getting started with these as a LaTeX programmer can be somewhat difficult. The aim of the article is to lower the barrier to getting going with key-value methods. As well as the keyval-based information, the pgfkeys package (part of the pgf bundle) is also covered (thanks to Christian Feuersänger).

4 thoughts on “A guide to key-value methods

  1. This was a amazing article to read. It gives a good overview and makes starting easier.

    For me as an beginner in this toppic, the interface of the pgfkeys package looks much more cleaner to use.

    Finnally, if i may make a proposal for the final article: I really liked the xmph example, it helped a lot to see all the commands »in live action«. Would it be possible to add the pgfopts package to the example, making it as functional as the first implementation? If i understand the documentation, one has to add basically the lines:


  2. Glad you liked it. I’d agree that pgfkeys is in many ways a better system: I’m planning to use pgfkeys for siunitx version 2.

    On the pgfopts part, this was added rather later than most of the text (which for pgfkeys was written by Christian). I’ll alter it a bit once I’ve had some comments back from TUG.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.