[Tex/LaTex] Example on how to use pgfkeys and pgfopts for class or package

pgfkeystikz-pgf

Is there a tutorial on how to create a package or class with pgfkeys/pgfopts that goes beyond this pdf? keyval.pdf

In particular I would be interested on how I can create package/class options and new commands that pass options to tikz-drawings (such as colours, line length/width, shape).

Best Answer

I assume you read the section of the pgf manual that documents pgfkeys. If you haven't, read it. Many times.

But knowing what the commands do isn't the same as knowing how to use them. Try looking at some source code for best practices. Maybe Christian Feuersänger's pgfplots package?

I'm trying to use pgfkeys for my packages, too, and I think the idea is to create a style for your objects and add your initial keys to those styles for defaults. Then if other keys are to change styles of other objects they can append to those styles.

Related Question