+# Make and clean glossaries
+add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
+add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
+sub run_makeglossaries {
+ if ( $silent ) {
+ system "makeglossaries -q '$_[0]'";
+ }
+ else {
+ system "makeglossaries '$_[0]'";
+ };
+}
+push @generated_exts, 'glo', 'gls', 'glg';
+push @generated_exts, 'acn', 'acr', 'alg';
+
+# Clean hyperref backrefs file
+push @generated_exts, 'brf';
+
+# Clean thumbs file
+push @generated_exts, 'tmb';
+
+# Clean bbl file as well
+$bibtex_use = 2;
+
+# Clean mkindex files
+$clean_ext .= ' %R.ist %R.xdy';