-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.stu
110 lines (87 loc) · 2 KB
/
main.stu
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# This handbook is built using Stu instead of Make. Get Stu at:
#
# https://github.com/kunegis/stu
#
# Once installed, execute 'stu' instead of 'make', from within this
# directory.
#
% version 2.5
@main: konect-handbook.pdf;
@arxiv: arxiv.tar.gz;
>MATLABPATH:
{
printf "$PWD:$PWD/../matlab/"
}
konect-handbook.pdf: [FILES]
{
rm -f *.aux *.bbl *.blg *.log *.out
pdflatex -file-line-error -halt-on-error konect-handbook.tex
bibtex konect-handbook
pdflatex -file-line-error -halt-on-error konect-handbook.tex
pdflatex -file-line-error -halt-on-error konect-handbook.tex
}
>colors.tex: <konect-toolbox/m/konect_data_category.m mkcolors
{
echo '%auto-ignore'
echo "% Auto-generated by Stu on $(date)"
./mkcolors
}
konect-toolbox/m/konect_data_category.m: -p konect-toolbox;
konect-toolbox: {
echo "*** Symlink konect-toolbox/ to here"
echo "*** Konect-Toolbox is available at https://github.com/kunegis/konect-toolbox"
exit 1
}
>FILES: -t texdep konect-handbook.tex
{
./texdep konect-handbook.tex
}
>FILES-ARXIV: <FILES
{
# Replace the .bib files by the single .bbl file
sed -E -e '/.bib$/d'
echo konect-handbook.bbl
}
arxiv.tar.gz: [FILES-ARXIV] FILES-ARXIV
{
tar cfvvz arxiv.tar.gz $(cat FILES-ARXIV)
}
plot/$name.pdf:
cpimg
[plot/dep.plot.$name]
{
if [ ! -e analysis/plot/"$name".eps ] ; then
echo >&2 "Warning: 'analysis/plot/$name.eps' does not exist"
touch -- plot/"$name".pdf
exit 0
fi
./cpimg analysis/plot/"$name".eps plot/"$name".pdf
}
>plot/dep.plot.$name:
PLOT_NONOPTIONAL
{
if grep -qE '^\s*0' PLOT_NONOPTIONAL ; then
printf '%s ' '-o'
fi
echo analysis/plot/"$name".eps
}
tex/$name.tex = -o analysis/tex/$name.tex;
# Determines whether to use external images or not. Contains '1' or
# '0'.
PLOT_NONOPTIONAL;
#
# External files
#
texdep = stu-utils/;
cpimg = stu-utils/;
bibtex/$name.bib;
>$name.bib: <bibtex/$name.bib
{
sed -E -e '/^\s+url/d'
}
konect.bib = -o konect-extr/;
konect-extr/konect.bib;
@clean {
rm -Rf $(cat .gitignore)
}