Questions tagged [pgfkeys]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
45 views

Mutually-exclusive TikZ .is choice keys

My TikZ drawing package has a command that will draw a "simple beam", which is basically a rectangle between two arbitrary points. The code below is the relevant part from the package: % arara: ...
0
votes
1answer
25 views

pgfopts .unknown does not handle key-value pairs?

I would like my custom class to forward unknown keys to the base class, or in this case, a package. The following works (to make the example smaller, this forwards only one key; expanding it to a ...
1
vote
1answer
38 views

Inheriting PGF keys through families / setting multiple values

I'm trying to create a library for drawing various things, and I'd like to be able to set up PGF keys so that there is both a top-level family of settings and module-level settings. If a key name is ...
0
votes
0answers
19 views

ProvidepackageRCS [duplicate]

\documentclass[10pt]{article} \usepackage{epsfig,rotating,times,psfrag,pstricks,tikz} \usepackage{xcolor,array,graphicx} \usepackage{amsmath,amssymb} \pagestyle{empty} \begin{document} \small \...
3
votes
2answers
91 views

Expansion of addplot and draw are different in tikz?

Can someone help me understand why in the two calls to mydraw, the addplot is executed twice, but the draw is only executed once? I see the "dot" created by both addplots, but only the label for the ...
3
votes
1answer
51 views

Why does the space in \pgfkeys matter?

As part of a different question (Detecting empty PGFKEYS), I posted a code fragment where I was told a space did not matter. I've been able to reproduce the case where it does. Can someone help me ...
2
votes
3answers
67 views

Detecting empty PGFKEYS

I came across "What is the recommended way to assign a value to a variable and retrieve it for later use?" while trying to figure out how to use PGFKEYS. I'm having trouble, however, figuring out how ...
1
vote
1answer
106 views

Asymptote's dot analogue in TikZ

I have been trying to replicate Asymptote's dot style in TikZ, having the outer diameter equal to dotfactor * linewidth(p) where p denotes the given or current pen and dotfactor is 6 by default. What ...
4
votes
2answers
162 views

How to define key values for a newcommand function?

I have many functions like this MWE, and I want to define keys for the inputs of the functions; however I did not succeed to do so. \documentclass{standalone} \usepackage{tikz} \newcommand{\...
0
votes
0answers
42 views

Package pgfkeys Error: I do not know the key '/tikz/cram width'

I'm trying to draw the D-glucopyranose using the chemfig package, so I copied the piece of code from chemfig manual: \chemfig[cram width=2pt]{HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,line width=2pt](...
3
votes
3answers
121 views

How is a pgf key defined?

The following code illustrates that I don't understand one of the most basic things about pgfkeys. Namely, what it takes for a key to be defined. I've read through section 87.3 and following sections ...
2
votes
1answer
44 views

Test if a pgfkey is empty in a safe way

I have this little example to check if a key is empty: \documentclass[]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{tikz} \makeatletter \newcount\cnt\cnt=0\relax \...
2
votes
1answer
27 views

pgfkeys: do a “local” /.cd in a style

Let's suppose I have special nodes defined that use several pgfkeys nested quite deep. I would like to use a .cd command when I define styles; but then I struggle to "go back" from the directory. Let ...
1
vote
3answers
53 views

How to execute default option when using pgfopts?

I would like to define options for a package using pgfopts. So far it works quite well, but I can't figure out how to execute default options. This is described here: How do you define a default ...
4
votes
1answer
56 views

Scale factor of pgfplot's xtick with mask

A scale factor factor for xticks does not work with ldots mask .... Does the problem have a solution? \documentclass[tikz]{standalone} \usepackage{pgfplots} %=========================================...
1
vote
1answer
28 views

How to put an x-coordinates of a points as extra x ticks?

I need to put x-coordinates of a points as extra x ticks, but common way is irrational, because there can be many points and duplicate them in extra x ticks is poor. \documentclass[tikz, border=1cm]{...
1
vote
1answer
52 views

fraction format problems in automated answer of linear systems

I'm trying to make an automated answer of linear systems, but I have some problems with fraction format. \documentclass{article} \usepackage{xparse,xfp,xfrac,amsmath,amsfonts} \usepackage[nice]{...
1
vote
2answers
46 views

How to print number with predefined exponent base (pgf)?

How can I print a number with some predefined base of power of 10 (exponent base) using \pgfmathprintnumber \documentclass[border=1cm]{standalone} \usepackage{pgf} \usepgflibrary{fpu} \begin{...
1
vote
1answer
48 views

Simplification and circles pointing to axis help of multiple coloured yaxis pgfplot

I have generated the below plot how I want. Can this be simplified? However I found it very convoluted to colour the y axis, labels and tick labels, whilst keeping the x axis black. Setting the ...
3
votes
2answers
53 views

pgfkeys and columns in beamer

I am trying to introduce a few macros to make my life with columns in beamer a bit easier. The macros should take key-value pairs for customizing width, heights, alignment etc. I ran into problems ...
0
votes
1answer
53 views

Strange clash label positioning pgfkeys

I have a couple of macros using pgfkeys, kindly written by a friend (I am unfortunately no expert in this advanced pgf/tikz coding). One of the macro draws a couple of squares with a path between ...
1
vote
2answers
113 views

Trouble with pfgkeys and CircuiTikz (with dipchips)

I have trouble printing ICs with CircuiTikz. Most parts work fine but I can't set \ctikzset options as well as dipchips. Any ideas? Thanks a lot! MWE (copy-paste 1st example, p. 91 of the manual) \...
4
votes
1answer
74 views

Create asymptote handling pgfplots key

I'm looking for an easy way to handle asymptotes well in pgfplots. I recently saw Asymptotes in a plot which has lead to me being able to create the following vasym/.style={ y filter/.expression ...
1
vote
1answer
28 views

How to get mantissa and exponent of a number from within pgf/fpu?

I need to get mantissa and exponent of a number from within pgf/fpu. I found @egreg's solution from here, but this solution does not work inside fpu. \documentclass[]{article} \usepackage{pgf, tikz} \...
2
votes
1answer
55 views

PGF decorations not working

I am trying to use the following custom pgfdecoration to draw bonds with varying length of the double bond while using chemfig. The code was obtained from the following link: How to alter the bond ...
4
votes
1answer
48 views

Tikz set label position using pgfkey

I'm trying to define a tikz style for nodes that (among other things) includes a label. Since the label position relative to the main node needs to be manually controllable I want to set the position ...
2
votes
1answer
49 views

In Beamer, how to use pgfkeys to pass parameter to enumerate?

I want to create a new environment with one optionnal parameter that is used to set pgfkeys. I want one key to be pass as argument too enumerate to make item appears one at a time (<+->). It seems ...
8
votes
3answers
342 views

Is there a way to retrieve the “source code” and the argument pattern from a macro for reuse (i.e. what \show shows)?

I want to concatenate the “source code” of two macros which share the same argument signature. How do I grab (i.e. expand once) the macro without TeX searching for the arguments which the macro ...
3
votes
1answer
112 views

How can I set boolean pgfkeys?

I am making a command called seal that needs a boolean key=value option. Since I don't know how to do this, I am using key=yes and key=no for defining my pgfkeys as follows. \pgfkeys{ /seal/.is ...
2
votes
1answer
50 views

Passing options from a newcommand to a another command (\includegraphics)

I'm making a command called \seal that uses the \includegraphics function. The command \seal has some key=value options of its own (color, beamer, trimz) and it must accept all options of \...
7
votes
1answer
183 views

pgfplots: How to define a key and set its value?

Why does setting the value of key alpha=0.5 inside semilogxaxis options (i.e. \begin{semilogxaxis}[alph=0.5]) not take effect \documentclass{article} \usepackage{pgfplots} \begin{document} \...
2
votes
1answer
54 views

How to change the mantissa separator for PGFPlots contour plot labels?

How can I change the mantissa separator in my MWE from \cdot to \times? The MWE needs to be compiled with the -shell-escape flag. \documentclass[preview]{standalone}% % \usepackage{caption}% \...
5
votes
1answer
60 views

Trying to use the array environment inside a tikz node with `execute at begin node`

I'm trying to package a tikz key math array that lets me wrap the contents of a node inside an array environment in math mode, but I'm getting errors that I'm unable to debug. Here's the code: \...
0
votes
1answer
69 views

Passing arguments using pgfkeys to a macro for including PDF files, using pdfpages

This is a slightly simplified version of a macro I've been writing (using pgfkeys and pdfpages) to include PDF files. This seems to be working. I ran into one bump. includepdf does not like it when ...
4
votes
2answers
137 views

pgfkeys: .store in constructed macro

I'm trying to store a value in a macro that is constructed from the arguments of another macro, but I must be missing something because the macro is not created. MWE: \documentclass{article} \...
2
votes
1answer
82 views

pgfkeys error with pgfplots/colormap

Consider the following MWE: \documentclass[tikz]{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{% compat=newest, colormap={orangeyellow}{color=(orange) color=(yellow)} } \begin{document} ...
2
votes
1answer
215 views

How to pass parameters to \tikzstyle?

I am using multipart shapes to create two-sided nodes and want to change the background color of the left node based on a user-provided (color) parameter. Changing the default parameter at \tikzstyle{...
4
votes
1answer
114 views

Making a custom circuit element in circuitikz

I am writing intro physics exams in LaTeX, using the circuitikz package to make circuits. A lot of the circuits use simple light bulbs, which we represent as a circle with a curly-cue inside. ...
3
votes
1answer
47 views

Retrieve the name of the key in a pgfkeys .code macro

Just to focus the problem, I am thinking of reducing the numbers of parameters of the circuitikz package into a reasonable ballpark; now for example each one of the 30+ generators have a different key ...
0
votes
0answers
39 views

How are pgf-keys stored and is it possible to print a list of them

I was wondering how pgf-keys are handled internally. For example: If I define: \pgfkeys{/A/.code={My Key}} and I call the key with Hello this is \pgfkeys{/A}. How does the \pgfkeys-command expand? ...
3
votes
1answer
35 views

list of numbers as command option, numbers will be used to define colors

What I'm trying to do is to pass a list of numbers as an option to a command. The numbers will be used later to define colors inside a tikz picture. The first part I can do, here's an example \...
2
votes
1answer
55 views

Detect empty key in pgfkeys without `.get` code

I am trying to use pgfkeys to define an API for some macros, and I am having trouble detecting when a key is "empty". Based on this answer, I have come up with the following code: \documentclass[12pt]...
0
votes
1answer
30 views

How to set a value of a key of a user-defined (not global or default) style through /utils/exec (or similar means that allow for code execution)?

I need to change the value of the color key of changeStyleColor style through that style's /utils/exec. I can set a value of a global key through /utils/exec by \tikzset{/tikz/myKey=myValue}, or can ...
1
vote
1answer
82 views

error after an upgrade of MikTex (interfaces and pgfkeys)

I have a compilation problem with an old document, wich i cannot recompile today with an up to date MiKTex 2.9 installation on Windows. It seems that it is a problem with latest version of pgfkeys. ...
1
vote
0answers
40 views

Using pgfkeys to make a custom tikzpicture command with multiple use of addplot

Consider this MWE: \documentclass{article} \usepackage{tikz,pgfplots} \usepackage{pgfkeys} \usepackage{xparse} \usepackage{filecontents} % DATA 1 \begin{filecontents*}{data1.txt} 1 1 2 4 3 9 4 16 5 ...
4
votes
1answer
262 views

interval (or pgfkeys) package: Undefined control sequence

With \documentclass{article} \usepackage{interval} \begin{document} $\interval{0}{5}$ \end{document} I get the following in the log file ... (c:/texlive/2019/texmf-dist/tex/latex/interval/interval....
1
vote
2answers
42 views

pgfkeys: expand inside a command containing style

I need to define a style contained in a macro without expanding this macro. The problem is that if the macro contains several keys like or sets a value to a key like here: \def\myconfiguration{text={...
1
vote
0answers
76 views

Set the database in a genealogytree

Like in this question, I'm trying to fill a genealogytree with datas from an external source, thanks to the datatool package. But I can't figure how to tell genealogytree how to correctly recognize ...
1
vote
0answers
68 views

pgfkeys: set default value to boolean “.is if”, and values are changed globally

I'm quite new with pgfkeys, and I'm having troubles to set default values to boolean keys defined with .is if (let me know if there is another way to define boolean keys), and I don't know why, but ...
0
votes
1answer
33 views

Problem with passsing options through customized class interface \myclsset using pgfkeys

My intention is to create a class with a interface setup command \myclsset \documentclass{myclass} \myclsset{key1=val1, key2=val2, ..} % key-value list \begin{document} ... \end{document} where \...

1 2 3 4 5 9