13

I'm interested in intertwining two letters that are labels of two nodes; or converting the shape of the letters to two paths (much like the feature in Inkscape with the same name) which I can then intertwine like in this example of the Borromean rings: http://www.texample.net/tikz/examples/borromean-rings/

Here's my MWE:

\begin{tikzpicture}
\fill[gray!60] (0,0) circle (2);
 \node[color=black!80] 
at (0.25,-0.25) 
{\fontsize{60}{20}\fontfamily{ppl}\fontseries{b}\selectfont C};
\node[color=yellow!50] 
at (-0.25,0.25) 
{\fontsize{60}{20}\fontfamily{ppl}\fontseries{b}\selectfont Q};
\end{tikzpicture}

What I want is for the C to "pass above" the Q on the uppermost intersection, while it passes below it on the lower one. I attach a picture of what I want, made haphazardly with Pinta.

Desired result.

2 Answers 2

18

Not a general solution, but you could just draw the black letter twice, but clip it the second time so that only the part that you want is drawn:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \fill[gray!60] (0,0) circle (2);
  \node[color=black!80, font=\fontsize{60}{20}\fontfamily{ppl}\fontseries{b}\selectfont]
    at (0.25,-0.25) {C};
  \node[color=yellow!50, font=\fontsize{60}{20}\fontfamily{ppl}\fontseries{b}\selectfont] 
    at (-0.25,0.25) {Q};
  \clip (0,0) -- (0:2) arc (0:90:2) -- cycle;
  \node[color=black!80, font=\fontsize{60}{20}\fontfamily{ppl}\fontseries{b}\selectfont]
    at (0.25,-0.25) {C};
\end{tikzpicture}
\end{document}

output

1
  • 1
    Quite elegant! Thank you! Commented Mar 3, 2020 at 16:44
14

This is just a minor addendum to David Purton's nice answer. Some may feel more comfortable just specifying how much of the character should be cut. As long as this is some distance from either of its boundaries, trimclip can do the job (and in principle you would not need tikz then). And it is usually a good idea to use the font or node font key to set the font, and circle[radius=2] instead of circle(2).

\documentclass[tikz,border=3mm]{standalone}
\usepackage{trimclip}
\begin{document}
\begin{tikzpicture}[node font=\fontsize{60}{20}\fontfamily{ppl}\fontseries{b}\selectfont]
 \fill[gray!60] (0,0) circle[radius=2];
 \node[color=black!80,below] at (0.25,1.25) {C};
 \node[color=yellow!50] at (-0.25,0.25) {Q};
 \node[color=black!80,below] at (0.25,1.25) {\clipbox{0em 0.5em 0em 0em}{C}};
\end{tikzpicture}
\end{document}

enter image description here

1
  • I would still have to figure out how \clipbox works, but this looks rather nicer and more compact. Thanks! Commented Mar 3, 2020 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .