neil's webbly world
Academic Pages

Other Information

Useful information may be found here. I take no responsibility for its completeness or accuracy.

LaTeX Oddments

  • RGB Colours

    Using the color package is fun, especially for slides and colouring charts and tables (although not too many colours!). But there are only eight standard named colours---black, white, red, green, blue, yellow, cyan, magenta---for other colours you need to define them using either the gray, rgb or cmyk colour models. Not very readable.

    So I wrote a little Tcl script which reads in the rgb.txt file that comes with X11 and generates a LaTeX file which defines all of the named colours (excluding the standard ones), ready for including into your LaTeX documents.

    Download a package which contains the Tcl script and the current file I use (generated from version 10.41 of rgb.txt):

    To use the script, place your local copy of the rgb.txt file in the same directory as allcolours.tcl and execute the script (you might need to change the location of your tclsh binary in the first line of the script; you might also need to make the script executable with chmod). The script sends its output to the standard output, so just pipe it to a file:

    allcolours.tcl > latexRGBcolours.tex

    To use the colour file, simply include the command:

    \input latexRGBcolours

    in your LaTeX file and then you can use all the named colours defined in the file. For example:


    Please note: this is a simple script which just works on the given input file. It does very little error checking.

    The Tcl script is free for any and all to use, share, enjoy, modify, eat, drink, smoke, feed to your pet lizard, whatever. It has been tested with Tcl version 8.3 running on Linux RedHat 7.1. YMMV.

Programming Languages

Electronic Music

Standards, Reference Material

Research-Oriented Compilers

Copyright © 2001-2024 Neil Johnson