Questions tagged [pgfkeys]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
31 views

pgfkeys - is choice + value pass to graphicx

I'm trying to implement a macro which is a wrapper over the graphicx \includegraphics command (because I'd like to pass the parameters for cropping in a key-value fashion). While doing so, at first I ...
user avatar
  • 393
0 votes
1 answer
28 views

How to detect if one of the arguments of a key defined by \pgfkeys has been given value

I define a key test who has two arguments by /.code n args from \pgfkeys. Please see the code below. Now, I want to detect if #2 has been given a value, but causes error. So, my questions are: (1)How ...
user avatar
  • 2,169
5 votes
1 answer
97 views
+100

PGFPlots possible keys

The general structure of a plot is: \begin{figure} \centering ...
user avatar
0 votes
1 answer
44 views

How to set up an optional arg in pgfkeys

I wonder if there is any way in \pgfkeys of tikz to define optional arg(s) as the following code illustrate: Code: \documentclass[a4paper]{article} \usepackage{pgf,graphicx} \usepackage{geometry} \...
user avatar
  • 2,169
4 votes
2 answers
79 views

Adding a hook to the color keys in TikZ

Trying to solve pgf basic layer: struggling (again) with colors, I had an idea for a workaround (saving a state for circuitikz...). But although I know how to add a hook to the color= key, TikZ let ...
user avatar
  • 28.7k
1 vote
1 answer
37 views

How to fix the value of a key(or macro) when it gets value from another macro

The following code showes that the value of key constant changes with the macro \aaa. My question is: how to fix the value of key constant once it gets value from \aaa at the first time, so that both \...
user avatar
  • 2,169
2 votes
2 answers
70 views

Best way to check the value of a key (pgfkey)

I looked at Check-the-value-of-a-pgfkey but I don't feel like using etoolbox. I found a method but I am not sure it is the right one and I would like to find more concise. My problem is to test all ...
user avatar
0 votes
1 answer
39 views

How to manage argument pattern, keys (and subways ?)

I have two methods to draw an arrow on a segment but I would like to find a third more explicit one. 1) \draw[arrow scale=3,pos=.75,arrow=Stealth] (A) -- (B); 2) \draw[new arrow={.3}{3}{To}](A)-- (B); ...
user avatar
1 vote
1 answer
53 views

How to make a macro as the value of a key in \pgfkeys

I want to make a key by \pgfkeys whose value is a macro. But the following try fails. Please see my question in the code. \documentclass[a4paper]{article} \usepackage{xcolor,pgf} \usepackage{geometry} ...
user avatar
  • 2,169
1 vote
1 answer
29 views

How to make the value of a key in \pgfkeys change with another key?

In \pgfkeys, I want the value of a key(b in my following example) changes with another key(a in my example) wihout introducing a new macro. How to get it? Example: \documentclass[a4paper]{article} \...
user avatar
  • 2,169
0 votes
1 answer
25 views

Why is \pgfkeysnovalue not settable?

TL;DR Why is it impossible to set a key in pgfkeys to \pgfkeysnovalue? \pgfkeys{ /foo/bar/.initial=\pgfkeysnovalue, % ... % This will not work /foo/bar=\pgfkeysnovalue } Main question I have ...
user avatar
3 votes
1 answer
51 views

Possible bug in pgfmanual: pgfkeys with /.initial handler works not as expected

