Emacs: TeX pdf compression now supports spaces.
Emacs: tex-clean in LISP, no more shell.master
parent
b97c7e9f40
commit
14dae113bb
|
@ -274,7 +274,7 @@ WARNING: the -shell-escape option is a potential security issue."
|
||||||
(delete-windows-on "*compilation*"))))
|
(delete-windows-on "*compilation*"))))
|
||||||
|
|
||||||
|
|
||||||
(defcustom tex-my-extension-list '(".aux" ".glg" ".glo" ".gls" ".idx" ".ilg" ".ind" ".lof" ".log" ".nav" ".out" ".snm" ".synctex" ".synctex.gz" ".tns" ".toc" ".xdy")
|
(defcustom tex-my-extension-list '("aux" "glg" "glo" "gls" "idx" "ilg" "ind" "lof" "log" "nav" "out" "snm" "synctex" "synctex.gz" "tns" "toc" "xdy")
|
||||||
"List of known TeX exentsions. This list is used by 'tex-clean to purge all matching files."
|
"List of known TeX exentsions. This list is used by 'tex-clean to purge all matching files."
|
||||||
:safe 'listp)
|
:safe 'listp)
|
||||||
|
|
||||||
|
@ -290,11 +290,23 @@ but there is no warranty."
|
||||||
buffer-file-name
|
buffer-file-name
|
||||||
tex-my-masterfile)))
|
tex-my-masterfile)))
|
||||||
|
|
||||||
(setq file-noext (replace-regexp-in-string ".tex" "" (file-name-nondirectory local-master)))
|
(let (
|
||||||
(shell-command
|
;; File name without extension.
|
||||||
(concat "rm -f \"" file-noext
|
(file
|
||||||
(mapconcat 'identity tex-my-extension-list (concat "\" \"" file-noext))
|
(replace-regexp-in-string "tex" "" (file-name-nondirectory local-master))))
|
||||||
"\""))))
|
|
||||||
|
;; Concatate file name to list.
|
||||||
|
(mapcar
|
||||||
|
;; Delete file if exist
|
||||||
|
(lambda (argfile) (interactive)
|
||||||
|
(when (and (file-exists-p argfile) (file-writable-p argfile))
|
||||||
|
(delete-file argfile)
|
||||||
|
(message "[%s] deleted." argfile)))
|
||||||
|
(mapcar
|
||||||
|
;; Concat file name with extensions.
|
||||||
|
(lambda (arg) (interactive) (concat file arg))
|
||||||
|
tex-my-extension-list))
|
||||||
|
)))
|
||||||
|
|
||||||
(defun tex-pdf-compress ()
|
(defun tex-pdf-compress ()
|
||||||
"PDF compressions might really strip down the PDF size. The
|
"PDF compressions might really strip down the PDF size. The
|
||||||
|
@ -313,13 +325,13 @@ your document embeds raster graphics."
|
||||||
(file-temp
|
(file-temp
|
||||||
(concat (make-temp-name (concat "/tmp/" (file-name-nondirectory local-master))) ".pdf"))
|
(concat (make-temp-name (concat "/tmp/" (file-name-nondirectory local-master))) ".pdf"))
|
||||||
|
|
||||||
;; File name with extension.
|
;; File name with PDF extension.
|
||||||
(file
|
(file
|
||||||
(replace-regexp-in-string "tex" "pdf" (file-name-nondirectory local-master))))
|
(replace-regexp-in-string "tex" "pdf" (file-name-nondirectory local-master))))
|
||||||
|
|
||||||
(when (and (file-exists-p file) (file-writable-p file))
|
(when (and (file-exists-p file) (file-writable-p file))
|
||||||
(shell-command
|
(shell-command
|
||||||
(concat "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=" file-temp " " file))
|
(concat "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=\"" file-temp "\" \"" file "\""))
|
||||||
(rename-file file-temp file t)
|
(rename-file file-temp file t)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue