Update 2021-02-07: I've now uploaded an extension to my spath3
package which provides yet another way to draw knots and links using TikZ. (This isn't a replacement for the original knots
package, that is still being maintained.)
Here's some example code and rendering, for more see the package documentation.
\documentclass{article}
%\url{https://tex.stackexchange.com/q/17181/86}
\usepackage{tikz}
\usetikzlibrary{spath3, intersections, hobby}
\begin{document}
\begin{tikzpicture}[
use Hobby shortcut,
every trefoil component/.style={ultra thick, draw, red},
trefoil component 1/.style={blue},
]
\path[spath/save=trefoil] ([closed]90:2) foreach \k in {1,...,3} { .. (-30+\k*240:.5) .. (90+\k*240:2) } (90:2);
\tikzset{spath/knot={trefoil}{8pt}{1,3,5}}
\end{tikzpicture}
\end{document}
Update 2013-04-22: I've now uploaded a TikZ library to CTAN expressly for the purpose of drawing knots. It is already in MikTeX (according to CTAN), TeXLive might have to wait until TL2013 has been released. It is released as part of the spath3
library. Here's the link to CTAN. The hobby
package also contains some useful code for drawing knots. For drawing braids, there's the braids
package. And here's a short blog post I wrote explaining the variety of methods, and a slightly more detailed tutorial. The package was inspired by a question on TeX-SX and now has its own tag tikz-knots.
This is a follow-up to Niels' answer, namely to use TikZ. I've recently had occasion to draw a few knots and links using TikZ and have quite a workable system. I'll not post code here (ask by email or on http://tex.stackexchange.com if you want). Using it, I can produce SVGs (as evidenced by some nLab pages: http://ncatlab.org/nlab/show/Borromean+link, http://ncatlab.org/nlab/show/Whitehead+link, and some others) as well as PDFs, PNGs, and so forth. As an example, here's the trefoil knot:
(source: Wayback Machine)