Questions tagged [pgfkeys]

{pgfkeys} concerns a flexible key management system in TikZ/PGF.

The tag concerns the pgfkeys package, part of . The package provides a flexible key management system like and systems but has useful extensions such as supporting styles and handlers.

For more details see the TikZ/PGF manual.

587 questions
21
votes
5 answers

What do the pgfkeys key handlers .get and .store in do?

When I need to retrieve the value of a key in a macro, I use the key handlers .get and .store in. Here is what is written in the pgfkeys documentation: Key handler key /.get= macro Executes a \let command so that macro contains the contents…
remjg
  • 2,486
18
votes
3 answers

The '.is if' handler of pgfkeys

Let us start with an example from the pgf manual, version 2.10, page 495: \pgfkeys{/flat world/.is if=theworldisflat} \pgfkeys{/flat world=false} \def\x#1{% code-A \iftheworldisflat Flat \else Round? \fi #1% } I have two questions…
Ahmed Musa
  • 11,742
14
votes
1 answer

Package pgfkeys Error: I do not know the key '/tcb/library/most'

I get the following error while compiling and the pdf is also not generated properly: ERROR: Package pgfkeys Error: I do not know the key '/tcb/library/most' and I am going to ignore it. Perhaps you misspelled it. The code which I compiled is…
subham soni
  • 9,673
13
votes
2 answers

Forbidding/requiring certain pgfkeys?

I have some commands whose named arguments are processed by pgfkeys \dog[breed=Labrador, name=Fido] \human[name=John, car owned=Porsche] How can I arrange that \dog[breed=Labrador, car owned=Rover] gives the error message Invalid key 'car owned',…
12
votes
3 answers

Is there a compact way to set the same default for multiple pgfkeys?

I want to set the same default value for multiple PGF keys, like in this case where both a and b have a default of 1: \documentclass{article} \usepackage{pgfkeys} \pgfkeys{ a/.code={a:#1}, a/.default=1, b/.code={b:#1}, b/.default=1 } % the rest…
David Z
  • 12,084
  • 7
  • 48
  • 65
10
votes
2 answers

Can pgfkeys deal with active comma?

When I tried to compile \begingroup \def\iden#1{#1} \catcode`\,=13 \catcode`\==13 \iden{\endgroup \pgfkeys{/my family/.is family} \pgfkeys{/my family/my keys/.cd, keya/.code=\def\mywidth{##1}, keyb/.code=\def\mydefault{##1}% }% } I…
Ahmed Musa
  • 11,742
10
votes
3 answers

What is the best way to alias a key using PGF Keys

I would like to be able to alias a PGF key to another name, is this possible and if it is, how do I do this? For example if I have defined a key as: \pgfkeys{path/ color/.store in=\color@cx } I would like have the ability to let "color" to…
yannisl
  • 117,160
10
votes
2 answers

Setting a length with a key to a TikZ node

I would like to create some split rectangles whose widths are defined by the length of a designated line. I would like to do this through a key such as…
A.Ellett
  • 50,533
10
votes
1 answer

How do I pass an unknown value to a choice key in pgfkeys?

Why is the parameter value not being passed to my code for the unknown key value here? \documentclass{article} \usepackage{pgfkeys} \makeatletter \def\ae@size{2cm} \pgfkeys{/ae/example/.cd, size/.is choice, size/small/.code=\def\ae@size{I am…
A.Ellett
  • 50,533
9
votes
4 answers

Save choice and execute later in pgfkeys?

Using pgfkeys, I would like to have a choice key which, rather than immediately executing some code when a value is selected, stores the selection somewhere and then later on demand I can execute the code associated with said option. An example…
Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169
9
votes
3 answers

How to know the status of a style? defined? empty?

mystyle/.style= {...} is perhaps used ? I would like to know how to verify if the style is really defined and in this case, I would like to know if the style is empty ? Is it possible to use \pgfkeysifdefined to get the first result ?
Alain Matthes
  • 95,075
8
votes
1 answer

How do you define a default choice in pgfkeys

I've found the question Default value for a key defined with pgfkeys which works fine. But I would like to define an .is choice key with a default value, and I can't seem to get things to work. I've tried something along the following…
A.Ellett
  • 50,533
8
votes
1 answer

pgfkeys: Store unknown keys in a command

Does pgfkeys have some some predefined handler to store unknown keys and their values in a command as a list? E.g. in the following example I would like to get a command which contains blub=1, bla=\textbf{2}. (I want to pass the unknown keys to…
Ulrike Fischer
  • 327,261
7
votes
1 answer

Default value for a key defined with pgfkeys

Hereafter is a simple macro with keys nom and prenom defined with `pgfkeys. \documentclass[a4paper]{article} \usepackage{tikz} \pgfkeys{ /test/pgf/.cd, nom/.store in = \nom, nom/.default = toto, prenom/.store in = \prenom, …
Ger
  • 2,720
7
votes
1 answer

Appending to a style that sets code with arguments in pgfkeys

I'm trying to create some templating infrastructure that heavily depends on pgfkeys' styles to easily customise the appearance of how some bits of text are typeset on my document. However, I've run into some problem when trying to append more…
Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169
1
2 3 4 5 6