TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This two questions have been answered separatly it should be interesting to be able to shade a region using previously named pathes. Is there a possibility to combine this two macros ?

enter image description here


%%%% Tikz: shading region bounded by several curves
%%%% thanks to Qrrbrbirlbel
%%%% http://tex.stackexchange.com/questions/140312/tikz-shading-region-bounded-by-several-curves
  saveuse path/.code 2 args={
    \pgfkeysalso{#1/.style={insert path={#2}}}%
    \global\expandafter\let\csname pgfk@\pgfkeyscurrentpath/.@cmd%
      % not optimal as it is now global through out the document
    \csname pgfk@\pgfkeyscurrentpath/.@cmd\endcsname
    \pgfkeysalso{#1}},/pgf/math set seed/.code=\pgfmathsetseed{#1}

%%%% Calling a previously named path in tikz
%%%% thanks to Andrew Stacey
%%%% http://tex.stackexchange.com/questions/26382/calling-a-previously-named-path-in-tikz
  use path for main/.code={%
      \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname
  use path for actions/.code={%
    \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}%
  use path/.style={%
    use path for main=#1,
    use path for actions=#1,



\path[name path={Rond}] (0,0) circle (.5) ;
\draw[use path=Rond] ;

\clip[saveuse path={A}{(0,0) circle (1.5)}] [preaction={fill=red!30}] ;
\path[saveuse path={B}{(0,0) circle (1 and 2)},dashed] [draw,preaction={fill=blue!30}];

\path[A,B] ;

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.