I would like to supply the pgf argument of a particular macro call in advance. However I get the error:
Package pgfkeys Error: I do not know the key '/test/name=test, active=false' and I am going to ignore it. Perhaps you misspelled it.
Here is an example:
\documentclass{report}
\usepackage{pgfkeys}
\newcommand{\args}{name=test, active=false}
\pgfkeys{
/test/.is family, /test,
% Here are the options that a user can pass
default/.style = {
name = Unnamed,
active = false,
},
name/.estore in = \testName,
active/.estore in = \testActive,
}
\newcommand\test[2][]{
\pgfkeys{/test, default, #1}
\noindent%
name: \testName \\
active: \testActive \\
text: #2 \\
}
\begin{document}
% This works as normal
\test[name=test, active=false]{ipsum}
%This gives the following error:
%Package pgfkeys Error: I do not know the key '/test/name=test, active=false' and I am going to ignore it. Perhaps you misspelled it.
\test[\args]{ipsum}
\end{document}
Edit: dexteritas answered the question as stated very quickly, but I was hoping to find a solution for the following problem.
This is a sample of one of many files which I am hoping to simplify:
\begin{tikzpicture}
\draw ( 0, 0) node[anchor=north east](aa){\TalentBox[tier=5, width=14em, active=\gritActive, ranked=\gritRanked, name=\gritTitle] {\gritDescription}}
( 6, 0) node[anchor=north east](ab){\TalentBox[tier=5, width=14em, active=\arcanaCasterActive, ranked=\arcanaCasterRanked, name=\arcanaCasterTitle] {\arcanaCasterDescription}}
(12, 0) node[anchor=north east](ac){\TalentBox[tier=5, width=14em, active=\gritActive, ranked=\gritRanked, name=\gritTitle] {\gritDescription}}
( 0, -5) node[anchor=north east](ba){\TalentBox[tier=10, width=14em, active=\gentlePreserverActive, ranked=\gentlePreserverRanked, name=\gentlePreserverTitle] {\gentlePreserverDescription}}
( 6, -5) node[anchor=north east](bb){\TalentBox[tier=10, width=14em, active=\disguiseCastingActive, ranked=\disguiseCastingRanked, name=\disguiseCastingTitle] {\disguiseCastingDescription}}
(12, -5) node[anchor=north east](bc){\TalentBox[tier=10, width=14em, active=\potentDefilerActive, ranked=\potentDefilerRanked, name=\potentDefilerTitle] {\potentDefilerDescription}}
( 0,-10) node[anchor=north east](ca){\TalentBox[tier=15, width=14em, active=\gentlePreserverActive, ranked=\gentlePreserverRanked, name=\gentlePreserverTitle] {\gentlePreserverDescription}}
( 6,-10) node[anchor=north east](cb){\TalentBox[tier=15, width=14em, active=\signatureSpellActive, ranked=\signatureSpellRanked, name=\signatureSpellTitle] {\signatureSpellDescription}}
(12,-10) node[anchor=north east](cc){\TalentBox[tier=15, width=14em, active=\potentDefilerActive, ranked=\potentDefilerRanked, name=\potentDefilerTitle] {\potentDefilerDescription}}
( 0,-15) node[anchor=north east](da){\TalentBox[tier=20, width=14em, active=\lingeringSpellActive, ranked=\lingeringSpellRanked, name=\lingeringSpellTitle] {\lingeringSpellDescription}}
( 6,-15) node[anchor=north east](db){\TalentBox[tier=20, width=14em, active=\distantSpellActive, ranked=\distantSpellRanked, name=\distantSpellTitle] {\disguiseCastingDescription}}
(12,-15) node[anchor=north east](dc){\TalentBox[tier=20, width=14em, active=\shapeSpellActive, ranked=\shapeSpellRanked, name=\shapeSpellTitle] {\shapeSpellDescription}}
( 0,-20) node[anchor=north east](ea){\TalentBox[tier=25, width=14em, active=\quickenSpellActive, ranked=\quickenSpellRanked, name=\quickenSpellTitle] {\quickenSpellDescription}}
( 6,-20) node[anchor=north east](eb){\TalentBox[tier=25, width=14em, active=\dedicationActive, ranked=\dedicationRanked, name=\dedicationTitle] {\dedicationDescription}}
(12,-20) node[anchor=north east](ec){\TalentBox[tier=25, width=14em, active=\signatureSpellActive, ranked=\signatureSpellRanked, name=\signatureSpellTitle] {\signatureSpellDescription}}
\end{tikzpicture}
(sample copied from this file: https://github.com/luctius/genesys_dark_sun/blob/master/specialisations/arcana.tex)
I am hoping that I can create for example an \dedicationArgs
which together form the arguments for what are the active
, ranked
and name
parameters.
This means that, ideally I would like to avoid putting text directly into the pgfparameter list which are now defined in completely different files.