def render_latex song template = tex_template 'song' templated = template.result binding File.write(tmp(song_tex song.id), templated) end def render_pdf song render_latex song system "lualatex --shell-escape -output-directory=#{TmpDir}/#{SongsDir} #{tmp (song_tex song.id)}" system "mv #{tmp (song_pdf song.id)} #{build (song_pdf song.id)}" end def make_pdfs songs songs.each_value do |song| render_pdf song end end