2

I wish to remove parts of the letter outside the contour that forms the shape of the brain below.

enter image description here

\documentclass[10pt]{standalone}
\usepackage{pgf,tikz}
\usepackage{libertine}

\begin{document}

 \begin{tikzpicture}

 \draw(11.61697,6.215) node {\scalebox{13.6}{\color{purple!77}math} \scalebox{6.915}{\color{gray}\&} };
 \draw(11.7,3) node {\scalebox{14.7}{\color{gray} physics}};
 \draw(10.7,.32) node {\scalebox{8.59}{\color{cyan!96}MATTER}};


 \draw[ line width=1.2mm] plot [smooth,tension=.6] coordinates { (11.611676609979014,-1.1158187173456824)  
    (12.557159646551849,-0.845680706896301)  
    (13.603944437043202,-0.6768444503654376)  
    (14.397474842738259,-0.42359006556914264)  
    (15.258539751045662,-0.1703356807728476)  
    (16.27155729023084,-0.10280117816050227) 
    (17.16638944984442,-0.20410293207902028) 
    (18.07810523511108,-0.13656842946667494)  
    (18.922286517765396,0.25175496055431074)  
    (19.445678913011072,1.2141216227802318)  
    (19.51321341562342,2.277790038924671)  
    (18.82098476384688,3.5778292142123185)  
    (18.230057865988858,4.371359619907376)  
    (17.740432722049352,4.793450261234534)  
    (17.520945588559233,5.418144410398729) 
    (16.778066059823434,5.840235051725887)  
    (16.305324541537015,6.38051107262465)  
    (15.579328638454303,6.6675327087271175)  
    (14.566311099269123,7.089623350054276)  
    (13.51952630877777,7.342877734850571) 
    (12.50650876959259,7.477946740075262)  
    (11.594792984325927,7.477946740075262)  
    (10.649309947753093,7.410412237462917)  
    (9.602525157261741,7.224692355278967)  
    (8.623274869382733,7.055856098748103)  
    (7.863511714993848,6.785718088298722)  
    (6.884261427114841,6.5493473291555135) 
    (5.9050111392358335,5.87400230303206)  
    (5.195898861806207,5.36749353343947)  
    (4.554321086988926,4.371359619907376)  
    (4.250415825233373,3.999919855539477)  
    (3.9465105634778186,3.6622473424777504)  
    (3.7945579326000414,3.0206695676604696)  
    (3.8452088095593004,2.3284409158839297)  
    (3.980277814783991,1.7712812693320807) 
    (4.047812317396336,1.3998415049641815) 
    (4.2166485739272,1.0115181149431958)  
    (4.3686012048049765,0.7413801044938144)  
    (4.571204712642013,0.23487133490122442) 
    (4.959528102662999,-0.1703356807728476)  
    (5.398502369643244,-0.47424094252840165)  
    (6.006312893154352,-0.5755426964469197) 
    (6.61412341666546,-0.5248918194876606)  
    (7.25570119148274,-0.47424094252840165)  
    (7.812860838034589,-0.6937280760185239)  
    (8.150533351096316,-1.1327023429987686)  
    (8.707692997648165,-1.5716766099790134)  
    (9.315503521159274,-1.8924654973876538)  
    (10.,-2.) 
    (10.919447958202474,-1.605443861285186) (11.611676609979014,-1.1158187173456824) };

 \end{tikzpicture}

\end{document}
Epa
  • 3,449
  • 1
    \clip followed by the curve. IIRC you cannot use \draw[clip] or \clip[draw]; but there is a fix on this site. – Symbol 1 Feb 10 '19 at 03:44
  • The options color=blue, fill=gray in plot [smooth,tension=.6, color=blue, fill=gray,] have no effect, please move them to the options of the path. –  Feb 10 '19 at 03:46

1 Answers1

3

As pointed out by Symbol 1, you can use \clip for that. A slight subtlety is that clip cannot be used with other options. So you need to use the path twice. There are many possibilities to handle this, one of them is to use the use path trick which allows one to recycle paths. Other minor points are that you were passing options to plot which should be put into the path, and that you need to add the nodes after the clip. Of course, I will be happy to remove this if Symbol 1 posts an answer.

