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

learn more… | top users | synonyms

72
votes
2answers
13k views

Should \tikzset or \tikzstyle be used to define TikZ styles?

The PGF/TikZ manual states in section 12.4 Using Graphic Options, page 120 (v2.10), that TikZ styles can be set using: \tikzset{my style/.style={<tikz options>},...} However, in several ...
26
votes
2answers
704 views

How do I debug pgfkeys?

I'm sure if you're reading this question you are already familiar with my love for pgfkeys. However, it is absolutely impossible to debug: \tracingmacros is a total mess, with every key expanding to ...
13
votes
2answers
597 views

Is there a way to set a *global* key value using `pgfkeys`?

The simple answer to this question appears to be "No"; quoting from the pgf manual: The setting of a key is always local to the current TeX group. However, this is very annoying because it means ...
5
votes
3answers
430 views

How to submit a set of tikz command with pgfkeys?

I would like to send a serie of tikz keys to a tikz path with the pgfkeys interface. I succeeded with the following code but is there a simpler way to do that ? Can I do the same thing with something ...
16
votes
2answers
732 views

How to extract the value from a pgfkeys style element

Lets say I have defined some style: \tikzset{mystyle/.style={inner xsep=2pt, outer xsep=10pt}} Given the name of the style: How can I later get the (possibly overriden) value of one of its element, ...
9
votes
2answers
1k views

Simple example of pgfkeys

I'm struggling to get my head around the pgfkeys package. I currently use the keycommand package, which I find very easy to understand: it's just ordinary LaTeX commands with named rather than ...
17
votes
2answers
242 views

When to use a regular .initial key or a .store in key?

The excellent pgfkeys package provides, among others, two kinds of keys: regular "value-centric" keys that can be declared with /.initial, and "macro-centric" keys are declared with /.store in. Here ...
6
votes
1answer
696 views

Equal (=) sign within TikZ label

I was trying to use an equal sign within a TikZ picture as a subcaption of an inner TikZ picture for comparing two images. Here is my code: \documentclass{report} \usepackage{amsmath} ...
17
votes
4answers
1k views

Multiple TikZ keys with foreach

Playing around with pgffor, I'm trying to slightly modify an example from the TikZ/pgf manual: \path \foreach \x/\content/\style in {% 0/a/draw, 1/b/{draw,red}, 2/c/{circle,blue}, 3/d/draw% } ...
24
votes
2answers
747 views

Arguments for TikZ style

