Skip to content

Instantly share code, notes, and snippets.

@kirel
Created June 24, 2009 10:28
Show Gist options
  • Select an option

  • Save kirel/135141 to your computer and use it in GitHub Desktop.

Select an option

Save kirel/135141 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'cgi'
require 'restclient'
require 'rmagick'
MATHTRAN = "http://www.mathtran.org/cgi-bin/mathtran"
def get tex
RestClient.get("#{MATHTRAN}?tex=#{CGI::escape(tex)}")
end
open 'http://www.ctan.org/get/info/symbols/comprehensive/SYMLIST' do |list|
symbols = list.readlines.map(&:strip)
works, out = symbols.partition do |symbol|
puts "checking #{symbol}"
png = Magick::Image.from_blob(get(symbol)).first
(png.columns != 1) || (png.rows != 1)
end
puts "*** Working symbols"
p works
puts "*** Not working"
p out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment