All Questions
278 questions
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, ...
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\...
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
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 ...
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}
...
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}
\...
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,
...
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 ...
1
vote
1
answer
80
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[...
0
votes
0
answers
40
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 ...
0
votes
1
answer
96
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=...
4
votes
2
answers
78
views
How to robustly test if a macro has not been set yet via pgfkeys?
I am trying to define a newcommand \ifempty that takes three parameters:
A macro that has been tied to a pgfkey via /.store in OR /.estore in
What to do in case this macro has not been set yet (is ...
2
votes
2
answers
102
views
Convert a macro name to pgfkey name
Let's consider a macro name of the form \first@second. I would like to write a command that would convert the name of the macro to pgfkey name of the form /first/second so that the following ...
1
vote
1
answer
70
views
Pgfkeys associated with macros lead to unexpected results
Consider the following class:
% CLASS
% Preamble
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{myclass}[2022/10/11]
\LoadClass[varwidth]{standalone}
\makeatletter
% Pgfoptions
\RequirePackage{...
0
votes
0
answers
30
views
Test if a package option defined through pgf is empty
I would like to branch on package/class options defined through the pgfopts package. Here is an example :
% CLASS
% Preamble
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{myclass}[2022/10/01]
\...
3
votes
2
answers
246
views
tikz: how to set one style to values of another style?
I have a pixel grid consisting of dashed lines, and I want to set a pixel using minimum size.
As can be seen, I set the minimum size manually, which works. However, I would like to set it to another, ...
0
votes
0
answers
134
views
TikZ get value of passed option/key inside pic
Is it possible to access the options that are passed to a pic inside the definition of a pic?
And if yes, how?
I know I can do this with self-defined custom keys.
But is it possible to also get the ...
3
votes
1
answer
97
views
Comma separated values list in pgfkey is not a list
The question might be dumb but I can't find an adequate solution.
If I put a comma separated value list as parameter using pgfkeys, then the result of pgfkeysvalueof is an atomic value and not a list.
...
1
vote
1
answer
65
views
Include Hyperref Text Field in a UML State Diagram
As you can see in my minimal example, I have a state machine diagram where students can write the name of the transition line in a text box. Can you give me some advice on how to place a text field ...
4
votes
4
answers
188
views
An element in the middle of a line
Please consider my minimal example. I would like to place an additional element -in this case a text field- in the middle of the line between nodes A and B. How does this work?
Which of the following ...
1
vote
1
answer
76
views
Extend a given shape from the UML-TikZ package with the path picture property
I call the style definition mystyle in line 20. As you can see, I pass a \filldraw command as an argument to the style definition mystyle. That way I want to achieve a gray circle to be displayed in ...
1
vote
2
answers
167
views
Access pgfkeys outside environment
I find that the value of a key defined by \pgfkeys inside an environment can not be invoked outside this environment.
In the following example, I want to typeset the value of the key aaa outside the ...
2
votes
2
answers
177
views
How to access a TikZ node's path after it have been created
I explored multiple solution to represent a graph cycle in TikZ with arbitrary nodes distributed around a circle and joined by arrows like the example below.
What worked for me was to place nodes on ...
3
votes
2
answers
157
views
How to transfer options to /tikz
In the following code, I want to typeset by the macro \pageband
a band with color red on the middle of page.
Three texts located at the left hand/middle/right hand of the band. The format of these ...
2
votes
5
answers
303
views
\ifblank does not work correctly with \pgfkeys
The macro \test below is used to test if its argument is blank, and it gives unexpected result.
What's wrong with my code?
Example:
\documentclass{article}
\usepackage{tikz,etoolbox}
\begin{document}
\...
0
votes
1
answer
60
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 ...
0
votes
1
answer
77
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}
\...
4
votes
2
answers
199
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 ...
1
vote
1
answer
53
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 \...
2
votes
2
answers
199
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 ...
2
votes
2
answers
238
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.
...
0
votes
1
answer
142
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....
0
votes
2
answers
74
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,...
0
votes
1
answer
182
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}
...
2
votes
1
answer
165
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 ...