Motivation To put arrows inside of a TikZ path I have defined myself a TikZ style arrow inside. To make it even more portable I want it to take arguments like this \draw[arrow inside={pos = 0.1, end ...
9
votes
3answers
745 views

Optional arguments in pgfkeys?

I need an optional argument in a pgfkey? Something like the following: \pgfkeys{example/.code = (Argument: #2, optional argument: #1)} \pgfkeys{example=[other]{some}} should result in (Argument: ...
11
votes
1answer
302 views

How can I put “=” in a TikZ node label specified as an option

When I try to put an = symbol into a TikZ node label specified as an option (using label=), I get an error: Extra }, or forgotten $. Is there a way to specify = in such cases that I'm missing? ...
12
votes
5answers
320 views

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 ...
11
votes
2answers
320 views

Key that takes a list of other keys as argument and sets them

I would like to define a key, let's call it mystyle, which has several subkeys, like mystyle/A and mystyle/B, and I'd like to be able to choose which of these subkeys to set by calling mystyle=A, ...
6
votes
2answers
1k views

Complex objects in TikZ: pgfkeys scope and best practice

I try to define a reusable object in TikZ and run into some troubles. The following minimal working example shows the problem. \documentclass{article} \usepackage{tikz} %\usepackage{trace-pgfkeys} ...
13
votes
1answer
120 views

Which arguments of `\includegraphics` cannot be set beforehand?

From the documentation of the graphicx package: Most of the keyval keys used in the graphicx package may also be set using the command \setkeys provided by the keyval package. For instance, ...
9
votes
2answers
424 views

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, ...
31
votes
1answer
3k views

optional arguments to tikzpicture to set style globally

I can't get my head around how to get tikz and pgfkeys to do what I want. I would like to define a command which draws a little tikz picture. I'd like this command that would take optional keyval ...
24
votes
2answers
483 views

What is the correct way to get a pgfkey value?

This is my first foray into the pgfkeys package and I found the following behavior really odd. The Tikz/pgfkeys manual mentions two ways for setting key values: \pgfkeys{key=value} and ...
13
votes
4answers
256 views

How do you test whether a known key value has been set in pgfkeys

Using the .code handler to my keys and a private macro, I can easily test whether a key has been set when using pgfkeys. For example: \documentclass{article} \newcounter{mytestenvcounter} ...
12
votes
2answers
411 views

How to detect if option provided via \tikzset

I would like to be able to detect if a particular option has been provided via a \tikzset and issue a message based on that. The MWE yields: But once the conditional works (just a comment for ...
10
votes
2answers
9k views

Weird tikz/pgfkeys error while trying example from the tikz manual.

I am still learning to use tikz from the manual. I got an error for this code: \documentclass[twocolumn,english]{article} \usepackage{tikz} \begin{document} \begin{figure} \centering ...
5
votes
2answers
911 views

creating a fifo symbol with pgfdeclareshape

I'm compiling with: pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2011.7.8) pgf 2008/01/15 v2.10 (rcs-revision 1.12) tikz 2010/10/13 v2.10 (rcs-revision 1.76) ...
5
votes
3answers
1k views

Problem drawing Kiviat diagram

From this post, I started to play with TikZ/PGF to draw a Kiviat Diagram froma a file .dat Suppose to have two file table1.dat and table2.dat live these %table1 column1 column2 8.109115e-001 ...
8
votes
1answer
153 views

Avoiding `Dimension too large' and `ill-formatted floating point' errors in tikz

I am attempting to draw some pictures using tikz, with the decorations library, and am encountering a `Dimension too large' error. I have read the 20+ other questions/answers about this error, and ...
7
votes
2answers
84 views

Using LaTeX commands inside pgfplotsset

Is there any way to use LaTeX commands inside \pgfplotsset? For instance, the following code produces an error indicated in the \pgfplotsset line, whereas if one replaced \contents in the ...
4
votes
1answer
84 views

Spaces in pfgopts options

Is there a simple way to allow spaces in the options of a package using pgfopts to process them, which is local to that package i.e. I don't have to include some package in the main document before ...
14
votes
2answers
370 views

PGF Keys differences between .initial and .default

I am not too sure just by reading the manual as to the subtle differences between the .initial and .default PGF key types. Can someone explain and demonstrate the differences with a minimal example?
5
votes
1answer
384 views

How do you pass unknown keys as options to a TikZ picture?

I try to write a command that accepts options, using pgfkeys. Unknown keys are collected in a style, that I try to use as global options for a tikzpicture environement. A minimal example would be: ...
10
votes
2answers
873 views

Using pgfkeys as an argument to a macro

I would like to use pgfkeys in a macro but find the documentation a bit hard to get started with. The following code should illustrate the problem I am trying to solve: \documentclass{article} ...
8
votes
1answer
261 views

pgfmathprintnumber in bold and/or sans serif

I've set some pgfkeys such as precision=2 and use comma. Now I wonder how do I get the results of \pgfmathprintnumber{123.567} to be bold and/or sans serif? I thought this is easy, but everything ...
7
votes
1answer
1k views

Example on how to use pgfkeys and pgfopts for class or package

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 ...
6
votes
1answer
546 views

pgfdeclareshape with variable dimensions using pgfkeys

I am trying to define some shapes for TikZ using \pgfdeclareshape. I would like to use options to make their size adjustable, however I do not get it to work. This example compiles, but the size of ...
8
votes
3answers
312 views

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 ...
7
votes
2answers
213 views

Creating anchors in a shape with a \foreach loop

I was playing around with this question, and in particular tried to modify and expand the linked example. It works fine, but there is an error when I try to use a \foreach loop to define the different ...
6
votes
1answer
171 views

How to make a pgf default action create a different key

I know very little pgf, but I'm trying to learn...so bear with me (please). I would like to have a default action on a pgf path so that if I try to access any unknown key, without giving it a value, ...
4
votes
1answer
170 views

A list of pairs in pgfkeys

Having learnt a lot about the pgfkeys package as a result of my last question, I'm now trying to do some more adventurous things. Let's say I have a command called \blob, whose value is the ...
4
votes
2answers
333 views

new command, pfgkeys within pfgplots axis environment

I am trying to setup an command to create technical drawing dimensions (inspiration from Dimensioning of a technical drawing in TikZ). I would like to use pgfkeys for that, in order to pass multiple ...
4
votes
1answer
2k views

Problem with “Package pgfkeys Error”

I am trying to create a color box using tcolorbox package. source code is like this- \documentclass[11pt]{article} \usepackage[top=.5in, bottom=.5in, left=1in, right=1in]{geometry} ...
4
votes
1answer
827 views

Line with transparence changing with TikZ

I'd like to have a colored line that starts with transparent 100 and ends with trasparent, let's say, 30. I tried this code: \documentclass{standalone} \usepackage{tikz} ...
3
votes
2answers
307 views

Undefined control sequence \pgfmath@

Why does the following code give me this error message? Error ERROR: Undefined control sequence. --- TeX said --- \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@ l.28 \draw ...
3
votes
1answer
213 views

How to add text in a link tikzset

How to change tikzset the text is automatically added to the link \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{shapes,positioning,fit} \begin{document} ...
9
votes
1answer
905 views

Style to make axis tick label opaque

I would like to make a specific tick label have a white opaque fill around it, so that the a line does not cross over it. Ideally I would like to be able to specify exactly which tick, but do not ...
8
votes
2answers
372 views

Problems with pgfkeys

I'm trying to use pgfkeys to define commands with custom parameters, but I can't even get the example in pgfmanual to run: \documentclass{article} \usepackage{pgfkeys} \begin{document} ...
8
votes
2answers
117 views

Is there a way to define starred variants for a keyvalue system?

I've created an environment for which various parameters are set through key values. Instead of creating a hornet's nest of various booleans, I would just like to have a slight variant form for some ...
7
votes
1answer
228 views

Using one key to set another key (in pgfkeys)

When I make a TikZ picture, I sometimes use absolute coordinates, and when I do, I find Martin Scharrer's showgrid TikZ library very handy. (It lays "graph paper" underneath my canvas, and puts ...
6
votes
1answer
162 views

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 ...
4
votes
1answer
199 views

Pass a 3d coordinate via pgfkeys

I'm using 3dplot to draw in 3D. Now I want to define my own environment, called pose, that is supposed to be used inside a tikzpicture-environment. It should perform a coordinate system tansformation ...
4
votes
1answer
687 views

Style to make axis tick label opaque using “extra y tick” feature

This is a follow up to Style to make axis tick label opaque, where a suggestion was made to use the extra y ticks to specify special tick marks and use extra y tick style to apply a style to only ...
3
votes
1answer
347 views

Unsetting a PGF/TikZ key

Is there any possibility of “unsetting” a PGF/TikZ key? By “unsetting” I mean to remove the key from the list of keys and make PGF/TikZ behave as if it was never specified. To clarify, consider this ...