I am a bit surprised by the behavior of pgfkeys. To make my point clear, let me give you a MWE: \documentclass{article} \usepackage{pgfkeys} \begin{document} Output: \pgfkeys{ /foo/.initial=3, % /...
user avatar
2 votes
2 answers
49 views

How can I store colors to be reused later for pgf-pie charts?

I am trying to store a set of colors in the corresponding pgf key and then recall it later. However attempting to do this: \documentclass{standalone} \usepackage{pgf-pie} \begin{document} \...
user avatar
  • 4,286
5 votes
2 answers
77 views

Why pfgkeys don't redefine my command on default?

I'm doing this: \documentclass{article} \usepackage{pgfkeys} \pgfkeys{ /foo/.is family, /foo, a/.estore in = \bar, a/.default = bye, a } \newcommand\go[1]{ \pgfkeys{/foo, #1} \bar } \...
user avatar
  • 10.1k
2 votes
2 answers
107 views

Conditional clause with \ifnum and \pgfkeysvalueof{/data point/y}

I got the following problem. My aim is to build a barplot with tikz. Using a function to display the sum of the bars in a stacked ybar I want to add a superscript to one specific sum below the x axis. ...
user avatar
0 votes
1 answer
52 views

Using pgfkeys to create list of theorem environments defined by tcolorbox [duplicate]

I'm having trouble trying to get a list of various theorem environments I've created with \newtcbtheorem. After doing some digging, I found this answer from 2012 by @cmhughes: https://tex....
user avatar
0 votes
2 answers
58 views

Pass multiple keylists

I want to create a macro that will draw a complex shape with several parts (like a circle and a rectangle): \newcommand{\drawCircleAndRectangle}[1][]{% \draw[%my or default circle style props%] (0,...
user avatar
1 vote
1 answer
25 views

Passing a command as option in pgfkeys

I want to pass a command as an option, so that the command is applied to the argument, something like \PrintSomething{opt = \makebox[5cm]{\textbf{\sffamily #1}}}{Hello} which should produce the word ...
user avatar
0 votes
1 answer
75 views

Error Compiling Beamer Presentation

With due respect, my file having the following environment: \documentclass{beamer} \usepackage{beamerthemeshadow} \usepackage{graphicx} \usepackage{epsfig} \usepackage{subfigure} \usepackage{amsfonts} ...
user avatar
2 votes
1 answer
65 views

Tikz/pgfkeys, how to copy a style

In tikz/pgfkeys, how could I copy (like /styleA/*/.cp) all keys or a single key (like /styleA/colorA/.cp) inside a given path, say styleB in the current path, exactly like if I had copied all the keys ...
user avatar
  • 5,043
1 vote
2 answers
70 views

Passing #1 to \pgfkeys

I have the following setup to apply macros to certain data of a command: \makeatletter \def\myqu@rck{\myqu@rck} \pgfkeys{/mykeys/macro/.code=\mykeys@defmacro{#1}} \def\mykeys@defmacro#1{\mykeys@@...
user avatar
0 votes
1 answer
40 views

Define custom subtree macros in `forest`? [duplicate]

I am using forest to typeset some trees that contain many repetitive structures. For example: \begin{forest} [ [ NP [ N : \textit{John} ] ] [ VP [ V : \textit{ate} ] [ NP [ ...
user avatar
  • 195
0 votes
0 answers
40 views

Placing Nodes in a Path Picture [duplicate]

Unfavorably all thirteen ports of my rack switch are placed in the middle of the path picture on top of each other. How can i place the ports side by side like the numbers. \documentclass[tikz,border=...
user avatar
  • 49
0 votes
0 answers
49 views

Placing a fully defined picture absolutely at any point inside a path picture

The following example generates a rack switch with a single port. The front oft the rack switch is defined by a path picture. I add the port to path picture by using \node and i am placing the node ...
user avatar
  • 49
10 votes
3 answers
270 views

tikz pic custom keys

The example code below defines a tikz pic that displays an n-by-m grid of circles. It is called by using code like pic {grid={3}{5}} in a tikz path. However, when code like this starts to have a large ...
user avatar
  • 2,990
1 vote
1 answer
40 views

How to trick the macro \pgfkeys into not removing surrounding spaces from values that are put in braces?

I tried to use pgfkeys for providing keys' values that have surrounding space-tokens: \documentclass{article} \usepackage{pgfkeys} \pgfkeys{/WeirdKeys/weird/.initial=weird}% \newcommand\Weird[1]{\...
user avatar
  • 22.9k
0 votes
1 answer
31 views

pgfkeys not parsing equals (=) or comma (,) in assembled string of key/value pairs

This is a somewhat recherche question but you'll have to take my word for it that these toy examples have been extracted from something useful (to me). Everything is explained in the code below, but ...
user avatar
  • 83
2 votes
2 answers
38 views

How do I use pgfkeys .try handler for selecting a choice that could not exist?

The problem is the following: \documentclass{article} \usepackage{tikz} \def\cmd{0} \tikzset{/test/.is choice, /test/one/.code={\def\cmd{A}}, /test/two/.code={\def\cmd{B}}, } \begin{document} \...
user avatar
  • 28.7k
0 votes
1 answer
58 views

What is the problem with \node[red]{X}; in RTL context (xelatex)

This example on tikz node if I use \node[red]{x}; in math mode (RTL context) the node appears faraway unlike \node[color=red]{x};, I thought the two were equivalent In pgfmanual (Page 173) we can find ...
user avatar
  • 16k
0 votes
3 answers
89 views

How to construct a macro with key=value by \pgfkeys

I just learn \pgfkeys, but don't quite understand how to use it for making a macro with key=value options. I'd like to give the following simple example as a practice to show my idea. \documentclass{...
user avatar
  • 2,169
0 votes
1 answer
67 views

pgfkeys: Dynamic definition of keys

I want to define a list of keynames in a macro. Then I want to initialize multiple keys with this keynames. I've tried with \foreach, also with .list but the keys are never defined. But, nothing it's ...
user avatar
1 vote
1 answer
43 views

Set PGF anchor position in custom pgfshape with pgfkey as string?

How can I go about using a pgfkey to place an anchor if the key is a string? Previous answers imply that setting anchors based on keys is possible using numerical keys (like this question on Creating ...
user avatar
  • 45
3 votes
1 answer
56 views

Using pgfmath results in pgfkeys

I'm trying to create a simple variable system using pgfkeys, but I want to be able to create new "var" using other var, see this MWE where I have tried to use \pgfmathprintnumber. I thought ...
user avatar
0 votes
0 answers
41 views

“pgfkeys package error ” when doing a molecule (texmaker, linux)

The following code works fine when I run it on overleaf or texmaker for windows: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig[atom sep=2em]{*6(=-=-=-)} \end{...
user avatar
2 votes
1 answer
152 views

Plot factorial function in TikZ datavisualization

I'm trying to replicate this graph following the tips in this solution with TikZ datavisualization package (see Part VI). [edit] related question: How to make a figure showing growth of functions but ...
user avatar
1 vote
1 answer
77 views

Using pics/port/.style n args = {3} doesn't work correctly in \tikzset environment

In TikZ i use the pics/ command inside the \tikzset enviroment to define the picture port, which is a element of a network switch. As you can see, the call of picture port in line 34 an 38 requires ...
user avatar
  • 49
4 votes
2 answers
807 views

pgfkeys Error: I do not know the key '/tikz/green '

I want to set the fill-color of a rectangle depending on a number stored in a counter. This is my try: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\background}[1]{% \...
user avatar
  • 43
2 votes
1 answer
74 views

TikZ: update key value in family when calling style

I would like to run some code to decorate a node, and I would like to control that via a TikZ style. I would also like that tikz style to take some parameters, for example in the form mystyle={arg1=...
user avatar
3 votes
2 answers
173 views

Dynkin-diagrams package labels problem

i'm struggling with the labels of some biforcate dynkin-diagram my code is the following \usepackage{dynkin-diagrams} \begin{document \begin{center} \begin{dynkinDiagram} \dynkin[labels={m \cosh \...
user avatar
1 vote
1 answer
190 views

LaTeX CircuiTikZ I do not know the key '/tikz/tr circle'

I am learning LaTeX, and i was trying to follow some examples, and i came across this one from CircuiTikZ \begin{circuitikz}[] \draw (0,2) node[npn, tr circle](Q1){}; \ctikzset{transistor circle/...
user avatar
1 vote
1 answer
34 views

TikZ ignores temporary overridden macro value and uses the previous one

I'm racking my brains with the strange behaviour of this simple TikZ graphic: I have the following pgf keys: \tikzset{ the name/.store in=\nodename, the name=OLD, my node/.style={ ...
user avatar
1 vote
1 answer
32 views

Node that creates another one which reads its values dynamically

I'm trying to understand how the expansion of a \pgfextra which in turn is inside an append after command is done. My idea is to read some value from a pgf key when the append after command code is ...
user avatar
3 votes
2 answers
153 views

TikZ node parameter and pgfkeys

I am trying to pass some parameters to a node style and found an answer for simple cases: Is it possible to consider a single optional parameter among three in node declaration? However, I cannot ...
user avatar
  • 169
0 votes
1 answer
41 views

Should loading a package with no options behave the same as calling a macro with no options using pgfopts and pgfkeys?

This is a followup to my previous question Why does pgfkeys .initial not work in these cases?. In that question I created a macro with a key-value interface using pgfkeys and it works perfectly. Now, ...
user avatar
0 votes
1 answer
40 views

Using passed value as the name of a control sequence with pgfkeys

I have the following family of options \pgfkeys{ /opts/.is family, /opts, name/.store in = \@@Style@Name, property/.code = { \expandafter\gdef\expandafter\csname @@Style@ \@@...
user avatar
2 votes
2 answers
138 views

Why does pgfkeys .initial not work in these cases?

I think I finally have a reasonable understanding of pgfkeys, but initializing a key with or without the .initial handler is giving me trouble. I do understand the distinction between .default and ....
user avatar
0 votes
0 answers
35 views

Is inclusion of packages using absolute paths not supported anymore?

I used to import a custom package using an absolute path for years, but at some point during the last month this stopped working. I created this minimal example to reproduce the error. When I include ...
user avatar
  • 325
2 votes
1 answer
132 views

TikZ: create a button to show something or not

In some cases I create some (plenty of) buttons of the kind \def\myshow{1}% 1 'yes', '0' no and then \ifnum\myshow=1 .... \fi But I had to hear, this is not so correct. So: What is the correct ...
user avatar
  • 6,217
1 vote
1 answer
65 views

Parameterized pgf shape with optional dashed lines

Based on similar questions I found on SE, I have finally managed to create a relatively simple ‘folded document’ shape in tikz with a few horizontal lines inside: \documentclass[tikz,border=1mm]{...
user avatar
  • 585
1 vote
1 answer
38 views

Why does this pgfopts example using ".is choice" not work?

I'm trying to get this trivial proof of concept demo of pgfopts to work and I keep getting inconsistent results. I have another version working in which the keys are handled with an .is if handler and ...
user avatar

1
2 3 4 5
11