Guest User

Untitled

a guest
Feb 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. ! Extra }, or forgotten endgroup.
  2. pgf@externalend ->unskip egroup egroup
  3. {def pgf@external@trim {0}def ...
  4. l.88 end{forest}
  5.  
  6. documentclass[a4paper,12pt, twoside,dvipsnames]{article}
  7.  
  8. usepackage[dvipsnames]{xcolor}
  9.  
  10. usepackage{tikz}
  11. usetikzlibrary{external}
  12. tikzexternalize[mode=list and make, prefix=ext-tikz/]
  13. usepackage[external]{forest}
  14.  
  15. usetikzlibrary{fadings, arrows.meta}
  16.  
  17.  
  18. makeatletter
  19. newififtikz@shading@path
  20.  
  21. tikzset{
  22. % There are three circumstances in which the fading sep is needed:
  23. % 1. Arrows which do not update the bounding box (which is most of them).
  24. % 2. Line caps/joins and mitres that extend outside the natural bounding
  25. % box of the path (these are not calculated by PGF).
  26. % 3. Other reasons that haven't been anticipated.
  27. fading xsep/.store in=pgfpathfadingxsep,
  28. fading ysep/.store in=pgfpathfadingysep,
  29. fading sep/.style={fading xsep=#1, fading ysep=#1},
  30. fading sep=0.0cm,
  31. shading path/.code={%
  32. % Prevent this stuff happning recursively.
  33. iftikz@shading@path%
  34. else%
  35. tikz@shading@pathtrue%
  36. % tikz@addmode installs the `modes' (e.g., fill, draw, shade)
  37. % to be applied to the path. It isn't usualy for doing more
  38. % changes to the path's construction.
  39. tikz@addmode{%
  40. pgfgetpathpgf@currentfadingpath%
  41. % Get the boudning box of the current path size including the fading sep
  42. pgfextract@processpgf@fadingpath@southwest{pgfpointadd{pgfqpoint{pgf@pathminx}{pgf@pathminy}}%
  43. {pgfpoint{-pgfpathfadingxsep}{-pgfpathfadingysep}}}%%
  44. pgfextract@processpgf@fadingpath@northeast{pgfpointadd{pgfqpoint{pgf@pathmaxx}{pgf@pathmaxy}}%
  45. {pgfpoint{pgfpathfadingxsep}{pgfpathfadingysep}}}%
  46. % Clear the path
  47. pgfsetpathpgfutil@empty%
  48. % Interrupt the path and picture to create a fading.
  49. pgfinterruptpath%
  50. pgfinterruptpicture%
  51. begin{tikzfadingfrompicture}[name=.]
  52. path [shade=none,fill=none, #1] pgfextra{%
  53. % Set the softpath. Any transformations in #1 will have no effect.
  54. % This will *not* update the bounding box...
  55. pgfsetpathpgf@currentfadingpath%
  56. % ...so it is done manually.
  57. pgf@fadingpath@southwest
  58. expandafterpgf@protocolsizes{thepgf@x}{thepgf@y}%
  59. pgf@fadingpath@northeast%
  60. expandafterpgf@protocolsizes{thepgf@x}{thepgf@y}%
  61. };
  62. % Now get the bounding of the picture.
  63. xdefpgf@fadingboundingbox@southwest{noexpandpgfqpoint{thepgf@picminx}{thepgf@picminy}}%
  64. xdefpgf@fadingboundingbox@northeast{noexpandpgfqpoint{thepgf@picmaxx}{thepgf@picmaxy}}%
  65. %
  66. end{tikzfadingfrompicture}%
  67. endpgfinterruptpicture%
  68. endpgfinterruptpath%
  69. % Install a rectangle that covers the shaded/faded path picture.
  70. pgfpathrectanglecorners{pgf@fadingboundingbox@southwest}{pgf@fadingboundingbox@northeast}%
  71. % Make the fading happen.
  72. deftikz@path@fading{.}%
  73. tikz@mode@fade@pathtrue%
  74. tikz@fade@adjustfalse%10pt
  75. % Shift the fading to the mid point of the rectangle
  76. pgfpointscale{0.5}{pgfpointadd{pgf@fadingboundingbox@southwest}{pgf@fadingboundingbox@northeast}}%
  77. edeftikz@fade@transform{shift={(thepgf@x,thepgf@y)}}%
  78. }%
  79. fi%
  80. }
  81. }
  82.  
  83. begin{document}
  84.  
  85. begingroup
  86. centering
  87. begin{forest}
  88. [, phantom, for children={fit=band}, s sep'+=60pt
  89. [ 2, name=l1 ]
  90. [ 2, name=r1 ]
  91. ]
  92. path [left color=orange, right color=MidnightBlue, shading path={draw=transparent!0, dashed, -Latex}] (l1) .. controls ++(0,-1) and ++(0,-1) .. (r1);
  93. end{forest}
  94. endgroup
  95.  
  96. end{document}
Add Comment
Please, Sign In to add comment