Following is a detailed description on how the KnotPlot script was used to generate the files on this page. Example shown is for letter size paper. See the note (right) about printing to A4 paper. If you're only generating an EPS file for inclusion in another document, then you don't need to worry about setting the pagesize.
Run KnotPlot in non-graphics mode to generate the EPS file.
knotplot -nog < TangleF.kps
One could instead run KnotPlot in graphics mode and enter the following command into the KnotPlot Command Window
We now have the file TangleF.eps which could be printed directly on a PostScript printer. For printing to a non-PostScript printer, generate a PDF file TangleF.pdf from the EPS file TangleF.eps using Ghostscript.
# Note: enter the following three lines on one command line gs -dCompatibilityLevel=1.3 -q -dNOPAUSE -dBATCH -sPAPERSIZE=letter -sDEVICE=pdfwrite -sOutputFile=TangleF.pdf -c .setpdfwrite -f TangleF.eps
The remainder of this example shows how the preview image seen above was created. This is useful for including an image on a web page or in a presentation. Printing the EPS or PDF file will give much higher quality than printing the preview image. These files, TangleF.eps and TangleF.pdf, as well as their counterparts for A4 paper, TangleF_a4.eps and TangleF_a4.pdf, can be downloaded using the links in the right hand panel on this page.
# run Ghostscript to generate a temporary PPM file # Note: enter the following two lines on one command line gs -q -dNOPAUSE -dBATCH -sPAPERSIZE=letter -sDEVICE=ppmraw -sOutputFile=TangleF.ppm -r200 -f TangleF.eps # scale it down using ImageMagick convert command convert -resize 600x TangleF.ppm TangleFS.ppm # reduce the number of distinct colours and create the gif convert -colors 32 TangleFS.ppm TangleF.gif # delete temporary files /bin/rm TangleF.ppm TangleFS.ppm
KnotPlot script that generated the Encapsulated PostScript (EPS) file:
% KnotPlot script: TangleF.kps
% Sat 15 Mar 2014 18:24:32 UTC
% Tangle Calculator Example
% to read about tangles, go to:
fitto radius 30
% colour components using named colours
% colour names are case and space insensitive in KnotPlot
colour 0 "Shocking Pink"
% ShockingPink, shockingpink or sHocKINGpINK would also work
colour 1 RobinEggBlue
% "Robin Egg Blue" or robineggblue would also work
colour 2 chartreuse
colour 3 brown
% for a list of named colours, look in the file `colours.txt'
% in the KnotPlot `resource' directory under the KnotPlot home
% most common colour names such as red, orange, yellow, green,
% blue, purple, cyan, magenta, white, black and brown are available,
% along with many others inherited from the X11 colour database
psoption clip circ 0 25
psoption frame circ 0 25
psoption frame linewidth 1
psoption phantom -25 -25 25 25
% End of KnotPlot script
This script generates a EPS file (download below) suitable for printing on letter size paper. For printing on A4 size paper, use the command psop pagesize a4 prior to the psout command.
Download a high quality PDF or EPS file (for either letter or A4 size paper):
The PDF files and the preview image seen on this page were generated from the EPS files using Ghostscript (details in left panel on this page).