Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
1  
Your link pointed to the draft version of a TUGboat article. Meanwhile, the definite version has been made publicly available, I've edited your link accordingly. –  lockstep Sep 3 '10 at 11:11
1  
The article was deliberately general: what the options do is more-or-less up to you. I was aiming at pgfkeys as a general system rather than being tied to Tikz. –  Joseph Wright Sep 3 '10 at 12:30
    
Well i guess if you can use it general, you can fairly easy apply it to tikz. However, I am not a programmer and I stuggle to get started. Since I am interested in the use with tikz I don't really want to get into keyval... –  Martin H Sep 3 '10 at 17:48
    
I'm intrigued that you want to write a package but not have any programming. Can you explain the general plan: this would help with a good answer. –  Joseph Wright Sep 3 '10 at 19:52
    
Don't get me wrong, I just meant that I don't have a degree in programming/computer science. I use LaTeX for severals years now and I can write bits of C code Matlab and VBA... The idea in my head is to create something like a class or package for a CV. I find moderncv ok, but I think the design could be better/more adjustable and I thought it could be done with tikz quite nicely. –  Martin H Sep 3 '10 at 21:35
show 3 more comments

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
To avoid this comment getting lost below the OP, I'll post it here: I just posted an example at tex.stackexchange.com/questions/185975/… –  sdaau Jun 21 at 21:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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