Expanding macro to define tikzset
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I need to store tikz
option in a csdef
:
csdefMy Node Optiondraw=red, thick, fill=yellow
How do I use this definition to define a style via tikzset
?
I attempted to use .expand once
as per How do I define tikz styles with a xkeyval command?:
tikzsetNode Options/.style/.expand once=csuseMy Node Option
but that leads to a
Package pgfkeys Error: I do not know the key '/tikz/draw=red, thick, fill=yellow' and I am going to ignore it. Perhaps you misspelled it.
The desired result is to modify only the tikzset
in the MWE and obtain:
Code:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
tikzsetNode Options/.style/.expand once=csuseMy Node Option%% ????
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
tikz-pgf tikz-styles expansion etoolbox
add a comment |Â
up vote
3
down vote
favorite
I need to store tikz
option in a csdef
:
csdefMy Node Optiondraw=red, thick, fill=yellow
How do I use this definition to define a style via tikzset
?
I attempted to use .expand once
as per How do I define tikz styles with a xkeyval command?:
tikzsetNode Options/.style/.expand once=csuseMy Node Option
but that leads to a
Package pgfkeys Error: I do not know the key '/tikz/draw=red, thick, fill=yellow' and I am going to ignore it. Perhaps you misspelled it.
The desired result is to modify only the tikzset
in the MWE and obtain:
Code:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
tikzsetNode Options/.style/.expand once=csuseMy Node Option%% ????
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
tikz-pgf tikz-styles expansion etoolbox
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I need to store tikz
option in a csdef
:
csdefMy Node Optiondraw=red, thick, fill=yellow
How do I use this definition to define a style via tikzset
?
I attempted to use .expand once
as per How do I define tikz styles with a xkeyval command?:
tikzsetNode Options/.style/.expand once=csuseMy Node Option
but that leads to a
Package pgfkeys Error: I do not know the key '/tikz/draw=red, thick, fill=yellow' and I am going to ignore it. Perhaps you misspelled it.
The desired result is to modify only the tikzset
in the MWE and obtain:
Code:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
tikzsetNode Options/.style/.expand once=csuseMy Node Option%% ????
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
tikz-pgf tikz-styles expansion etoolbox
I need to store tikz
option in a csdef
:
csdefMy Node Optiondraw=red, thick, fill=yellow
How do I use this definition to define a style via tikzset
?
I attempted to use .expand once
as per How do I define tikz styles with a xkeyval command?:
tikzsetNode Options/.style/.expand once=csuseMy Node Option
but that leads to a
Package pgfkeys Error: I do not know the key '/tikz/draw=red, thick, fill=yellow' and I am going to ignore it. Perhaps you misspelled it.
The desired result is to modify only the tikzset
in the MWE and obtain:
Code:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
tikzsetNode Options/.style/.expand once=csuseMy Node Option%% ????
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
tikz-pgf tikz-styles expansion etoolbox
tikz-pgf tikz-styles expansion etoolbox
asked 49 mins ago
Peter Grill
161k24430736
161k24430736
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
You can use expanded
instead of expand once
in your MWE:
tikzsetNode Options/.style/.expanded=csuseMy Node Option%% ????
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
add a comment |Â
up vote
2
down vote
You can use the begingroupedefxendgroup <stuff to expand>x
expansion trick:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
begingroupedefxendgroup
noexpandtikzsetNode Options/.style=csuseMy Node Option%
x
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
Note the additional braces around the csuse
.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You can use expanded
instead of expand once
in your MWE:
tikzsetNode Options/.style/.expanded=csuseMy Node Option%% ????
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
add a comment |Â
up vote
3
down vote
accepted
You can use expanded
instead of expand once
in your MWE:
tikzsetNode Options/.style/.expanded=csuseMy Node Option%% ????
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You can use expanded
instead of expand once
in your MWE:
tikzsetNode Options/.style/.expanded=csuseMy Node Option%% ????
You can use expanded
instead of expand once
in your MWE:
tikzsetNode Options/.style/.expanded=csuseMy Node Option%% ????
answered 27 mins ago
corporal
58125
58125
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
add a comment |Â
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
+1 It's better to give a complete minimal working example as an answer to show that your solution works, but I agree that this does work and hence that this is probably the preferred tikz solution.
â Andrew
20 mins ago
add a comment |Â
up vote
2
down vote
You can use the begingroupedefxendgroup <stuff to expand>x
expansion trick:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
begingroupedefxendgroup
noexpandtikzsetNode Options/.style=csuseMy Node Option%
x
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
Note the additional braces around the csuse
.
add a comment |Â
up vote
2
down vote
You can use the begingroupedefxendgroup <stuff to expand>x
expansion trick:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
begingroupedefxendgroup
noexpandtikzsetNode Options/.style=csuseMy Node Option%
x
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
Note the additional braces around the csuse
.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You can use the begingroupedefxendgroup <stuff to expand>x
expansion trick:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
begingroupedefxendgroup
noexpandtikzsetNode Options/.style=csuseMy Node Option%
x
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
Note the additional braces around the csuse
.
You can use the begingroupedefxendgroup <stuff to expand>x
expansion trick:
documentclassarticle
usepackagetikz
usepackageetoolbox
begindocument
csdefMy Node Optiondraw=red, thick, fill=yellow
noindent
begintikzpicture
begingroupedefxendgroup
noexpandtikzsetNode Options/.style=csuseMy Node Option%
x
node [Node Options] at (0,0) Node Text;
endtikzpicture%
enddocument
Note the additional braces around the csuse
.
answered 30 mins ago
Werner
427k589361609
427k589361609
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457429%2fexpanding-macro-to-define-tikzset%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password