import glob

with open("all_rules.tex", 'w') as f:
    for inp in sorted(glob.glob("*.eps")):
        f.write(open("template.tex", 'r').read().replace("FILE", inp).replace("NAME", inp[5:-4].replace("_", " ")))
