# Knot package: crossings lost again

Basically I have the same problem as someone else in the question Crossings not appearing for small knots drawn using TikZ.

I wanted to make a knot smaller and have thicker lines (thick or very thick): My result is visible on the left side of the picture. On the right the crossings are fine and as they should be. I played around with end tolerance=1pt and ignore endpoint intersections=false, but it does not work so far.

\documentclass[12pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes,decorations.markings,knots}
\begin{document}
\begin{tikzpicture}
\path (-1.2,-2.2)--(1.7,2.2);
\begin{knot}[
scale=0.8,
draft mode=crossings,
consider self intersections=true,
clip  width=1,
flip crossing=6,
flip crossing=4,
flip crossing=7,
flip crossing=2,
line width=2pt,
onlywhenrendering/.style={
draw=white,
double=black,
doubledistance=6pt,
linecap=round,
},
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1]
(1,-1) --
(-1,-1) to [out=180,in=180,looseness=1]
(-1,1.5) to [out=0,in=90,looseness=1]
(0.5,0.5) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,0.5) to[out=90,in=180,looseness=1]
(1,1.5)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{$8_{17}$};
\begin{scope}[xshift=4cm]
\begin{knot}[
consider self intersections=true,
clip  width=2,
flip crossing=1,
flip crossing=3,
flip crossing=5,
flip crossing=8,
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1]
(1,-1.5) --
(-1,-1.5) to [out=180,in=180,looseness=1]
(-1,2) to [out=0,in=90,looseness=1]
(0.5,1) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,1) to[out=90,in=180,looseness=1]
(1,2)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{Mirror image of $8_{17}$};
\end{scope}
\end{tikzpicture}

\end{document}


I don't know if this is still a relevant question, but here goes with an answer anyway. I'm sorry that I didn't spot this question before (I'm not as active here as I used to be).

Anyway, there are a few issues with your code. One is the disregard for spaces! They're quite important. So I've fixed them.

Then there's the line cap=round. This was doing weird things at the start-end point of your knot. So that's gone, too.

The main thing was that all crossings were very close to end points of segments in your strand. So you needed ignore endpoint intersections=false. The end tolerance key doesn't seem to make a difference in your picture, but because your crossings are very close together then the clip radius and clip width have to be carefully set.

Here's what I ended up with after a bit of playing with the numbers.

\documentclass[12pt]{standalone}
%\url{http://tex.stackexchange.com/q/241258/86}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes,decorations.markings,knots}

\begin{document}
\begin{tikzpicture}
\path (-1.2,-2.2)--(1.7,2.2);
\begin{knot}[
scale=0.8,
%draft mode=crossings,
consider self intersections=true,
ignore endpoint intersections=false,
%end tolerance=1pt,
clip width=1,
flip crossing=6,
flip crossing=4,
flip crossing=7,
flip crossing=2,
line width=2pt,
only when rendering/.style={
white,
double=black,
double distance=6pt,
},
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1]
(1,-1) --
(-1,-1) to [out=180,in=180,looseness=1]
(-1,1.5) to [out=0,in=90,looseness=1]
(0.5,0.5) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,0.5) to[out=90,in=180,looseness=1]
(1,1.5)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{$8_{17}$};
\begin{scope}[xshift=4cm]
\begin{knot}[
consider self intersections=true,
clip width=2,
flip crossing=1,
flip crossing=3,
flip crossing=5,
flip crossing=8,
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1]
(1,-1.5) --
(-1,-1.5) to [out=180,in=180,looseness=1]
(-1,2) to [out=0,in=90,looseness=1]
(0.5,1) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,1) to[out=90,in=180,looseness=1]
(1,2)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{Mirror image of $8_{17}$};
\end{scope}
\end{tikzpicture}

\end{document}