1

I am unable to add a background to the pic on the left, matching that on the right. Here is what I have so far:

\documentclass[11pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{decorations.markings, arrows.meta,knots}
\begin{document}
\begin{tikzpicture}[pics/arrow/.style={code={%
  \draw[line width=0pt,{Computer Modern Rightarrow[line width=0.8pt,width=2ex,length=1ex]}-(-0.5ex,0) -- (0.5ex,0);}}, scale=0.5]
  \fill[gray!20!white] (0.25,1)circle(1.2); 
  \begin{knot}[clip width=10, clip radius=15pt, consider self intersections, end tolerance=3pt, fill=gray!20!white, fill opacity=0.5]
   \strand[thick] (0,0)
      to[out=up, in=down] (0,0.7) 
      to[out=up, in=left] (0.5,1.5)
      to[out=right, in=up]  pic[pos=0.5,sloped]{arrow}(1,1)
      to[out=down, in=right]  (0.5,0.5)
      to[out=left, in=down]  (0,1.3)
      to[out=up, in=down]  (0,2);
 \end{knot}
 %\fill[gray!20!white, opacity=0.5] (0.25,1)circle(1.2);
\end{tikzpicture}
= 
\begin{tikzpicture}[scale=0.4]
  \clip (0,0)circle(1.2);
  \fill[gray!20!white] (0,0)circle(1.2);
  \draw[thick, decoration={markings, mark=at position 0.2 with {\arrow{<}}},postaction {decorate}] (0,-1) --(0,1);
\end{tikzpicture}
\end{document}

enter image description here

As you can see, the "fill" in \begin{knot} does not seem to have any effect. Moving the \fill from the top to after the knot is not satisfactory either: enter image description here

1 Answer 1

3

You might be looking for background color.

\documentclass[11pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{decorations.markings, arrows.meta,knots}
\begin{document}
$\vcenter{\hbox{\begin{tikzpicture}[pics/arrow/.style={code={%
  \draw[line width=0pt,{Computer Modern Rightarrow[line
  width=0.8pt,width=2ex,length=1ex]}-] (-0.5ex,0) -- (0.5ex,0);}}, scale=0.5]
  \fill[gray!20!white] (0.25,1)circle[radius=1.2]; 
  \begin{knot}[clip width=10, clip radius=15pt, consider self intersections, end tolerance=3pt, 
  background color=gray!20!white%, fill opacity=0.5 %<- no effect
  ]
   \strand[thick] (0,0)
      to[out=up, in=down] (0,0.7) 
      to[out=up, in=left] (0.5,1.5)
      to[out=right, in=up]  pic[pos=0.5,sloped]{arrow}(1,1)
      to[out=down, in=right]  (0.5,0.5)
      to[out=left, in=down]  (0,1.3)
      to[out=up, in=down]  (0,2);
 \end{knot}
 %\fill[gray!20!white, opacity=0.5] (0.25,1)circle(1.2);
\end{tikzpicture}}}
= 
\vcenter{\hbox{\begin{tikzpicture}[scale=0.4]
  \clip (0,0)circle(1.2);
  \fill[gray!20!white] (0,0) circle[radius=1.2];
  \draw[thick, 
  decoration={markings, mark=at position 0.2 with {\arrow{<}}},
  postaction={decorate}] (0,-1) --(0,1);
\end{tikzpicture}}}$
\end{document}

enter image description here

1
  • The above question and answer code used to work in 2020 but it does not work with the latest version of knots package. It might be a bug in the latest version of the package. Any advice on how to fix it will be greatly appreciated.
    – Adam
    Mar 27 at 17:06

You must log in to answer this question.

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