l

linkst

@preview

A knot drawing package for knot theory.

v0.2.1
MIT-0

Package Information

Last Updated
Categories
visualization

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/linkst:0.2.1

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/linkst:0.2.1": *

Version History

0.2.1
24dbd33e9920...
0.1.0
40f6fa19d0fa...

Linkst

Introduction

Linkst is a Typst package for drawing knots in knot theory.
Since the package is new, formal documentation is limited.
For examples of all available features, check the example files:
examples/node.typ, examples/edge.typ, and examples/knot.typ

#import "@preview/linkst:0.2.1": *

// Example of drawing a trefoil knot:

#let trefoil = knot(
  node(0, 0, connect: ((0, 1), (2, 3, true))),
  node(2, 0, connect: ((0, 1, true), (2, 3))),
  node(1, calc.sqrt(3), connect: ((0, 3, true), (1, 2))),
  
  edge(0, 1, bezier-rel: (0, 0.2), stroke: red),
  edge(2, 0, bezier-rel: ((-0.7, 1), (0.7, 1),), stroke: red),
  edge(2, 0, bezier-rel: (0, 0.2), stroke: blue),
  edge(1, 2, bezier-rel: ((-0.7, 1), (0.7, 1),), stroke: blue),
  edge(1, 2, bezier-rel: (0, 0.2), stroke: green),
  edge(0, 1, bezier-rel: ((-0.7, 1), (0.7, 1),), stroke: green),

  style: (
    stroke: 3pt,
    scale: 0.8,
    bridge-space: 0.6,
    transform: ((-1, -calc.sqrt(3) / 3),),
  )
)

#draw(trefoil)
Random Knot Trefoil Knot Layer Function
Random Knot Trefoil Knot Layer Function
Wild Trefoils Bridge Types Avocado
Wild Trefoils Bridge Types Avocado
Hopf Link Wild Knot Figure Eight
Hopf Link Wild Knot Figure Eight