# Tag Info

Accepted

### Why is pgf 3.1 not compatible with tex?

The answer why PGF 3.1 does not support Knuth TeX is two-fold. It is the current year. By now e-TeX is over 20 years old and has simplified TeX development tremendously. I consider it a bug on your ...
• 105k
Accepted

When TikZ places a label (or a pin) it calculates a point that is label distance (or pin distance) away from a point on the anchor-border of its parent node. This point on the anchor-border is ...
• 86.1k
Accepted

### How to create a table automatically for a homework in statistics?

I suspected that your question How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables? was of the XY type. The usual problem in these ...
• 984k

### Is there a compact way to set the same default for multiple pgfkeys?

Yes it is the /.list handler. The argument to it is passed to a \foreach array and at each spin next item is passed to the original handler. \documentclass{article} \usepackage{pgfkeys,pgffor} \...
• 154k
Accepted

### Which arguments of \includegraphics cannot be set beforehand?

Brilliant documentation isn't it:-) In general setting keys is more or less just making macro definitions, so the ones you can't set in advance are the ones that are initialised by \includegraphics ...
• 665k
Accepted

### create new TikZ key with code and style tags

Here is an example how you can do this : \documentclass[varwidth,border=10]{standalone} \usepackage{tikz} \begin{document} \tikzset{ mykey/.code args={#1,#2,#3}{ % perform complicated ...
• 22.3k
Accepted

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

I'll rename your \alph macro to \alphstore because I am a coward and fear that redefining LaTeX's \alph command, even locally, might have undesirable side effects in some cases. Background and ...
• 21.3k

### tikz pic custom keys

A self-answer by the OP: I did a bit more reading around, and found some useful information in particular in this answer. The following code works, but I wouldn't say I have any expertise about ...
• 2,990

### Pass a 3d coordinate via pgfkeys

As stated in my comment, the fundamental problem is that the statement \coordinate (A) at (1,1,0); only stores the 2d representation of the point in (A). Using pgfkeys we can define a new command ...
• 91.7k

### How to create and manage hierarchically dependent PGF keys?

You can use the handler .unknown to set up the fallback. \documentclass[border=9,tikz]{standalone} \usetikzlibrary{trees,shapes.geometric} \begin{document} \pgfkeys{ %/hierarkey/.unknown/.code={\...
• 35.4k

### Is there a compact way to set the same default for multiple pgfkeys?

You do have a macro processor to hand so you could define a macro for it if tikz doesn't offer the functionality directly: \documentclass{article} \usepackage{pgfkeys} \def\foo#1{\pgfkeys{#1/.code={#...
• 665k

### PGF Keys differences between .initial and .default

Although this does not specifically add anything to the answer already provided, the following example helped me understand the difference more intuitively: \documentclass{article} \usepackage{...
Accepted

### How to get line width and inner sep values?

Your own style doesn't change any intrinsic properties of the line width and inner sep settings. So you can still use the regular key setting/reading ways. \documentclass[tikz]{standalone} \begin{...
• 154k

### Setting a length with a key to a TikZ node

The explanation, that TikZ is using \nullfont is already given in percusse's answer. Therefore \settowidth will not work as expected. \pgfmathsetlength{width("#1")} Instead of \settowidth the ...
• 261k
Accepted

### How do you define a default choice in pgfkeys

Default for an is choice is one of the choices, so simply do this: \pgfkeys{/tmp/.is choice} \pgfkeys{/tmp/list/.code={...}} \pgfkeys{/tmp/.default=list} This small example shows the expected ...
• 16.7k
Accepted

### How to pass parameters to \tikzstyle?

Everything about keys is detailed in section "87 Key Management" in pgf documentation. But about your code: once you define a style with parameters, use style=parameter_value to change it. You ...
• 127k
Accepted

### Plot decorated arrows in pgf?

Your arrows are drawn with new computations of f(x) for every x value, and since f uses rand, you obtain different values from those that were used for the curve. In order to solve this problem, I ...
• 21.3k
Accepted

### Passing (just) other options, when using pgfopts

You're mixing the two methods for setting options, which results in the warning. \begin{filecontents}{exa.cls} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{exa}[2014/03/19 exa] % As "article" with "...
• 984k
Accepted

### How to store tcolorbox's (multiple) settings in a macro?

With the combination of the code option plus \pgfkeysalsofrom from pgfkeys you can use options stored in a macro: \documentclass{article} \usepackage{tcolorbox} % \newcommand*\foo{colback=red,...
• 24.3k
Accepted

### Using LaTeX commands inside pgfplotsset

Probably Till Tantau was having similar problems so he created the error messages in a smarter way. Example; if I go something like this \tikz[xasfwr=yeah]{} The error message is Package ...
• 154k

### Setting a length with a key to a TikZ node

TikZ/PGF design is done in such a way that its regular syntax doesn't have any spurious whitespace leaks or unintended characters are printed out inside the code etc. One way of doing it is to map the ...
• 154k
Accepted

### tikz shapes, not quite getting things right (anchors and keys)

Here's a fully worked through example of (what I understand to be) the required shape from first principles (i.e., without inheritance). I exploit the (undocumented) \addtosavedmacro command which can ...
• 68.9k
Accepted

### Change the optional arguments in the interval package

Sure! \documentclass{article} \usepackage{interval} \intervalconfig{ ol/.style={open left}, } \begin{document} $\interval[ol]{a}{b}$ $\interval[open left]{a}{b}$ \end{document}
• 984k
Accepted

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

The error comes from the fact that you define \newcommand{\chooseColor}{\ifnum\thetest=1 green \else red \fi} Hence, you assign \chooseColor with green or red with a trailing space. This space is ...
• 17.5k
Accepted

### Is there a compact way to set the same default for multiple pgfkeys?

Using pgffor (@percusse beat me to it but this is still a little different in allowing you to have different defs for a and b): \documentclass{article} \usepackage{pgfkeys} \usepackage{pgffor} \...
• 14.6k

### Does expl3 key-setting syntax have an equivalent of TikZ/PGF's .cd?

Short answer: no. The idea of using a keyval approach to setting up keys themselves was (that I know of) first implemented for TeX in pgfkeys. When writing l3keys I looked very hard at this for a ...
• 242k
Accepted

### rounding to one decimal woes...

The macro \pgfmathprintnumber uses math mode for this. I suggest changing the definition of \prlen: \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\prlen}{m} { \fp_eval:n { round(\...
• 984k