forked from shearn89/ug4-report-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
43 lines (34 loc) · 1.01 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'rake/clean'
# Configuration
NAME = "report"
TEX_EXEC = "xelatex"
# Semi-Configuration
PDF_NAME = "#{NAME}.pdf"
TEX_NAME = "#{NAME}.tex"
DEFAULT_ARGS = "-shell-escape -interaction=nonstopmode -papersize=a4"
# Cleaning FileLists
CLEAN.include(['**/*.aux', '*.log', '*.out', '*.pyg', '*.bak', '*.toc', '*.bbl', '*.blg', '*.toc', '*.lof'])
CLOBBER.include('*.pdf')
task :default => [:build, :clean]
desc "Build the document"
task :build do
puts "Building the PDF... [#{TEX_NAME} => #{PDF_NAME}]"
latex DEFAULT_ARGS, TEX_NAME
`bibtex #{NAME}`
latex DEFAULT_ARGS, TEX_NAME
latex DEFAULT_ARGS, TEX_NAME
end
desc "Show the document"
task :view => [PDF_NAME] do
puts "Opening the PDF... [#{PDF_NAME}]"
["open", "okular", "kpdf", "acroread"].find do |viewer|
command viewer, PDF_NAME
end or
puts "Unable to find any pdf viewer."
end
desc "Start the kicker"
task :kick do
sh "kicker -e 'rake' report.tex sections"
end
# Load in the other tasks.
Dir.glob("tools/tasks/*.rake").each { |r| load r }