Quoting Hans Hagen
Aditya Mahajan wrote:
Hi,
There is a bug in texutil.rb Here is a simple test. Create test.tex
strange indeed, mayb esome leftover from the perl version
fixed; thanks
The to_i in def MyExtras::writer also looks suspicious. The tuo file has wrong information % programs: 2 % % echo "test" (echo "test") % echo "test again" (echo "test") I think that def MyExtras::writer can be simplified to def MyExtras::writer(logger,handle) handle << logger.banner("programs: #{@@programs.size}") @@programs.each do |p| # handle << "% #{p} (#{@@programs[p.to_i]})\n" handle << "% #{p}\n" end end or maybe the slightly more informative def MyExtras::writer(logger,handle) handle << logger.banner("programs: #{@@programs.size}") @@programs.each_with_index do |cmd, p| # handle << "% #{p} (#{@@programs[p.to_i]})\n" handle << "% #{p+1} (#{cmd})\n" end end BTW, using p as a variable name is not a good idea in ruby. p prints out the output of inspect, and is useful while debugging programs. Compare a = /ad?/ b = a.match("Dad") puts b p b puts b.inspect Aditya