\documentclass[10pt]{standalone}
\usepackage{tikz}
\usepackage{libertine}
\makeatletter % from https://tex.stackexchange.com/a/127045/121799
\tikzset{use path/.code=\tikz@addmode{\pgfsyssoftpath@setcurrentpath#1}}
\makeatother

\begin{document}

\begin{tikzpicture}
 \draw[line width=1.2mm, color=blue, fill=gray!20,save path=\pathA] plot [smooth,tension=.6] coordinates { (11.611676609979014,-1.1158187173456824)  
    (12.557159646551849,-0.845680706896301)  
    (13.603944437043202,-0.6768444503654376)  
    (14.397474842738259,-0.42359006556914264)  
    (15.258539751045662,-0.1703356807728476)  
    (16.27155729023084,-0.10280117816050227) 
    (17.16638944984442,-0.20410293207902028) 
    (18.07810523511108,-0.13656842946667494)  
    (18.922286517765396,0.25175496055431074)  
    (19.445678913011072,1.2141216227802318)  
    (19.51321341562342,2.277790038924671)  
    (18.82098476384688,3.5778292142123185)  
    (18.230057865988858,4.371359619907376)  
    (17.740432722049352,4.793450261234534)  
    (17.520945588559233,5.418144410398729) 
    (16.778066059823434,5.840235051725887)  
    (16.305324541537015,6.38051107262465)  
    (15.579328638454303,6.6675327087271175)  
    (14.566311099269123,7.089623350054276)  
    (13.51952630877777,7.342877734850571) 
    (12.50650876959259,7.477946740075262)  
    (11.594792984325927,7.477946740075262)  
    (10.649309947753093,7.410412237462917)  
    (9.602525157261741,7.224692355278967)  
    (8.623274869382733,7.055856098748103)  
    (7.863511714993848,6.785718088298722)  
    (6.884261427114841,6.5493473291555135) 
    (5.9050111392358335,5.87400230303206)  
    (5.195898861806207,5.36749353343947)  
    (4.554321086988926,4.371359619907376)  
    (4.250415825233373,3.999919855539477)  
    (3.9465105634778186,3.6622473424777504)  
    (3.7945579326000414,3.0206695676604696)  
    (3.8452088095593004,2.3284409158839297)  
    (3.980277814783991,1.7712812693320807) 
    (4.047812317396336,1.3998415049641815) 
    (4.2166485739272,1.0115181149431958)  
    (4.3686012048049765,0.7413801044938144)  
    (4.571204712642013,0.23487133490122442) 
    (4.959528102662999,-0.1703356807728476)  
    (5.398502369643244,-0.47424094252840165)  
    (6.006312893154352,-0.5755426964469197) 
    (6.61412341666546,-0.5248918194876606)  
    (7.25570119148274,-0.47424094252840165)  
    (7.812860838034589,-0.6937280760185239)  
    (8.150533351096316,-1.1327023429987686)  
    (8.707692997648165,-1.5716766099790134)  
    (9.315503521159274,-1.8924654973876538)  
    (10.,-2.) 
    (10.919447958202474,-1.605443861285186) (11.611676609979014,-1.1158187173456824) };
   \clip[use path=\pathA];
   \draw(11.61697,6.215) node {\scalebox{13.6}{\color{purple!77}math} \scalebox{6.915}{\color{gray}\&} };
   \draw(11.7,3) node {\scalebox{14.7}{\color{gray} physics}};
   \draw(10.7,.32) node {\scalebox{8.59}{\color{cyan!96}MATTER}};

 \end{tikzpicture}

\end{document}

enter image description here

  • The spath.sty is NOT found in my Texlive 2018. I resort to the texlive manager and load the package but only spath3 is there. I installed this spath3 but I failed. Can you add an answer without spath? – Epa Feb 10 '19 at 05:37
  • 1
    @Thumbolt I am really sorry. I fixed it. –  Feb 10 '19 at 05:45