I want to set the same default value for multiple PGF keys, like in this case where both a
and b
have a default of 1
:
\documentclass{article}
\usepackage{pgfkeys}
\pgfkeys{
a/.code={a:#1},
a/.default=1,
b/.code={b:#1},
b/.default=1
}
% the rest is irrelevant, the question only concerns setting the keys
\begin{document}
\pgfkeys{a,b}
\end{document}
In my real code, which contains many more than two keys, it's pretty repetitive to be writing keya/.default=1
, keyb/.default=1
, etc. So is it possible to set a default for a large number of keys all at once, in some way that takes less typing than one full assignment for each such key? If there's some concept of inheritance for keys, such that I could set a default on a "base key" and then "derive" other keys from it, that would work quite well for my purposes, but from a read through the manual I don't see that. Maybe I'm missing it.
Of course there's no reason I have to do this; it works fine to just write a whole bunch of key/.default=1
lines, but I'm curious about whether it could be done.
tikz
anyway (the loading ofpgfkeys
is just to keep the example minimal)