5

How can I use LaTex (p.s. I use Mac OS 10.5.8 with TexShop 2.47) to draw strings with linking numbers or no linking numbers?

If any experts know any examples below, please feel free to comment. The answer needs not to completely solve everything.

Here are the three examples:

Fig. 1. No Link:

enter image description here

Fig. 2. Link = 1:

enter image description here

Fig. 3. Link = 2:

enter image description here

Fig. 4. Borromean Ring:

enter image description here

  • Please the answer can be as simple as possible, using tikz alone without unnecessary package is the best. Thank you. – wonderich Mar 26 '14 at 0:29
  • 1
    Please take a look at the knots library for TikZ. – Gonzalo Medina Mar 26 '14 at 1:31
  • I also found another helpful weblink: tex.blogoverflow.com/2013/04/… – wonderich Mar 26 '14 at 19:19
8

Here is an example of using the knots library as per Gonzalo Medina's suggestion:

enter image description here

If you comment out the draft mode=crossings you can see how the crossings are numbered, and then you use flip crossing=<num> to toggle each of the intersections.

Procedure:

For the other drawing it is just a matter of first \drawing the lines (which is independent of using the knots library. Then

  1. Move the code into the knot environment,
  2. Change the \draw to a \strand,
  3. Add the option draft mode=crossings to get the crossings numbered,
  4. Use flip crossing as desired to get the crossing at the appropriate "level", and
  5. Remove the draft mode=crossings.

Note that I used a circle shape but any arbitrary shape should work.

Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{knots}

\begin{document}
\centering
\begin{tikzpicture}
\begin{knot}[
    %draft mode=crossings ,
    clip width=3,
    flip crossing=1,
    flip crossing=2,
    ]
    \strand [ultra thick, red  ] (0,0) circle (1.0cm);
    \strand [ultra thick, black] (1,0) circle (1.0cm);
\end{knot}
\end{tikzpicture}
\hspace*{0.5cm}
\begin{tikzpicture}
\begin{knot}[
    %draft mode=crossings ,
    clip width=3,
    flip crossing={2},
    ]
    \strand [ultra thick, red  ] (0,0) circle (1.0cm);
    \strand [ultra thick, black] (1,0) circle (1.0cm);
\end{knot}
\end{tikzpicture} 

\begin{tikzpicture}
\begin{knot}[
    %draft mode=crossings ,
    clip width=4,
    ]
    \strand [ultra thick, blue ] (0,0) circle (1.0cm);
    \strand [ultra thick, red  ] (1,0) circle (1.0cm);
    \strand [ultra thick, green] (0.5,1) circle (1.0cm);
    \flipcrossings{1, 2, 5, 6}
\end{knot}
\end{tikzpicture} 
\end{document}
  • Dear Peter, thanks for the nice comment, let me try it. :-) – wonderich Mar 26 '14 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.