# This small script makes tioga.sty and lib/TexPreamble.rb from # tioga.sty.in require 'date' # We make up the color constants from the Tioga file. require './lib/ColorConstants.rb' # Generate colors color_specs = "% Color constants, generated from ColorConstants.rb\n" for const in Tioga::ColorConstants.constants r,g,b = *Tioga::ColorConstants.const_get(const) color_spec = sprintf "{%0.3f,%0.3f,%0.3f}", r,g,b color_specs += "\\definecolor{#{const}}{rgb}#{color_spec}\n" end # slurp up the lines from tioga.sty.in i = File.open("tioga.sty.in") lines = i.readlines i.close puts "Generating lib/TexPreamble.rb" out = File.open("lib/TexPreamble.rb", "w") out.print <