Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % RequirePackage{atbegshi}AtBeginShipoutInit
- documentclass{article}
- usepackage{tikz}
- usepackage{pgfkeys}
- % Define the used keys in the following document
- pgfkeys{
- /myKeys/.is family, /myKeys,
- default/.style =
- {
- width = 1cm,
- my tikz commands={},
- },
- width/.estore in = kWidth,
- my tikz commands/.estore in = kTikzCommands
- }
- % This work, but is dirty
- newcommand{myRectangle}[1][]{%
- pgfkeys{/myKeys, default, #1}%
- edeftest{noexpandnode [draw, minimum width=kWidth, inner sep=0pt, shape=rectangle, very thick, color=red, minimum height=1cm, kTikzCommands] at (current page.center) {};}
- begin{tikzpicture}[remember picture,overlay]%
- test %
- end{tikzpicture}%
- }
- % This does not work, and I'd like to make it work
- newcommand{myRectangleB}[1][]{%
- pgfkeys{/myKeys, default, #1}%
- begin{tikzpicture}[remember picture,overlay]%
- node [draw, minimum width=kWidth, inner sep=0pt, shape=rectangle, very thick, color=red, minimum height=1cm, kTikzCommands] at (current page.center) {};
- end{tikzpicture}%
- }
- begin{document}
- % Ok
- myRectangle[width=10cm,my tikz commands={fill=blue, dashed}]
- % No ok
- myRectangleB[width=10cm,my tikz commands={fill=blue, dashed}]
- end{document}
- ERROR: Package pgfkeys Error: I do not know the key '/tikz/fill=blue, dashed' and I am going to ignore it. Perhaps you misspelled it.
Add Comment
Please, Sign In to add comment