Skip to content

Instantly share code, notes, and snippets.

@mh61503891
Created February 14, 2014 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mh61503891/9006257 to your computer and use it in GitHub Desktop.
Save mh61503891/9006257 to your computer and use it in GitHub Desktop.
LaTeX用のRakefile.rb
require 'rake'
require 'rake/clean'
TARGET = 'main'
TOOLS = {
latex:'platex -kanji=utf8',
bibtex:'pbibtex -kanji=utf8',
dvipdfmx:'dvipdfmx',
zip:'zip'
}
task default:[:pdf]
task :pdf do
sh("#{TOOLS[:latex]} #{TARGET}")
sh("#{TOOLS[:bibtex]} #{TARGET}")
sh("#{TOOLS[:latex]} #{TARGET}")
sh("#{TOOLS[:latex]} #{TARGET}")
sh("#{TOOLS[:dvipdfmx]} #{TARGET}")
end
task :package do
Rake::Task[:clobber].execute
Rake::Task[:pdf].execute
Rake::Task[:clean].execute
sh("#{TOOLS[:zip]} -r #{TARGET}.zip *")
end
CLEAN.include(%w{aux log dvi bbl blg toc lof lot fdb_latexmk fls out bb xbb}.map{|e|"**/*.#{e}"}+['**/.DS_Store'])
CLOBBER.include(%w{pdf zip}.map{|e| "#{TARGET}.#{e}"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment