-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean-up.sh
executable file
·49 lines (41 loc) · 1.28 KB
/
clean-up.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
47
48
#!/bin/sh
# [Gedit Tool]
# Name=Clean Up Files
# Shortcut=<Primary>5
# Languages=latex
# Applicability=titled
# Output=nothing
# Input=nothing
# Save-files=nothing
filename=$GEDIT_CURRENT_DOCUMENT_NAME
shortname=${filename%.*}
pathname=$GEDIT_CURRENT_DOCUMENT_PATH
directory=`dirname "$pathname"`
# Standard garbage
extensions="acn acr alg aux bbl blg dvi \
fdb_latexmk glg glo gls idx \
ilg ind ist lof lol log lot \
lyx maf mp mtc mtc1 nav nlo \
out pdfsync snm spl synctex \
synctex.gz tmp toc top tui vrb \
swp fls dep bdx bnd auxx \
idv lg glo gls glg acr acn alg \
mlf ptc plf plt stc slf slt \
maf mld mlo los"
for databaseName in $extensions; do
rm -f "$directory"/*.$databaseName
done
# Remove PS output. All we want is the final PDF output, right?
rm -f "$directory"/"$shortname.ps"
# More garbage
rm -f "$directory"/*~ \
"$directory"/"#"*"#" \
"$directory"/.??*xml \
"$directory"/*-eps-converted-to.pdf
# In times of Dropbox with free 30-day history/revision,
# who needs backup files? Seriously.
rm -f "$directory"/*.bak \
"$directory"/*.tex.backup \
"$directory"/*.bib.backup
# Some LaTeX editors create garbage directories
rm -fR "$directory"/auto