generated from code-instable/LaTeX-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.zsh
50 lines (43 loc) · 1.47 KB
/
compile.zsh
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
if [[ $(uname) == "Linux" ]]; then
echo "please launch evince-synctex manually to get synctex working !"
else
echo "synctex supported by default."
fi
my $evince_synctex_path = '$HOME/bin/evince_synctex.zsh';
if (!-x $evince_synctex_path) {
echo "evince_synctex script should be exectuable, setting permission to 755"
chmod 0755, $evince_synctex_path;
}
if [ ! -d "./aux_files" ]; then
echo "directory \"./aux_files\" does not exist"
echo "creating directory \"./aux_files\""
mkdir -p "./aux_files"
fi
# ⚠️ | fixing the error : I CANT WRITE TO FILE
# $ | when the include is in a subfolder
content_list=(src/content/*)
# removes "src/"
content_list_trimmed=("${content_list[@]/#src\//}")
for item in "${content_list_trimmed[@]}"; do
echo "checking if directory $item is available in aux_files..."
if [ ! -d "aux_files/$item" ]; then
echo "creating directory $item in aux_files..."
mkdir -p "aux_files/$item"
else
echo "directory $item already exists in aux_files..."
fi
done
if [[ $1 == "-r" ]]; then
latexmk -pdf -bibtex -pv -time -silent "src/rapport.tex"
elif [[ $1 == "-t" ]]; then
latexmk -pdf -bibtex -pv -time -silent "src/tests.tex"
elif [[ $1 == "-h" ]]; then
echo "▶ Documentation : -d"
echo "▶ Rapport : -r"
echo "▶ Tests : -t"
echo "▶ All : no arg"
elif [[ $1 == "-d" ]]; then
latexmk -pdf -bibtex -pv -time -silent "src/documentation.tex"
else
latexmk -pdf -bibtex -pv -time
fi