Guest User

Untitled

a guest
Oct 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. % RequirePackage{atbegshi}AtBeginShipoutInit
  2. documentclass{article}
  3. usepackage{tikz}
  4.  
  5. usepackage{pgfkeys}
  6. % Define the used keys in the following document
  7. pgfkeys{
  8. /myKeys/.is family, /myKeys,
  9. default/.style =
  10. {
  11. width = 1cm,
  12. my tikz commands={},
  13. },
  14. width/.estore in = kWidth,
  15. my tikz commands/.estore in = kTikzCommands
  16. }
  17.  
  18. % This work, but is dirty
  19. newcommand{myRectangle}[1][]{%
  20. pgfkeys{/myKeys, default, #1}%
  21. edeftest{noexpandnode [draw, minimum width=kWidth, inner sep=0pt, shape=rectangle, very thick, color=red, minimum height=1cm, kTikzCommands] at (current page.center) {};}
  22. begin{tikzpicture}[remember picture,overlay]%
  23. test %
  24. end{tikzpicture}%
  25. }
  26.  
  27. % This does not work, and I'd like to make it work
  28. newcommand{myRectangleB}[1][]{%
  29. pgfkeys{/myKeys, default, #1}%
  30. begin{tikzpicture}[remember picture,overlay]%
  31. node [draw, minimum width=kWidth, inner sep=0pt, shape=rectangle, very thick, color=red, minimum height=1cm, kTikzCommands] at (current page.center) {};
  32. end{tikzpicture}%
  33. }
  34.  
  35.  
  36. begin{document}
  37.  
  38. % Ok
  39. myRectangle[width=10cm,my tikz commands={fill=blue, dashed}]
  40. % No ok
  41. myRectangleB[width=10cm,my tikz commands={fill=blue, dashed}]
  42.  
  43. end{document}
  44.  
  45. 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