add LM 5 hw, caryatid
[light-and-matter.git] / scripts / before_each.rb
blob7f693fbba104e4e1c1c0bd8d00a887b46a14ffce
1 #!/usr/bin/ruby
3 require 'fileutils'
5 brief_toc_file = 'brief-toc.tex'
6 new_brief_toc_file = 'brief-toc-new.tex'
7 declare_graphics_extensions_file = 'declaregraphicsextensions.tex'
9 if !File.exists?(brief_toc_file) then
10   File.open(brief_toc_file,'w') { |f|
11     f.write "%\n"
12   }
13 end
15 if File.exists?(new_brief_toc_file) then
16   FileUtils.mv(new_brief_toc_file,brief_toc_file)
17 end
19 # graphics extensions for graphicx package
20 ext = ".pdf,.png,.jpg"
21 if ENV['PREPRESS']=="1" then
22   ext = ".png,.jpg,.pdf" # pdf is unreliable for RIP, sometimes even messes up in screen viewers
23 end
24 File.open(declare_graphics_extensions_file,'w') { |f|
25   f.write "\\DeclareGraphicsExtensions{#{ext}}\n"