Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [pgfkeys]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
87 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 ...
Rmano's user avatar
  • 42.3k
1 vote
1 answer
59 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. ...
user182238's user avatar
1 vote
1 answer
31 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{/...
cis's user avatar
  • 8,922
3 votes
1 answer
132 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 ...
cis's user avatar
  • 8,922
1 vote
1 answer
57 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 ...
cis's user avatar
  • 8,922
2 votes
2 answers
51 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 ...
user182238's user avatar
0 votes
2 answers
73 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 ...
Antonio Maria Di Mauro's user avatar
2 votes
3 answers
89 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. ...
Sam's user avatar
  • 310
0 votes
1 answer
29 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 ...
PascalS's user avatar
  • 802
1 vote
1 answer
40 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{...
onlycparra's user avatar
0 votes
0 answers
44 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} ...
hpekristiansen's user avatar
10 votes
1 answer
385 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 ...
Vincent's user avatar
  • 5,327
4 votes
2 answers
94 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, ...
Vincent's user avatar
  • 5,327
1 vote
1 answer
78 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 ...
psygo's user avatar
  • 438
1 vote
1 answer
44 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 ...
Vincent's user avatar
  • 5,327
1 vote
1 answer
33 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} % ...
Vincent's user avatar
  • 5,327
1 vote
2 answers
75 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} \...
Vincent's user avatar
  • 5,327
1 vote
1 answer
65 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 ...
tunesmith's user avatar
  • 113
0 votes
1 answer
32 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 ...
Arthur Azevedo De Amorim's user avatar
1 vote
2 answers
47 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,...
acat3's user avatar
  • 111
4 votes
4 answers
128 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 ...
dsacre's user avatar
  • 377
1 vote
1 answer
79 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 ...
Robertas Vilkas's user avatar
0 votes
0 answers
40 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 ...
yannisl's user avatar
  • 118k
0 votes
0 answers
66 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 ...
Emad's user avatar
  • 33
9 votes
2 answers
199 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} ...
mbert's user avatar
  • 4,561
1 vote
1 answer
55 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{...
jwbos's user avatar
  • 79
2 votes
0 answers
64 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 ...
tobiasBora's user avatar
  • 8,994
1 vote
3 answers
67 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 ...
Jander's user avatar
  • 1,160
0 votes
0 answers
45 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, ...
Felipe9's user avatar
  • 339
1 vote
1 answer
54 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 ...
Yiyang Yan's user avatar
2 votes
2 answers
370 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} \...
Kaniky's user avatar
  • 69
4 votes
1 answer
171 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, ...
Jux's user avatar
  • 43
0 votes
1 answer
44 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} \...
Crazymoomin's user avatar
0 votes
2 answers
120 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 ...
Michael.H's user avatar
  • 107
0 votes
1 answer
52 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 ...
Faheem Mitha's user avatar
  • 7,838
0 votes
0 answers
37 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, ...
user182238's user avatar
0 votes
1 answer
47 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} \...
BirdboyBolu's user avatar
1 vote
1 answer
56 views

Comparing pgfkey variable against a string

I want to check a mutable variable against many possible values, so that a macro will behave differently based on that value. Since there are many variables, they are stored using pgfkeys. Testing ...
eduardofischermath's user avatar
1 vote
1 answer
71 views

Package pgfkeys Error: I do not know the key '/tikz/10mm)'

When try to shift vertically a Tikz node that use pgfkeys coordinates it shows an error message: Package pgfkeys Error: I do not know the key '/tikz/10mm)' The basic code is as follow: \documentclass[...
ABV's user avatar
  • 449
1 vote
1 answer
77 views

Can you not pass argments to commands using keys?

I use my own LaTeX preamble for university, so I am fairly used to creating macros using tools such as xparse. However, I am unsure why I cannot do something that will choose between two images on my ...
TimeTravelPenguin's user avatar
0 votes
0 answers
32 views

Tikz/pgfkeys: automatically execute code at the end of option processing

How can I automatically execute a code in a tikz/pgf option when all options are processed? I want to execute a command a single time, say updateValueShouldBeCalledOnce (that reads some variable sets ...
tobiasBora's user avatar
  • 8,994
0 votes
1 answer
88 views

Add properties instead replacing them in tikzset

I am working on a project involving several files and i would like to have the possibility to add properties to styles using tikzset and pgfplotsset. I reduced my code to a MWE : \documentclass[border=...
LMT-PhD's user avatar
  • 1,276
2 votes
3 answers
111 views

pgfkeys and passing argument with math-ish format

It seems that pgfkeys is attempting to do math on one of my arguments, and failing because it's not actually math. How do I prevent this, and ensure that the argument is passed correctly? Compiling ...
Tetragramm's user avatar
2 votes
2 answers
63 views

pgfkeys : print values in the order they were called

I would like to create an environment that prints the parameters in the order they were called using pgfkeys. \documentclass{article} \usepackage{pgfkeys} \pgfkeys{ /info/.is family, /info, default/....
h3t1's user avatar
  • 123
1 vote
1 answer
74 views

Bracing a list within a list

I have this set up: %%% some keys \pgfkeys{/mystuff/first color/.code=\gdef\myfirstcolor{#1}} \pgfkeys{/mystuff/first color/.default=black} \pgfkeys{/mystuff/last color/.code=\gdef\mylastcolor{#1}} \...
Raoul Kessels's user avatar
1 vote
0 answers
76 views

Condition in Writing New Environment with pgfkeys

I'm writing a new environment in LaTeX where pgfkeys package is used to give the key interface. Source Code: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{noteframe}[2023/01/01 Version 1.0] \...
Future Liang's user avatar
1 vote
1 answer
99 views

How to use \pgfkeys properly in \newenvironment based on xcolor and tcolorbox?

I'm trying to create a new environment called noteframe that is based on tcolorbox. Supposedly, the noteframe environment should allow the user to change the theme color of the box using the name of ...
Future Liang's user avatar
0 votes
1 answer
52 views

Bizzarre behavior of pgfkeys' first char syntax detection

I saved the following code in the file ~/Test.tex. \documentclass{article} \usepackage{pgfkeys} \pgfkeys{ precision/.code={precision=#1}, unit/.code={unit=#1}, /handlers/first char syntax=...
Evan Aad's user avatar
  • 11.1k
0 votes
2 answers
36 views

pgfkeys' first char syntax detection failure

I saved the following code in the file ~/Test.tex. \documentclass{article} \usepackage{pgfkeys} \pgfkeys{ /handlers/first char syntax=true, /handlers/first char syntax/the character a/.initial=\...
Evan Aad's user avatar
  • 11.1k
1 vote
3 answers
97 views

Conditionally set "number within" in tcolorbox

I've defined a tcolorbox listing as follows: \newtcblisting[auto counter, number within=chapter, crefname={Lis.}{Lis.}, ... It works fine in books, but I ...
Michel Charpentier's user avatar

1
2 3 4 5
12