Created
February 14, 2014 18:25
-
-
Save mh61503891/9006257 to your computer and use it in GitHub Desktop.
LaTeX用のRakefile.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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