-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcompilar.sh
executable file
·46 lines (35 loc) · 1011 Bytes
/
compilar.sh
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
#!/bin/bash
# Compilar
echo -n $'Compilando... pdflatex (1/3)\r'
pdflatex -interaction=nonstopmode main.tex > /dev/null
echo -n $'Compilando... bibtex\r'
bibtex main > /tmp/bibtex.log
echo -n $'Compilando... makeglossaries\r'
makeglossaries main > /tmp/makeglossaries.log
echo -n $'Compilando... pdflatex (2/3)\r'
pdflatex -interaction=nonstopmode main.tex > /dev/null
echo -n $'Compilando... pdflatex (3/3)\r'
pdflatex -interaction=nonstopmode main.tex > /tmp/pdflatex.log
mv main.pdf "Trabajo de Fin de Master.pdf"
# Limpiar archivos auxiliares
echo -n $'Limpiando...\r'
./limpiar.sh
echo -n $'Compilacion terminada. '; date
#Latex Errors
if grep -q '!' /tmp/pdflatex.log
then
echo ""
echo -e "Latex Errors: \e[31m\e[1m"
grep '!' -n -A1 /tmp/pdflatex.log
#Return to normal color
echo -e "\e[39m\e[0m"
fi
#BibTex Errors
if grep -q 'There was' /tmp/bibtex.log
then
echo ""
echo -e "Bibtex Errors! Check log: \e[95m\e[1m"
cat /tmp/bibtex.log
#Return to normal color
echo -e "\e[39m\e[0m"
fi