Questions tagged [pgfkeys]
{pgfkeys} concerns a flexible key management system in TikZ/PGF.
607 questions
2
votes
2
answers
35
views
Styling axes in polar plots of radiation patterns with PGFPlots
I would like to display radiation patterns in a polar coordinate system using pgfplots.
To achieve this, I want to generalize the argument of the macro \pgfmathparse{#1+15} in the following example, ...
2
votes
1
answer
62
views
TikZ/PGF: how to execute .code{} when the shape is initialized
I am trying to figure out how to declare a PGF shape with an "optional" part, but I am running into trouble with initial values vs. key/value pairs. I have created a minimal working example:
...
0
votes
2
answers
94
views
Option for a custom TikZ command which can be set to one of three values
Related:
https://tex.stackexchange.com/a/730199/319072
https://tex.stackexchange.com/a/730112/319072
I am trying to make an option for a custom tikz command which can be set to one of three values. ...
1
vote
1
answer
51
views
make tikzpicture option which carries over to custom commands - pgfkeys
I have made some custom commands for tikz that I want to provide global options for.
I know how to provide options locally to the commands from https://tex.stackexchange.com/a/730112/319072, but I ...
1
vote
1
answer
59
views
get a boolean key=value with a default value, and a numeric key=value to work together in tikz
I am interested in learning pgfkeys, and using them for key=value options in custom tikz commands. I am exploring the section 87 in the tikz doc, but it will take me some time to go through.
I can get ...
2
votes
1
answer
116
views
A question on Tikz keys
Using the code in this answer I sometimes need to change the fill color where it says white in the code: node[midway,sloped,fill=white,dim label]. What is the way to do that?
\documentclass[tikz, ...
4
votes
1
answer
47
views
How to save (clone) a style in pgfkeys?
Is there a way to clone (deep copy) a style?
Please take a look at the example. It uses tcolorbox because it's what I need it for, but the question is acutally about pgfkeys (so I believe).
\...
0
votes
1
answer
46
views
How to use the `.is if key` as an optional argument in a macro?
I'm trying to learn \pgfkeys, but I don't quite understand how to use it to create a macro with key=value options.
I created a macro \aiguille that draws a clock with 3 parameters:
#1 optional to ...
4
votes
2
answers
104
views
Pgfkeys not finding key during key expansion through several macros
Summary
I have a caller macro that should pass options to other nested macros within it. However, the key is not found when I pass it from the caller macro, yet it is correctly defined (I think) ...
1
vote
1
answer
46
views
How to use `tikzfeynmanset` to fill-in a blob in the `feynman` environment
Quite straightforward. I want the blobs in my Feynman diagrams to be filled in with gray. Hence, I tried
\documentclass{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\tikzfeynmanset{
blob/....
0
votes
1
answer
44
views
TikZ animation attributes: reuse and parametrize
I want to make a somewhat complex animation. I have multiple groups of components that should appear and disappear at the same time within a group (but different groups have different timelines). I ...
0
votes
1
answer
38
views
Applying conditional formatting in \pgfplotstabletypeset resets other formats
My MWE is shown below,
\documentclass{article}
\usepackage{amsthm}
\usepackage{tikz}%
\usetikzlibrary{calc}%
\usepackage{ifthen}
\usepackage{pgfplots, pgfplotstable} %
\usepackage{amsmath}
\newcommand\...
0
votes
1
answer
75
views
Why is \pgfkeyssetvalue not working within a \foreach environment?
I want to understand why \pgfkeyssetvalue{/pgfplots/table/@cell content}{\cellcolor{lightgray}#1} is working outside of a \foreach loop, but not within.
In my MWE, I prepared both scenarios. You just ...
3
votes
2
answers
95
views
Checking if the version of TikZ is newer in a format-independent way
Notice: that question has been answered here, posted to be useful to the general public.
I am struggling to write a macro to use in circuitikz to apply the change to arrow tips you can see here (which ...
1
vote
1
answer
64
views
Can I use IfSubStr to search pgf key values that contain footnotes?
I would like to search some pgfkeys values for particular substrings. My attempt to locate such functionality in the manual didn't pan out, so I turned to using "\IfSubStr" from xstring. ...
1
vote
1
answer
36
views
Using of a pgfkeys-colorlist goes wrong
I used the solution
% written by @cfr --> https://tex.stackexchange.com/a/721338/46023
colorlist aux/.code={\stepcounter{colorindex}\colorlet{color\thecolorindex}{#1}},
colorlist/.code={\pgfqkeys{/...
3
votes
1
answer
168
views
How to call up the current value of a pgfkey
I created a pgfkey with the systematic
\ifthefilled % filled 3/3
\tikzset{FillStyle/.style={fill=lightgray}}% filled=true
\else
\tikzset{FillStyle/.style={fill=none}}% filled=false (default)
\fi
In ...
1
vote
1
answer
77
views
How to use the values of a 'pgfkey' with a list
How can I get access on a pgfkeys-list of the kind
\tikzset{MyCmdSettings/.cd,
colorlist/.code=#1
colorlist/.list={red, green, blue},% Default
}
I wrote a command \MyCmd where I want to call up the ...
2
votes
2
answers
63
views
PGF keys are setting individually but not as a key list
Using the TeX Works AppImage with a local installation of TeX Live (texlive-full, 2021.20220204-1), I'm having trouble getting "pgfkeys" to work with a key list. Setting each key ...
0
votes
2
answers
86
views
Create a command with pgf options to import a symbol from a different font
Writing a mathematical document it sometimes happens you need to use some symbols not available in amssymb: to expand this library then I thought to "automate" a standard procedure for ...
2
votes
3
answers
96
views
How to detect pgfkeysnovalue with csname?
To simplify the programming of a package, I want to generate multiple similar commands (\test, \testb, ...) with a single command \NEWCOMMAND. Each key needs to be linked with an unique command name. ...
0
votes
1
answer
37
views
PGFplot - Create a new column from the hash value of another column
I want to calculate the hash value of several columns and store the unique value in another column using pgfplotstable.
In my shown MWE I just try this approach with two columns X & Y. I want to ...
1
vote
1
answer
46
views
Passing arguments to lstinputlisting using pgfkeys
I am writing a macro to put code and a figure side by side. There are three relevant files: main.tex, figure.tex, and ch1.tex.
main.tex is roughly this:
...
\usepackage{listings}
...
\lstdefinestyle{...
0
votes
0
answers
49
views
Making keys global or reference them outside scope
I made this code to be used as an answer here: Efficient "macro" for adding second (x-)axis to pgfplots and more generally.
\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
...
10
votes
1
answer
417
views
Moving from pgfkeys to latex3 key-val system to handle package options
I have been advised in this question to move from pgfopts to latex3 to handle package options. I would like to do that but I must admit that I am a little lost. Examples with the patterns I'm using ...
4
votes
2
answers
109
views
Difference betwen .is family and .cd in pgfkeys in the context of package writing?
I am using pgfopts to create my own packages and handle options. .family and .cd can be used to group the package options together, but I am not sure to understand the pros and cons of each approach, ...
1
vote
1
answer
79
views
Defining a Set of Keys in Terms of Another Set of Keys
If I have 2 macros, one inside the other, while the top-most one has a bit more parameters, I would like to be able to set the top-most macro's keys as an extension of the bottom one, something ...
1
vote
1
answer
49
views
Mixing package options and family options?
The question I am asking here is a follow-up to the question Macros to change pgfkeys package options on the fly and define custom sets of options.
I was used to specify package options using the ...
1
vote
1
answer
36
views
Initial style definition before and after ProcessPgfPackageOptions?
The following great post, provides the following answer to a question about managing package options: https://tex.stackexchange.com/a/707285/17200
\begin{filecontents*}[overwrite]{mypackage.sty}
% ...
1
vote
2
answers
80
views
Macros to change pgfkeys package options on the fly and define custom sets of options
Consider the following code for a package :
% Preamble
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{mypackage}[2024/01/01 MyPackage]
\makeatletter
% Dependencies
\RequirePackage{pgfopts}
\...
1
vote
1
answer
119
views
pgfkeys undefined control sequence
I recently upgraded to MacTeX 2023, and am experiencing this warning when using a custom library (https://github.com/slithy/rpg_module):
640: Undefined control sequence.
l.1640 \pgfutil@protected
...
0
votes
1
answer
35
views
Setting up PGF key code inside handler
(Edit: My original example was too simplistic; here is a more accurate version.)
I would like to traverse all names in a dictionary-like structure representing PGF keys. I would like to associate some ...
1
vote
2
answers
50
views
Storing comma separated entries in a list and print them using pgfkeys, pgffor, etoolbox
Problem Statement
I want to store several keywords in a list, then print all items inside the list separated by commas, but the last item should also be separated by ", and ...". For example,...
4
votes
4
answers
138
views
pgfkeys: Is it possible to achieve a "dictionary-like" input method for subkeys (without much parsing effort)?
Problem Description
Currently I am working on a template for scientific theses. The goal is to automate a lot of tedious settings (like pdf metadata, styling/accent colors, title page etc.) by giving ...
1
vote
1
answer
80
views
Package pgfkeys Error on TeXstudio, but no error on Overleaf
I've tried to use the code from this post by @AlainMatthes in TeXstudio, but I've got this error:
Package pgfkeys Error: I do not know the key '/tkzcircle/radius' and I am going to ignore it. Perhaps ...
0
votes
0
answers
47
views
Modify the optional argument of sectioning commands to pass key val lists
Standard classes have sectioning commands with an optional first argument, that can contain an alt title to be used in the table of contents and running heads. If one needs to use a keyval interface ...
0
votes
1
answer
100
views
Conflict between babel package and tcolorbox package
This code:
\documentclass[a4papaer, 12pt, landscape]{article}
%%% Format margines ...
\usepackage[margin = 15mm]{geometry}
%%% Get more control over colors
\usepackage[tabel]{xcolor}
%%% Add ...
9
votes
2
answers
210
views
l3keys equivalent of pgfkeys' .code 2 args
What is the recommended way to emulate pgfkeys' /.code 2 args (or more generally /.code n args) handler with l3keys? For example, with pgfkeys one can do
\documentclass{article}
\usepackage{pgfkeys}
...
1
vote
1
answer
60
views
pgfkeys + hyperxmp + utf8 problem
I am trying define a command where I use pgfkeys to process multiple options. Some of these are used to set meta-information in the pdf using hyperxmp. Example:
\documentclass{article}
\usepackage{...
2
votes
0
answers
70
views
pgf key style with no argument, or how to avoid escaping hashes
I expect a user to write something like:
\pgfkeys{
latex/.append style={
add to preamble={
\def\sayhello#1{Hello #1.}
}
},
}
but this does not work, as #1 is understood as the first ...
1
vote
3
answers
86
views
pgfkeys with length and .is choice
I want to define a key to handle a length, but also have custom settings.
The usage I intend:
my length = auto will set a boolean to false and ignore the length
my length = half will set a boolean to ...
0
votes
0
answers
61
views
Formatting ticklabel number error
For some reason i cant format the ticknumber and restrain it at the same time, what is wrong?
It repeatedly renders the errors
[{
"owner": "LaTeX",
"severity": 8,
...
1
vote
1
answer
56
views
How to find out available key-value pair for CircuiTikZ
I'm using CircuiTikZ and I came across this issue frequently: every time I want to tweak some options using tikzset, there is no documentation for the available key-value pairs.
For example, if I want ...
2
votes
2
answers
565
views
Package pgfkeys: I do not know the key '/tcb/O' and I am going to ignore it
When I am compiling this code:
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tcolorbox,tikz}
\usepackage{lipsum,lmodern}
\usetikzlibrary{calc}
\...
4
votes
1
answer
211
views
Custom edge in TikZ graph
Goal
I'm trying to connect the nodes of my graph using a horizontal-vertical-horizontal line.
MWE
Consider the following example:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{graphs, ...
0
votes
1
answer
57
views
Pgfkeys choice keys nested within another key
I'm trying to create a key which has two choice keys nested within it, like so:
engagement={target designation=hostile target, stage=engage}
Here's the MWE I have so far:
\documentclass{standalone}
\...
0
votes
2
answers
125
views
Mechanical wagon parameterized with pgfkeys
I want to draw a mechanical wagoon for a physics book with a parameterized approach.
These should be the parameters:
#0 name, the name of the object, e.g. mywagon
#1 position of the wagon as ...
0
votes
1
answer
62
views
Name collision when defining a macro using pgfkeys
(Please suggest a better title!)
The following LaTeX document defines a macro called
/PrintStuff. This macro uses pgfkeys to define one optional
argument, rowidstring. The macro \rowidstring@tables is ...
0
votes
0
answers
52
views
Calculations involving pgfkeys?
I've begun using pgfkeys to set a bunch of custom variables. I'm also using pgfmath to do some calculations. I understand how to set and call the variables, but the manual is mind boggling to me, ...
0
votes
1
answer
54
views
Using \pgfkeys for Macros
I am having an issue implementing the \pgfkeys command for a marco I want to compile. Here is the code. Please let me know what went wrong:
\documentclass{article}
\usepackage{graphicx}
\...